Skip to content

Instantly share code, notes, and snippets.

@liweinan
Created February 20, 2012 10:06
Show Gist options
  • Save liweinan/1868652 to your computer and use it in GitHub Desktop.
Save liweinan/1868652 to your computer and use it in GitHub Desktop.
Detect private methods
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() + "()");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment