Skip to content

Commit 4d2ae79

Browse files
committed
Improvements
Signed-off-by: Juan Manuel Leflet Estrada <[email protected]>
1 parent 34e06fe commit 4d2ae79

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
@@ -383,13 +383,14 @@ private static List<SymbolInformation> search(String projectName, ArrayList<Stri
383383

384384
// Now run ImportScanner only on units in scope
385385
ASTParser parser = ASTParser.newParser(AST.getJLSLatest());
386+
Pattern regex = Pattern.compile(query);
386387
for (ICompilationUnit unit : units) {
387388
parser.setSource(unit);
388389
CompilationUnit cu = (CompilationUnit) parser.createAST(null);
389390
for (Object o : cu.imports()) {
390391
ImportDeclaration imp = (ImportDeclaration) o;
391392
if (imp.isOnDemand()) {
392-
if (Pattern.compile(query).matcher(imp.getName().getFullyQualifiedName()).matches()) {
393+
if (regex.matcher(imp.getName().getFullyQualifiedName()).matches()) {
393394
SymbolInformation symbol = new SymbolInformation();
394395
symbol.setName(imp.getName().getFullyQualifiedName());
395396
symbol.setKind(SymbolKind.Namespace);

0 commit comments

Comments
 (0)