Buggy code:
public class FieldLocator extends VariableLocator { protected boolean isDeclarationOfAccessedFieldsPattern ; public FieldLocator ( FieldPattern pattern ) { } public int match ( ASTNode node , MatchingNodeSet nodeSet ) { } public int match ( FieldDeclaration node , MatchingNodeSet nodeSet ) { } protected int matchContainer ( ) { } protected int matchField ( FieldBinding field , boolean matchName ) { } protected void matchLevelAndReportImportRef ( ImportReference importRef , Binding binding , MatchLocator locator ) throws CoreException { } protected int matchReference ( Reference node , MatchingNodeSet nodeSet , boolean writeOnlyAccess ) { } protected void matchReportReference ( ASTNode reference , IJavaElement element , Binding elementBinding , int accuracy , MatchLocator locator ) throws CoreException { } protected void updateMatch ( ParameterizedTypeBinding parameterizedBinding , char [ ] [ ] [ ] patternTypeArguments , MatchLocator locator ) { } protected void reportDeclaration ( FieldBinding fieldBinding , MatchLocator locator , SimpleSet knownFields ) throws CoreException { if ( fieldBinding == ( ArrayBinding . ArrayLength ) ) return ; ReferenceBinding declaringClass = fieldBinding . declaringClass ; IType type = locator . lookupType ( declaringClass ) ; if ( type == null ) return ; char [ ] bindingName = fieldBinding . name ; IField field = type . getField ( new String ( bindingName ) ) ; if ( ( knownFields . addIfNotIncluded ( field ) ) == null ) return ; IResource resource = type . getResource ( ) ; boolean isBinary = type . isBinary ( ) ; IBinaryType info = null ; if ( isBinary ) { if ( resource == null ) resource = type . getJavaProject ( ) . getProject ( ) ; info = locator . getBinaryInfo ( ( ( ClassFile ) ( type . getClassFile ( ) ) ) , resource ) ; locator . reportBinaryMemberDeclaration ( resource , field , fieldBinding , info , SearchMatch . A_ACCURATE ) ; } else { if ( declaringClass instanceof ParameterizedTypeBinding ) <START_BUG> declaringClass = ( ( ParameterizedTypeBinding ) ( declaringClass ) ) . type ; <END_BUG> ClassScope scope = ( ( SourceTypeBinding ) ( declaringClass ) ) . scope ; if ( scope != null ) { TypeDeclaration typeDecl = scope . referenceContext ; FieldDeclaration fieldDecl = null ; FieldDeclaration [ ] fieldDecls = typeDecl . fields ; for ( int i = 0 , length = fieldDecls . length ; i < length ; i ++ ) { if ( CharOperation . equals ( bindingName , fieldDecls [ i ] . name ) ) { fieldDecl = fieldDecls [ i ] ; break ; } } if ( fieldDecl != null ) { int offset = fieldDecl . sourceStart ; match = new FieldDeclarationMatch ( ( ( JavaElement ) ( field ) ) . resolved ( fieldBinding ) , SearchMatch . A_ACCURATE , offset , ( ( ( fieldDecl . sourceEnd ) - offset ) + 1 ) , locator . getParticipant ( ) , resource ) ; locator . report ( match ) ; } } } } protected int referenceType ( ) { } public int resolveLevel ( ASTNode possiblelMatchingNode ) { } public int resolveLevel ( Binding binding ) { } protected int resolveLevel ( NameReference nameRef ) { } protected int resolveLevelForType ( TypeBinding typeBinding ) { } }

Fix:
declaringClass = ( ( ParameterizedTypeBinding ) ( declaringClass ) ) . genericType ( ) ;