public
Created

Detect private methods

  • Download Gist
gistfile1.java
Java
1 2 3 4 5 6 7 8 9
for (Method method : clazz.getDeclaredMethods()) {
if (method != null) {
try {
clazz.getMethod(method.getName(), method.getParameterTypes());
} catch (NoSuchMethodException e) {
logger.warn("non-public method: " + method.getDeclaringClass().getName() + "." + method.getName() + "()");
}
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.