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 ( ) { } protected int fineGrain ( ) { } public void initializePolymorphicSearch ( MatchLocator locator ) { } private boolean isTypeInSuperDeclaringTypeNames ( char [ ] [ ] typeName ) { } protected boolean isVirtualInvoke ( MethodBinding method , MessageSend messageSend ) { } public int match ( ASTNode node , MatchingNodeSet nodeSet ) { } 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 { } protected void matchReportReference ( ASTNode reference , IJavaElement element , IJavaElement localElement , IJavaElement [ ] otherElements , Binding elementBinding , int accuracy , MatchLocator locator ) throws CoreException { MethodBinding methodBinding = ( reference instanceof MessageSend ) ? ( ( MessageSend ) ( reference ) ) . binding : elementBinding instanceof MethodBinding ? ( ( MethodBinding ) ( elementBinding ) ) : null ; if ( this . isDeclarationOfReferencedMethodsPattern ) { if ( methodBinding == null ) return ; if ( accuracy != ( SearchMatch . A_ACCURATE ) ) return ; DeclarationOfReferencedMethodsPattern declPattern = ( ( DeclarationOfReferencedMethodsPattern ) ( this . pattern ) ) ; while ( ( element != null ) && ( ! ( declPattern . enclosingElement . equals ( element ) ) ) ) element = element . getParent ( ) ; if ( element != null ) { reportDeclaration ( methodBinding , locator , declPattern . knownMethods ) ; } } else { <START_BUG> MethodReferenceMatch methodReferenceMatch = locator . newMethodReferenceMatch ( element , elementBinding , accuracy , ( - 1 ) , ( - 1 ) , false , false , reference ) ; <END_BUG> methodReferenceMatch . localElement ( localElement ) ; this . match = methodReferenceMatch ; if ( ( this . pattern . findReferences ) && ( reference instanceof MessageSend ) ) { IJavaElement focus = ( ( InternalSearchPattern ) ( this . pattern ) ) . focus ; if ( ( focus != null ) && ( ( focus . getElementType ( ) ) == ( IJavaElement . METHOD ) ) ) { if ( ( methodBinding != null ) && ( ( methodBinding . declaringClass ) != null ) ) { boolean isPrivate = Flags . isPrivate ( ( ( IMethod ) ( focus ) ) . getFlags ( ) ) ; if ( isPrivate && ( ! ( CharOperation . equals ( methodBinding . declaringClass . sourceName , focus . getParent ( ) . getElementName ( ) . toCharArray ( ) ) ) ) ) { return ; } } } matchReportReference ( ( ( MessageSend ) ( reference ) ) , locator , ( ( MessageSend ) ( reference ) ) . binding ) ; } else { if ( reference instanceof SingleMemberAnnotation ) { reference = ( ( SingleMemberAnnotation ) ( reference ) ) . memberValuePairs ( ) [ 0 ] ; this . match . setImplicit ( true ) ; } int offset = reference . sourceStart ; int length = ( ( reference . sourceEnd ) - offset ) + 1 ; this . match . setOffset ( offset ) ; this . match . setLength ( length ) ; locator . report ( this . match ) ; } } } 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 ) { } private boolean resolveLevelAsSuperInvocation ( ReferenceBinding type , TypeBinding [ ] argumentTypes , boolean methodAlreadyVerified ) { } public String toString ( ) { } }

Fix:
InternalMethodReferenceMatch methodReferenceMatch = locator . newMethodReferenceMatch ( element , elementBinding , accuracy , ( - 1 ) , ( - 1 ) , false , false , reference ) ;