public static boolean matchInheritance(final Method subclassMethod, final Method superclassMethod) { if (Modifier.isStatic(superclassMethod.getModifiers()) || subclassMethod.equals(superclassMethod)) { return false; } if (matchSignature(subclassMethod, superclassMethod)) { final Package subclassPackage = subclassMethod.getDeclaringClass().getPackage(); final Package superclassPackage = superclassMethod.getDeclaringClass().getPackage(); final int superMethodModifiers = superclassMethod.getModifiers(); return isAccessable(subclassPackage, superclassPackage, superMethodModifiers); } else { return false; } }
public static boolean containMethod(final Set<Method> methods, final Method method) { for (final Method m : methods) { if (matchSignature(m, method) && matchModifier(m, method)) { return true; } } return false; }
public static Method getMatch(final Set<Method> methods, final Method maybeSuperclassMethod, final boolean matchInheritance) { for (final Method m : methods) { if (!matchInheritance) { if (matchModifier(m, maybeSuperclassMethod) && matchSignature(m, maybeSuperclassMethod)) { return m; } } else { if (matchInheritance(m, maybeSuperclassMethod)) { return m; } } } return null; }
public static boolean containMethod(final Set<Method> methods, final Method method) { for (final Method m : methods) { if (matchSignature(m, method) && matchModifier(m, method)) { return true; } } return false; }
public static boolean matchInheritance(final Method subclassMethod, final Method superclassMethod) { if (Modifier.isStatic(superclassMethod.getModifiers()) || subclassMethod.equals(superclassMethod)) { return false; } if (matchSignature(subclassMethod, superclassMethod)) { final Package subclassPackage = subclassMethod.getDeclaringClass().getPackage(); final Package superclassPackage = superclassMethod.getDeclaringClass().getPackage(); final int superMethodModifiers = superclassMethod.getModifiers(); return isAccessable(subclassPackage, superclassPackage, superMethodModifiers); } else { return false; } }
public static Method getMatch(final Set<Method> methods, final Method maybeSuperclassMethod, final boolean matchInheritance) { for (final Method m : methods) { if (!matchInheritance) { if (matchModifier(m, maybeSuperclassMethod) && matchSignature(m, maybeSuperclassMethod)) { return m; } } else { if (matchInheritance(m, maybeSuperclassMethod)) { return m; } } } return null; }