All Downloads are FREE. Search and download functionalities are using the official Maven repository.

src.samples.java.ex.ROOM_Sample Maven / Gradle / Ivy

Go to download

An auxiliary findbugs.sourceforge.net plugin for java bug detectors that fall outside the narrow scope of detectors to be packaged with the product itself.

There is a newer version: 7.6.8
Show newest version
package ex;
import java.lang.reflect.Method;

public class ROOM_Sample {
    public static final Class[] STATIC_NO_ARGS = new Class[0];
    public final Class[] NO_ARGS = new Class[0];

    public void testRoomWithLocals() throws Exception {
        Class c = Class.forName("java.lang.Object");
        Method m = c.getMethod("equals", Object.class);

        String s = (String) m.invoke(this, new ROOM_Sample());
    }

    public void testRoomWithField() throws Exception {
        Class c = Class.forName("java.lang.Object");
        Method m = c.getMethod("toString", NO_ARGS);

        String s = (String) m.invoke(this, (Object[]) null);
    }

    public void testRoomWithStatic() throws Exception {
        Class c = Class.forName("java.lang.Object");
        Method m = c.getMethod("hashCode", STATIC_NO_ARGS);

        String s = (String) m.invoke(this, (Object[]) null);
    }

    public void testRoomWithNull() throws Exception {
        Class c = Class.forName("java.lang.Object");
        Method m = c.getMethod("notify", (Class[]) null);

        String s = (String) m.invoke(this, (Object[]) null);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy