package com.ikeirnez.pluginmessageframework;

import com.ikeirnez.pluginmessageframework.packet.Packet;

import java.lang.reflect.Field;

/**
 * A small utility class to sneakily throw exceptions without having them checked.
 */
public class Utilities {

    private Utilities() {}

    public static void setReceived(Packet packet) {
        try {
            Field field = Packet.class.getDeclaredField("received");
            field.setAccessible(true);
            field.setBoolean(packet, true);
        } catch (NoSuchFieldException | IllegalAccessException e) {
            e.printStackTrace();
        }
    }

    /**
     * Throws an exception without having it checked.
     *
     * @param ex the exception to throw
     */
    public static void sneakyThrow(Throwable ex) {
        //noinspection ThrowableResultOfMethodCallIgnored
        Utilities.<RuntimeException>sneakyThrowInner(ex);
    }

    @SuppressWarnings("unchecked")
    private static <T extends Throwable> T sneakyThrowInner(Throwable ex) throws T {
        throw (T) ex;
    }

}

@@ -142,145 +142,213 @@
 %0A * 
-A small utility class to sneakily throw exceptions without having them checked.%0A */%0Apublic class Utilities %7B%0A%0A    private Utilities() %7B%7D%0A
+Utilities for internal use.%0A */%0Apublic class Utilities %7B%0A%0A    private Utilities() %7B%7D%0A%0A    /**%0A     * Sets a packet as being received.%0A     *%0A     * @param packet the packet to set as being received%0A     */
 %0A   

Fix this javadoc