A method from a non public class gets a visibility score of 0. A method from a public class gets a visibility score of 1. And an interface method will get a visibility score of 2.
(final Method method)
| 908 | * And an interface method will get a visibility score of 2. |
| 909 | */ |
| 910 | private static int getVisibility(final Method method) { |
| 911 | final Class<?> declaringClass = method.getDeclaringClass(); |
| 912 | if (declaringClass.isInterface()) { |
| 913 | return 2; // interface methods are always public |
| 914 | } |
| 915 | if (isPublic(declaringClass)) { |
| 916 | return 1; |
| 917 | } |
| 918 | return 0; |
| 919 | } |
| 920 | |
| 921 | |
| 922 | private static class DummyCollection<T> extends AbstractCollection<T> { |