http://openide.netbeans.org/issues/show_bug.cgi?id=11679
A public method is defined in package private class. The package private class is then extended by a public class ni the same package. So:
Method theMethod = publicIntance.getClass().getMethod("theMethod");
returns proper method (quering it for accessibility returns true). And it is possible to call the method without reflection:
publicInstance.theMethod();
but reflection invocation
theMethod.invoke(publicInstance, new Object[0])
throws the exception.