From ae60c488b44e823573e80d5e8db3e0c80bd5a5a9 Mon Sep 17 00:00:00 2001 From: Knut Wannheden Date: Tue, 15 Oct 2024 12:25:09 +0200 Subject: [PATCH] Fix failing `parameterizedMatchWithBounds()` test case --- .../test/java/org/openrewrite/java/JavaTemplateTest8Test.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rewrite-java-test/src/test/java/org/openrewrite/java/JavaTemplateTest8Test.java b/rewrite-java-test/src/test/java/org/openrewrite/java/JavaTemplateTest8Test.java index d0aab4e9874..77608c27e70 100644 --- a/rewrite-java-test/src/test/java/org/openrewrite/java/JavaTemplateTest8Test.java +++ b/rewrite-java-test/src/test/java/org/openrewrite/java/JavaTemplateTest8Test.java @@ -86,7 +86,7 @@ void parameterizedMatchWithBounds() { @Override public N visitTypeName(N nameTree, ExecutionContext ctx) { // the cursor points at the parent when `visitTypeName()` is called - if (template.matches(new Cursor(getCursor(), nameTree))) { + if (getCursor().getValue() != nameTree && template.matches(new Cursor(getCursor(), nameTree))) { return SearchResult.found(nameTree); } return super.visitTypeName(nameTree, ctx);