Skip to content

ImplicitWebAnnotationNames removes @RequestParam argument even when -parameters is missing #736

@sambsnyd

Description

@sambsnyd

After running the spring boot 3.4 migration some Spring @RequestParam annotations had their arguments removed, which caused IllegalStateException during a subsequent test pass.

So in a function like:

@GetMapping
String foo(@RequestParam("a") String a) { ...}

Some part of the migration was changing it to:

@GetMapping
String foo(@RequestParam String a) { ...}

This would be fine if the compiler configuration included the -parameters argument, but it didn't, so this change is erroneous.

The recipe responsible is org.openrewrite.java.spring.ImplicitWebAnnotationNames. In the short term I'm going to remove it from spring boot best practices. Ideally it would be fixed to only make its change if -parameters is part of the compiler configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions