MCPcopy Create free account
hub / github.com/beanshell/beanshell / getVisibility

Method getVisibility

src/bsh/Reflect.java:910–919  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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> {

Callers 1

compareMethod · 0.95

Calls 1

isPublicMethod · 0.95

Tested by

no test coverage detected