Buggy code:
public CodeSnippetScope ( BlockScope parent ) { } public CodeSnippetScope ( BlockScope parent , int variableCount ) { } public final boolean canBeSeenByForCodeSnippet ( FieldBinding fieldBinding , TypeBinding receiverType , InvocationSite invocationSite , Scope scope ) { } public final boolean canBeSeenByForCodeSnippet ( MethodBinding methodBinding , TypeBinding receiverType , InvocationSite invocationSite , Scope scope ) { } public final boolean canBeSeenByForCodeSnippet ( ReferenceBinding referenceBinding , ReferenceBinding receiverType ) { } public MethodBinding findExactMethod ( ReferenceBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { } public FieldBinding findFieldForCodeSnippet ( TypeBinding receiverType , char [ ] fieldName , InvocationSite invocationSite ) { } public MethodBinding findMethod ( ReferenceBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { ReferenceBinding currentType = receiverType ; MethodBinding matchingMethod = null ; ObjectVector found = new ObjectVector ( ) ; if ( currentType . isInterface ( ) ) { MethodBinding [ ] currentMethods = currentType . getMethods ( selector ) ; int currentLength = currentMethods . length ; if ( currentLength == 1 ) { matchingMethod = currentMethods [ 0 ] ; } else if ( currentLength > 1 ) { for ( int f = 0 ; f < currentLength ; f ++ ) found . add ( currentMethods [ f ] ) ; } matchingMethod = findMethodInSuperInterfaces ( currentType , selector , found , matchingMethod ) ; currentType = getJavaLangObject ( ) ; } ReferenceBinding classHierarchyStart = currentType ; while ( currentType != null ) { MethodBinding [ ] currentMethods = currentType . getMethods ( selector ) ; int currentLength = currentMethods . length ; if ( ( ( currentLength == 1 ) && ( matchingMethod == null ) ) && ( ( found . size ) == 0 ) ) { matchingMethod = currentMethods [ 0 ] ; } else if ( currentLength > 0 ) { if ( ( ( found . size ) == 0 ) && ( matchingMethod != null ) ) found . add ( matchingMethod ) ; for ( int f = 0 ; f < currentLength ; f ++ ) found . add ( currentMethods [ f ] ) ; } currentType = currentType . superclass ( ) ; } int foundSize = found . size ; if ( foundSize == 0 ) { if ( matchingMethod == null ) { MethodBinding interfaceMethod = findDefaultAbstractMethod ( receiverType , selector , argumentTypes , invocationSite , classHierarchyStart , matchingMethod , found ) ; if ( interfaceMethod != null ) return interfaceMethod ; } return matchingMethod ; } MethodBinding [ ] candidates = new MethodBinding [ foundSize ] ; int candidatesCount = 0 ; for ( int i = 0 ; i < foundSize ; i ++ ) { MethodBinding methodBinding = ( ( MethodBinding ) ( found . elementAt ( i ) ) ) ; MethodBinding compatibleMethod = computeCompatibleMethod ( methodBinding , argumentTypes , invocationSite ) ; if ( compatibleMethod != null ) candidates [ ( candidatesCount ++ ) ] = compatibleMethod ; } if ( candidatesCount == 1 ) { return candidates [ 0 ] ; } if ( candidatesCount == 0 ) { MethodBinding interfaceMethod = findDefaultAbstractMethod ( receiverType , selector , argumentTypes , invocationSite , classHierarchyStart , matchingMethod , found ) ; if ( interfaceMethod != null ) return interfaceMethod ; int argLength = argumentTypes . length ; foundSize = found . size ; nextMethod : for ( int i = 0 ; i < foundSize ; i ++ ) { MethodBinding methodBinding = ( ( MethodBinding ) ( found . elementAt ( i ) ) ) ; TypeBinding [ ] params = methodBinding . parameters ; int paramLength = params . length ; nextArg : for ( int a = 0 ; a < argLength ; a ++ ) { TypeBinding arg = argumentTypes [ a ] ; for ( int p = 0 ; p < paramLength ; p ++ ) if ( ( params [ p ] ) == arg ) continue nextArg ; continue nextMethod ; } return methodBinding ; } return ( ( MethodBinding ) ( found . elementAt ( 0 ) ) ) ; } int visiblesCount = 0 ; for ( int i = 0 ; i < candidatesCount ; i ++ ) { MethodBinding methodBinding = candidates [ i ] ; if ( canBeSeenByForCodeSnippet ( methodBinding , receiverType , invocationSite , this ) ) { if ( visiblesCount != i ) { candidates [ i ] = null ; candidates [ visiblesCount ] = methodBinding ; } visiblesCount ++ ; } } if ( visiblesCount == 1 ) { return candidates [ 0 ] ; } if ( visiblesCount == 0 ) { MethodBinding interfaceMethod = findDefaultAbstractMethod ( receiverType , selector , argumentTypes , invocationSite , classHierarchyStart , matchingMethod , found ) ; if ( interfaceMethod != null ) return interfaceMethod ; return new ProblemMethodBinding ( candidates [ 0 ] . selector , candidates [ 0 ] . parameters , candidates [ 0 ] . declaringClass , NotVisible ) ; } <START_BUG> if ( candidates [ 0 ] . declaringClass . isClass ( ) ) { <END_BUG> return mostSpecificClassMethodBinding ( candidates , visiblesCount , invocationSite ) ; } else { return mostSpecificInterfaceMethodBinding ( candidates , visiblesCount , invocationSite ) ; } } public MethodBinding findMethodForArray ( ArrayBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { } public Binding getBinding ( char [ ] [ ] compoundName , int mask , InvocationSite invocationSite , ReferenceBinding receiverType ) { } public MethodBinding getConstructor ( ReferenceBinding receiverType , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { } public FieldBinding getFieldForCodeSnippet ( TypeBinding receiverType , char [ ] fieldName , InvocationSite invocationSite ) { } public MethodBinding getImplicitMethod ( ReferenceBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { } }

Fix:
if ( ! ( candidates [ 0 ] . declaringClass . isInterface ( ) ) ) {