Skip to content

Java recipe to reorder annotations #543

Open
@greg-at-moderne

Description

@greg-at-moderne

What problem are you trying to solve?

I'd like to be able to tackle inconsistent order of frequently used annotations in the code.

e.g.

    @Issue("https://github.com/openrewrite/rewrite/issues/2973")
    @Test
    @ExpectedToFail
    void explicitImplementationClassInApi() {

vs.

        @Issue("https://github.com/openrewrite/rewrite-static-analysis/issues/112")
        @ExpectedToFail("only directly returned ternaries are taken into account")
        @Test
        void doReplaceNestedOrAssignmentTernaryWithIfElse() {

in our own code, etc. There are other combinations.

Describe the solution you'd like

Maybe a recipe to instil some deterministic order (alphabetic) or maybe some smart way of passing priorities/orders - e.g. @Test should always come first, etc.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions