Skip to content

UnnecessaryLambdaEnclosingParameters is turning" not actually turning #901

@gbq6

Description

@gbq6

Steps

  1. Have a snippet like these somewhere in your code:
(final String x) -> true
(String x) -> true
  1. Run cleanthat

Expected

Cleanthat either does not print anything, or turns them into:

x -> true

Actual

Cleanthat does not change the code, but prints one of the below messages:

UnnecessaryLambdaEnclosingParameters is turning `(final String x) -> true` into `final String x -> true`
UnnecessaryLambdaEnclosingParameters is turning `(String x) -> true` into `String x -> true`

Notes

Actually doing the printed change would cause a compile error.

Versions:

  • Java: 21
  • Spotless: 2.46.1
  • Cleanthat: 2.24

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions