public static boolean isMethodOverridden ( Method m , LinkedList < Class < ? > > supers ) { // Only check non-private methods for an override. int methodModifier = m . getModifiers ( ) ; if ( ! Modifier . isPrivate ( methodModifier ) ) { // Not a private method, so we need to check if it is overridden. int startIndex = supers . indexOf ( m . getDeclaringClass ( ) ) + 1 ; if ( startIndex < supers . size ( ) ) { String name = m . getName ( ) ; Class < ? > [ ] pTypes = m . getParameterTypes ( ) ; for ( ListIterator < Class < ? > > lit = supers . listIterator ( startIndex ) ; lit . hasNext ( ) ; ) { Class < ? > subClass = lit . next ( ) ; try { subClass . getDeclaredMethod ( name , pTypes ) ; return true ; } catch ( NoSuchMethodException e ) { //FFDCFilter.processException( e, "", "", m); // This is normal, it just means the method was not overridden // by a method in the current subclass being processed. } } } } // The method is not overridden either because it is a private method, // or there is no subclass that overrides the method. return false ; }
d469514 - added entire method .