From 3403f7e426baa64ffd22f4105ca79ec40557c2e7 Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Tue, 10 Dec 2024 10:58:26 +0100 Subject: [PATCH] `AddOrUpdateAnnotationAttribute` should also visit nested annotations Fixes #4765 --- .../org/openrewrite/java/AddOrUpdateAnnotationAttribute.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rewrite-java/src/main/java/org/openrewrite/java/AddOrUpdateAnnotationAttribute.java b/rewrite-java/src/main/java/org/openrewrite/java/AddOrUpdateAnnotationAttribute.java index be098009e16..a62f0be4967 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/AddOrUpdateAnnotationAttribute.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/AddOrUpdateAnnotationAttribute.java @@ -85,7 +85,7 @@ public TreeVisitor getVisitor() { return Preconditions.check(new UsesType<>(annotationType, false), new JavaIsoVisitor() { @Override public J.Annotation visitAnnotation(J.Annotation a, ExecutionContext ctx) { - J.Annotation original = a; + J.Annotation original = super.visitAnnotation(a, ctx); if (!TypeUtils.isOfClassType(a.getType(), annotationType)) { return a; }