Skip to content

Commit 1e04935

Browse files
committed
Improvements
Signed-off-by: Juan Manuel Leflet Estrada <[email protected]>
1 parent ffcef91 commit 1e04935

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

java-analyzer-bundle.core/src/main/java/io/konveyor/tackle/core/internal/SampleDelegateCommandHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,13 +369,14 @@ private static List<SymbolInformation> search(String projectName, ArrayList<Stri
369369

370370
// Now run ImportScanner only on units in scope
371371
ASTParser parser = ASTParser.newParser(AST.getJLSLatest());
372+
Pattern regex = Pattern.compile(query);
372373
for (ICompilationUnit unit : units) {
373374
parser.setSource(unit);
374375
CompilationUnit cu = (CompilationUnit) parser.createAST(null);
375376
for (Object o : cu.imports()) {
376377
ImportDeclaration imp = (ImportDeclaration) o;
377378
if (imp.isOnDemand()) {
378-
if (Pattern.compile(query).matcher(imp.getName().getFullyQualifiedName()).matches()) {
379+
if (regex.matcher(imp.getName().getFullyQualifiedName()).matches()) {
379380
SymbolInformation symbol = new SymbolInformation();
380381
symbol.setName(imp.getName().getFullyQualifiedName());
381382
symbol.setKind(SymbolKind.Namespace);

0 commit comments

Comments
 (0)