Skip to content

Commit

Permalink
Resolve bindings during acceptAST call instead of after
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Stryker <stryker@redhat.com>
  • Loading branch information
Rob Stryker committed Nov 7, 2024
1 parent ede027f commit 727ca20
Showing 1 changed file with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
}
Expand All @@ -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;
Expand Down

0 comments on commit 727ca20

Please sign in to comment.