com.puppycrawl.tools.checkstyle.meta.checks.coding.UnusedLambdaParameterShouldBeUnnamedCheck.xml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of checkstyle Show documentation
Show all versions of checkstyle Show documentation
Checkstyle is a development tool to help programmers write Java code
that adheres to a coding standard
<?xml version="1.0" encoding="UTF-8"?> <checkstyle-metadata> <module> <check fully-qualified-name="com.puppycrawl.tools.checkstyle.checks.coding.UnusedLambdaParameterShouldBeUnnamedCheck" name="UnusedLambdaParameterShouldBeUnnamed" parent="com.puppycrawl.tools.checkstyle.TreeWalker"> <description><p> Ensures that lambda parameters that are not used are declared as an unnamed variable. </p> <p> Rationale: </p> <ul> <li> Improves code readability by clearly indicating which parameters are unused. </li> <li> Follows Java conventions for denoting unused parameters with an underscore ({@code _}). </li> </ul> <p> See the <a href="https://docs.oracle.com/en/java/javase/21/docs/specs/unnamed-jls.html"> Java Language Specification</a> for more information about unnamed variables. </p> <p> <b>Attention</b>: Unnamed variables are available as a preview feature in Java 21, and became an official part of the language in Java 22. This check should be activated only on source code which meets those requirements. </p></description> <message-keys> <message-key key="unused.lambda.parameter"/> </message-keys> </check> </module> </checkstyle-metadata>