Skip to content

Support unnamed lambda parameters  #1335

@Vithor112

Description

@Vithor112

Java officially supports unnamed variables as of version 22 (see JEP 456). Spotless issues a warning when using it in a lambda context.

                                    (_, idToStrategy) -> {
                                        idToStrategy.put(username, strategy);
                                        return idToStrategy;
                                    });

Using GJF last release 1.34.1 results in

[WARNING] Issue parsing some source. 1 problems. First problem: (line 48,col 38) '_' is a reserved keyword.
[WARNING] Not able to parse path='OMMITED' with com.github.javaparser.JavaParser@45ae53aa

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions