Buggy code:
public class MethodLocator extends PatternLocator { protected MethodPattern pattern ; protected boolean isDeclarationOfReferencedMethodsPattern ; public char [ ] [ ] [ ] allSuperDeclaringTypeNames ; private HashMap methodDeclarationsWithInvalidParam = new HashMap ( ) ; public MethodLocator ( MethodPattern pattern ) { } protected void clear ( ) { } public void initializePolymorphicSearch ( MatchLocator locator ) { } private boolean isTypeInSuperDeclaringTypeNames ( char [ ] [ ] typeName ) { } protected boolean isVirtualInvoke ( MethodBinding method , MessageSend messageSend ) { } public int match ( ASTNode node , MatchingNodeSet nodeSet ) { int declarationsLevel = PatternLocator . IMPOSSIBLE_MATCH ; if ( this . pattern . findReferences ) { if ( node instanceof ImportReference ) { ImportReference importRef = ( ( ImportReference ) ( node ) ) ; int length = ( importRef . tokens . length ) - 1 ; <START_BUG> if ( ( ( importRef . isStatic ( ) ) && ( ! ( importRef . onDemand ) ) ) && ( matchesName ( this . pattern . selector , importRef . tokens [ length ] ) ) ) { <END_BUG> char [ ] [ ] compoundName = new char [ length ] [ ] ; System . arraycopy ( importRef . tokens , 0 , compoundName , 0 , length ) ; char [ ] declaringType = CharOperation . concat ( pattern . declaringQualification , pattern . declaringSimpleName , '.' ) ; if ( matchesName ( declaringType , CharOperation . concatWith ( compoundName , '.' ) ) ) { declarationsLevel = ( ( ( InternalSearchPattern ) ( this . pattern ) ) . mustResolve ) ? PatternLocator . POSSIBLE_MATCH : PatternLocator . ACCURATE_MATCH ; } } } } return nodeSet . addMatch ( node , declarationsLevel ) ; } public int match ( MethodDeclaration node , MatchingNodeSet nodeSet ) { } public int match ( MemberValuePair node , MatchingNodeSet nodeSet ) { } public int match ( MessageSend node , MatchingNodeSet nodeSet ) { } public int match ( Annotation node , MatchingNodeSet nodeSet ) { } protected int matchContainer ( ) { } protected void matchLevelAndReportImportRef ( ImportReference importRef , Binding binding , MatchLocator locator ) throws CoreException { } protected int matchMethod ( MethodBinding method , boolean skipImpossibleArg ) { } private boolean matchOverriddenMethod ( ReferenceBinding type , MethodBinding method , MethodBinding matchMethod ) { } protected void matchReportReference ( ASTNode reference , IJavaElement element , Binding elementBinding , int accuracy , MatchLocator locator ) throws CoreException { } void matchReportReference ( MessageSend messageSend , MatchLocator locator , MethodBinding methodBinding ) throws CoreException { } private boolean methodParametersEqualsPattern ( MethodBinding method ) { } public SearchMatch newDeclarationMatch ( ASTNode reference , IJavaElement element , Binding elementBinding , int accuracy , int length , MatchLocator locator ) { } protected int referenceType ( ) { } protected void reportDeclaration ( MethodBinding methodBinding , MatchLocator locator , SimpleSet knownMethods ) throws CoreException { } public int resolveLevel ( ASTNode possibleMatchingNode ) { } public int resolveLevel ( Binding binding ) { } protected int resolveLevel ( MessageSend messageSend ) { } protected int resolveLevelAsSubtype ( char [ ] qualifiedPattern , ReferenceBinding type , TypeBinding [ ] argumentTypes ) { } public String toString ( ) { } }

Fix:
if ( ( ( importRef . isStatic ( ) ) && ( ( ( importRef . bits ) & ( ASTNode . OnDemand ) ) == 0 ) ) && ( matchesName ( this . pattern . selector , importRef . tokens [ length ] ) ) ) {