rspec/rules/S1611/java/rule.adoc
2021-04-28 16:49:39 +02:00

17 lines
507 B
Plaintext

There are two possible syntaxes for a lambda having only one input parameter with an inferred type: with and without parentheses around that single parameter. The simpler syntax, without parentheses, is more compact and readable than the one with parentheses, and is therefore preferred.
*Note* that this rule is automatically disabled when the project's ``++sonar.java.source++`` is lower than ``++8++``.
== Noncompliant Code Example
----
(x) -> x * 2
----
== Compliant Solution
----
x -> x * 2
----