Skip to content

AddOrUpdateAnnotationAttribute not working with nested annotations #4765

@danielshamis

Description

@danielshamis

I am using

  • Maven plugin v5.46.1

How are you running OpenRewrite?

I am using the Maven plugin, and my project is a single module project.

<plugin>
   <groupId>org.openrewrite.maven</groupId>
   <artifactId>rewrite-maven-plugin</artifactId>
   <version>5.46.1</version>
   <configuration>
      <exportDatatables>true</exportDatatables>
      <activeRecipes>
         <recipe>test.AddOrUpdateAnnotationAttributeExample</recipe>
      </activeRecipes>
   </configuration>
</plugin>

What is the smallest, simplest way to reproduce the problem?

@Test({
        @TestFunction(name = "a"),
        @TestFunction(name = "b"),
})

What did you expect to see?

@Test({
        @TestFunction(name = "a", value = ""),
        @TestFunction(name = "b", value = ""),
})

What did you see instead?

I am trying to add an attribute to each nested Annotation but no changes are being made. Updating an existing attribute does not work either.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions