Buggy code:
public class MatchLocatorParser extends Parser { MatchingNodeSet matchSet ; PatternLocator patternLocator ; private AbstractSyntaxTreeVisitorAdapter localDeclarationVisitor ; private int matchContainer ; public class NoClassNoMethodDeclarationVisitor extends AbstractSyntaxTreeVisitorAdapter { public boolean visit ( ConstructorDeclaration constructorDeclaration , ClassScope scope ) { } public boolean visit ( FieldDeclaration fieldDeclaration , MethodScope scope ) { } public boolean visit ( Initializer initializer , MethodScope scope ) { } public boolean visit ( MethodDeclaration methodDeclaration , ClassScope scope ) { } } public class MethodButNoClassDeclarationVisitor extends MatchLocatorParser . NoClassNoMethodDeclarationVisitor { public boolean visit ( AnonymousLocalTypeDeclaration anonymousTypeDeclaration , BlockScope scope ) { } public boolean visit ( LocalTypeDeclaration localTypeDeclaration , BlockScope scope ) { } } public class ClassButNoMethodDeclarationVisitor extends AbstractSyntaxTreeVisitorAdapter { public boolean visit ( ConstructorDeclaration constructorDeclaration , ClassScope scope ) { } public boolean visit ( FieldDeclaration fieldDeclaration , MethodScope scope ) { } public boolean visit ( Initializer initializer , MethodScope scope ) { } public boolean visit ( MemberTypeDeclaration memberTypeDeclaration , ClassScope scope ) { } public boolean visit ( MethodDeclaration methodDeclaration , ClassScope scope ) { } } public class ClassAndMethodDeclarationVisitor extends MatchLocatorParser . ClassButNoMethodDeclarationVisitor { public boolean visit ( AnonymousLocalTypeDeclaration anonymousTypeDeclaration , BlockScope scope ) { } public boolean visit ( LocalTypeDeclaration localTypeDeclaration , BlockScope scope ) { } } public MatchLocatorParser ( ProblemReporter problemReporter ) { } protected void classInstanceCreation ( boolean alwaysQualified ) { } protected void consumeAssignment ( ) { } protected void consumeExplicitConstructorInvocation ( int flag , int recFlag ) { } protected void consumeFieldAccess ( boolean isSuperAccess ) { } protected void consumeMethodInvocationName ( ) { } protected void consumeMethodInvocationPrimary ( ) { } protected void consumeMethodInvocationSuper ( ) { } protected void consumePrimaryNoNewArray ( ) { } protected void consumeSingleTypeImportDeclarationName ( ) { } protected void consumeTypeImportOnDemandDeclarationName ( ) { } protected void consumeUnaryExpression ( int op , boolean post ) { } protected TypeReference copyDims ( TypeReference typeRef , int dim ) { TypeReference result = super . copyDims ( typeRef , dim ) ; if ( ( this . matchSet . removePossibleMatch ( typeRef ) ) != null ) this . matchSet . addPossibleMatch ( result ) ; else if ( ( this . matchSet . removeTrustedMatch ( typeRef ) ) != null ) <START_BUG> this . matchSet . addTrustedMatch ( result ) ; <END_BUG> return result ; } protected TypeReference getTypeReference ( int dim ) { } protected NameReference getUnspecifiedReference ( ) { } protected NameReference getUnspecifiedReferenceOptimized ( ) { } public void parseBodies ( CompilationUnitDeclaration unit ) { } protected void parseBodies ( TypeDeclaration type , CompilationUnitDeclaration unit ) { } public void setMatchSet ( MatchingNodeSet nodeSet ) { } }

Fix:
this . matchSet . addTrustedMatch ( result , true ) ;