diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java index fe4f08044d2..33b7891de3a 100644 --- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java +++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java @@ -1392,10 +1392,6 @@ protected void locateMatchesWithASTParser(JavaProject javaProject, PossibleMatch } org.eclipse.jdt.core.ICompilationUnit[] nonNullUnits = Arrays.asList(unitArray).stream().filter(x -> x != null).toArray(org.eclipse.jdt.core.ICompilationUnit[]::new); -// debugMethodOne(javaProject, possibleMatches[0], new org.eclipse.jdt.core.ICompilationUnit[] {units[0]}); -// debugMethodTwo(javaProject, possibleMatches[0], new org.eclipse.jdt.core.ICompilationUnit[] {units[0]}); -// debugMethodThree(javaProject, possibleMatches[0], units); - if (nonNullUnits.length == 0) { return; } @@ -1430,6 +1426,7 @@ public void acceptAST(org.eclipse.jdt.core.ICompilationUnit source, org.eclipse. if( possibleMatches[i] == pm ) { domUnits[i] = ast; nonNullDomIndexes.add(i); + ast.accept(new PatternLocatorVisitor(MatchLocator.this.patternLocator, possibleMatches[i].nodeSet, MatchLocator.this)); return; } } @@ -1438,13 +1435,6 @@ public void acceptAST(org.eclipse.jdt.core.ICompilationUnit source, org.eclipse. // todo, use a subprogressmonitor or slice it }, this.progressMonitor); - - nonNullDomIndexes.forEach(x -> { - PossibleMatch possibleMatch = possibleMatches[x]; - org.eclipse.jdt.core.dom.CompilationUnit ast = domUnits[x]; - ast.accept(new PatternLocatorVisitor(this.patternLocator, possibleMatch.nodeSet, this)); - }); - for( int x : nonNullDomIndexes ) { PossibleMatch possibleMatch = possibleMatches[x]; this.currentPossibleMatch = possibleMatch;