diff --git a/java-analyzer-bundle.core/src/main/java/io/konveyor/tackle/core/internal/symbol/CustomASTVisitor.java b/java-analyzer-bundle.core/src/main/java/io/konveyor/tackle/core/internal/symbol/CustomASTVisitor.java index f53459e..1828e94 100644 --- a/java-analyzer-bundle.core/src/main/java/io/konveyor/tackle/core/internal/symbol/CustomASTVisitor.java +++ b/java-analyzer-bundle.core/src/main/java/io/konveyor/tackle/core/internal/symbol/CustomASTVisitor.java @@ -41,12 +41,20 @@ public enum QueryLocation { } public CustomASTVisitor(String query, SearchMatch match, QueryLocation location) { + /* + * Strip parameter types from the query pattern before matching + * The AST provides method names without parameter types, but users + * may specify patterns like "ClassName.method(ParamType1, ParamType2)" + * We need to remove the parameter types to match correctly + */ + String processedQuery = query.replaceAll("\\([^)]*\\)", ""); + /* * When comparing query pattern with an actual java element's fqn * we need to make sure that * not preceded with a . are replaced * by .* so that java regex works as expected on them */ - this.query = query.replaceAll("(?