Buggy code:
} } } if ( ( fuzzyProblem == null ) && ( ! ( methodBinding . isStatic ( ) ) ) ) { if ( insideConstructorCall ) { insideProblem = new ProblemMethodBinding ( methodBinding , methodBinding . selector , methodBinding . parameters , ProblemReasons . NonStaticReferenceInConstructorInvocation ) ; } else if ( insideStaticContext ) { insideProblem = new ProblemMethodBinding ( methodBinding , methodBinding . selector , methodBinding . parameters , ProblemReasons . NonStaticReferenceInStaticContext ) ; } } if ( ( ( receiverType == ( methodBinding . declaringClass ) ) || ( ( receiverType . getMethods ( selector ) ) != ( NoMethods ) ) ) || ( ( ( fuzzyProblem == null ) || ( ( fuzzyProblem . problemId ( ) ) != ( ProblemReasons . NotVisible ) ) ) && ( ( environment ( ) . options . complianceLevel ) >= ( ClassFileConstants . JDK1_4 ) ) ) ) { if ( foundMethod == null ) { if ( depth > 0 ) { invocationSite . setDepth ( depth ) ; invocationSite . setActualReceiverType ( receiverType ) ; } if ( fuzzyProblem != null ) return fuzzyProblem ; if ( insideProblem != null ) return insideProblem ; return methodBinding ; } if ( ( foundMethod . declaringClass ) != ( methodBinding . declaringClass ) ) return new ProblemMethodBinding ( methodBinding , methodBinding . selector , methodBinding . parameters , ProblemReasons . InheritedNameHidesEnclosingName ) ; } } if ( ( foundMethod == null ) || ( ( ( foundMethod . problemId ( ) ) == ( ProblemReasons . NotVisible ) ) && ( ( methodBinding . problemId ( ) ) != ( ProblemReasons . NotVisible ) ) ) ) { if ( depth > 0 ) { invocationSite . setDepth ( depth ) ; invocationSite . setActualReceiverType ( receiverType ) ; } foundFuzzyProblem = fuzzyProblem ; foundInsideProblem = insideProblem ; if ( fuzzyProblem == null ) foundMethod = methodBinding ; } } depth ++ ; insideStaticContext |= receiverType . isStatic ( ) ; MethodScope enclosingMethodScope = scope . methodScope ( ) ; insideConstructorCall = ( enclosingMethodScope == null ) ? false : enclosingMethodScope . isConstructorCall ; break ; case Scope . COMPILATION_UNIT_SCOPE : break done ; } scope = scope . parent ; } if ( foundFuzzyProblem != null ) return foundFuzzyProblem ; if ( foundInsideProblem != null ) return foundInsideProblem ; if ( foundMethod != null ) return foundMethod ; if ( insideStaticContext && ( ( environment ( ) . options . sourceLevel ) >= ( ClassFileConstants . JDK1_5 ) ) ) { CompilationUnitScope unitScope = ( ( CompilationUnitScope ) ( scope ) ) ; ImportBinding [ ] imports = unitScope . imports ; if ( imports != null ) { int importLevel = - 1 ; for ( int i = 0 , length = imports . length ; i < length ; i ++ ) { ImportBinding importBinding = imports [ i ] ; if ( importBinding . isStatic ( ) ) { Binding resolvedImport = importBinding . resolvedImport ; MethodBinding possible = null ; if ( ( ! ( importBinding . onDemand ) ) && ( importBinding . isStatic ( ) ) ) { if ( resolvedImport instanceof MethodBinding ) { MethodBinding staticMethod = ( ( MethodBinding ) ( resolvedImport ) ) ; if ( CharOperation . equals ( staticMethod . selector , selector ) ) possible = findMethod ( staticMethod . declaringClass , selector , argumentTypes , invocationSite ) ; } else if ( resolvedImport instanceof FieldBinding ) { FieldBinding staticField = ( ( FieldBinding ) ( resolvedImport ) ) ; if ( CharOperation . equals ( staticField . name , selector ) ) { char [ ] [ ] importName = importBinding . reference . tokens ; TypeBinding referencedType = getType ( importName , ( ( importName . length ) - 1 ) ) ; if ( referencedType != null ) possible = findMethod ( ( ( ReferenceBinding ) ( referencedType ) ) , selector , argumentTypes , invocationSite ) ; } } } else if ( ( ( importBinding . onDemand ) && ( importLevel < 1 ) ) && ( resolvedImport instanceof ReferenceBinding ) ) { possible = findMethod ( ( ( ReferenceBinding ) ( resolvedImport ) ) , selector , argumentTypes , invocationSite ) ; } <START_BUG> if ( possible != null ) { <END_BUG> if ( ! ( possible . isValidBinding ( ) ) ) { if ( foundMethod == null ) foundMethod = possible ; } else if ( possible . isStatic ( ) ) { MethodBinding compatibleMethod = computeCompatibleMethod ( possible , argumentTypes , invocationSite ) ; if ( compatibleMethod != null ) { if ( compatibleMethod . isValidBinding ( ) ) { if ( compatibleMethod . canBeSeenBy ( unitScope . fPackage ) ) { ImportReference importReference = importBinding . reference ; if ( importReference != null ) importReference . used = true ; int matchingImportLevel = ( importBinding . onDemand ) ? 0 : 1 ; if ( matchingImportLevel == importLevel ) { scope = this ; while ( true ) { switch ( scope . kind ) { case Scope . CLASS_SCOPE : return new ProblemMethodBinding ( selector , argumentTypes , ( ( ClassScope ) ( scope ) ) . referenceContext . binding , ProblemReasons . Ambiguous ) ; case Scope . COMPILATION_UNIT_SCOPE : return new ProblemMethodBinding ( compatibleMethod , selector , compatibleMethod . parameters , ProblemReasons . Ambiguous ) ; } scope = scope . parent ; } } foundMethod = compatibleMethod ; importLevel = matchingImportLevel ; } else if ( foundMethod == null ) { foundMethod = new ProblemMethodBinding ( compatibleMethod , selector , compatibleMethod . parameters , ProblemReasons . NotVisible ) ; } } } else if ( foundMethod == null ) { foundMethod = new ProblemMethodBinding ( possible , selector , argumentTypes , ProblemReasons . NotFound ) ; } } } } } } if ( foundMethod != null ) return foundMethod ; }

Fix:
if ( ( possible != null ) && ( possible != foundMethod ) ) {