@@ -114,7 +114,7 @@ static String resolveMethodOverload(Class<?> clazz, String methodName, Object[]
114114 methodOverloadsForClass .put (c , finder );
115115 }
116116
117- if (!finder .errorGettingMethods ()) {
117+ if (!finder .errorGettingMethods ()) {
118118 ArrayList <Method > matchingMethods = finder .getMatchingMethods (methodName );
119119 tryFindMatches (methodName , candidates , args , argLength , matchingMethods );
120120 if (candidates .size () > iterationIndex && candidates .get (iterationIndex ).y == 0 ) {
@@ -123,7 +123,7 @@ static String resolveMethodOverload(Class<?> clazz, String methodName, Object[]
123123 }
124124 } else {
125125 Method method = finder .getMatchingMethodWithArguments (methodName , args );
126- if (method != null ) {
126+ if (method != null ) {
127127 candidates .add (new Tuple <>(method , 0 ));
128128 break ;
129129 }
@@ -159,8 +159,8 @@ static void tryFindMatches(String methodName, ArrayList<Tuple<Method, Integer>>
159159 for (int i = 0 ; i < params .length ; i ++) {
160160 if (args [i ] != null ) {
161161 Class <?> argClass = args [i ] instanceof NullObject ?
162- ((NullObject )args [i ]).getNullObjectClass ()
163- : args [i ].getClass ();
162+ ((NullObject ) args [i ]).getNullObjectClass ()
163+ : args [i ].getClass ();
164164
165165 Tuple <Boolean , Integer > res = isAssignableFrom (params [i ], argClass );
166166 success = res .x .booleanValue ();
@@ -226,8 +226,8 @@ static Constructor<?> resolveConstructor(Class<?> clazz, Object[] args) throws C
226226 for (int i = 0 ; i < args .length ; i ++) {
227227 if (args [i ] != null ) {
228228 Class <?> argClass = args [i ] instanceof NullObject ?
229- ((NullObject )args [i ]).getNullObjectClass ()
230- : args [i ].getClass ();
229+ ((NullObject ) args [i ]).getNullObjectClass ()
230+ : args [i ].getClass ();
231231
232232 Tuple <Boolean , Integer > res = isAssignableFrom (paramTypes [i ], argClass );
233233 success = res .x .booleanValue ();
@@ -514,7 +514,7 @@ public MethodFinder(Class<?> clazz) {
514514 errorGettingMethods = true ;
515515 }
516516 }
517- Method [] interfaceDefaultMethods = getInterfaceDefaultMethods (clazz );
517+ Method [] interfaceDefaultMethods = (! clazz . isInterface ()) ? getInterfaceDefaultMethods (clazz ) : new Method [ 0 ] ;
518518 declaredMethods = concatenate (declaredMethods , interfaceDefaultMethods );
519519 this .couldNotGetMethods = errorGettingMethods ;
520520 }
@@ -531,13 +531,13 @@ private static <T> T[] concatenate(T[] a, T[] b) {
531531 return c ;
532532 }
533533
534- private Method [] getInterfaceDefaultMethods (Class <?> clazz ){
534+ private Method [] getInterfaceDefaultMethods (Class <?> clazz ) {
535535 List <Method > interfaceDefaultMethods = new ArrayList <>();
536536 Class <?>[] interfaces = clazz .getInterfaces ();
537- for (Class <?> interfaze : interfaces ){
538- for (Method method : interfaze .getMethods ()) {
537+ for (Class <?> interfaze : interfaces ) {
538+ for (Method method : interfaze .getMethods ()) {
539539 int methodModifiers = method .getModifiers ();
540- if (!Modifier .isAbstract (methodModifiers ) && !Modifier .isStatic (methodModifiers )){
540+ if (!Modifier .isAbstract (methodModifiers ) && !Modifier .isStatic (methodModifiers )) {
541541 interfaceDefaultMethods .add (method );
542542 }
543543 }
@@ -551,7 +551,7 @@ public boolean errorGettingMethods() {
551551 }
552552
553553 public ArrayList <Method > getMatchingMethods (String methodName ) {
554- if (this .errorGettingMethods ()) {
554+ if (this .errorGettingMethods ()) {
555555 return null ;
556556 }
557557 ArrayList <Method > matches = this .matchingMethods .get (methodName );
0 commit comments