@@ -76,15 +76,10 @@ public DOMMethodLocator(MethodLocator locator) {
7676 private IMethodBinding getDOMASTMethodBinding (ITypeBinding type , String methodName , ITypeBinding [] argumentTypes ) {
7777 if ( type == null )
7878 return null ;
79- Stream < IMethodBinding > smb = Stream .of (type .getDeclaredMethods ())
79+ return Stream .of (type .getDeclaredMethods ())
8080 .filter (method -> Objects .equals (method .getName (), methodName ))
81- .filter (method -> compatibleByErasure (method .getParameterTypes (), argumentTypes ));
82- List <IMethodBinding > all = smb .collect (Collectors .toList ());
83- IMethodBinding m1 = all .size () > 0 ? all .get (0 ) : null ;
84- if ( all .size () > 1 ) {
85- System .out .println ("BREAK" );
86- }
87- return m1 ;
81+ .filter (method -> compatibleByErasure (method .getParameterTypes (), argumentTypes ))
82+ .findAny ().orElse (null );
8883 }
8984 // can be replaced with `Arrays.equals(method.getParameterTypes(), argumentTypes, Comparator.comparing(ITypeBinding::getErasure))`
9085 // but JDT bugs
@@ -734,13 +729,17 @@ protected int resolveLevel(MethodInvocation messageSend) {
734729 int noFlavorDeclaringLevel = declaringLevel & MATCH_LEVEL_MASK ;
735730 int weakerMethod = findWeakerLevel (noFlavorInvocOrDecl , noFlavorDeclaringLevel );
736731 int weakerSimple = (invocOrDeclLevel & MATCH_LEVEL_MASK ) > (declaringLevel & MATCH_LEVEL_MASK ) ? declaringLevel : invocOrDeclLevel ; // return the weaker match
737- if ( weakerMethod != weakerSimple ) {
738- System .out .println ("BREAK" );
739- }
732+ // if( weakerMethod != weakerSimple ) {
733+ // System.out.println("BREAK");
734+ // }
740735 if (declaringFlavors != 0 ) {
741736 // level got some flavors => return it
742737 return declaringLevel ;
743738 }
739+
740+ // if( isPatternExactMatch() && invocationLevel == IMPOSSIBLE_MATCH && declarationLevel == ACCURATE_MATCH ) {
741+ // return IMPOSSIBLE_MATCH;
742+ // }
744743 return weakerMethod ;
745744 }
746745
0 commit comments