java 8 - Sonar : lambda - Remove useless curly braces around statement -
these code examples:
import java.util.observer;  public class main {     public static void main(string[] args) {         observer observer = (o, arg) -> {             if (arg != null) {                 system.out.println(arg);             }         };     } }   import java.util.observer;  public class main {     public static void main(string[] args) {         observer observer = (o, arg) -> {             try {                 string test = (string) arg;                 ...             }             catch (classcastexception e) {             }         };     } }   are noncompliant sonarqube rule:
lamdbas containing 1 statement should not nest statement in block : remove useless curly braces around statement
how can fix ?
the classification of these curly braces “useless” wrong.
you can omit curly braces around single expression statement, is, example, method invocation, new expression, or x++, x+=y, etc.
or can transform sole … -> { return x; } statement expression … -> x.
but can’t omit curly braces around every single statement.
you can’t fix that. thing can file bug report.
by way, then, removing them not readability improvement. depends…
Java 8 - Sonar : Lambda - Remove Useless Curly Braces Around Statement - >>>>> Download Now
ReplyDelete>>>>> Download Full
Java 8 - Sonar : Lambda - Remove Useless Curly Braces Around Statement - >>>>> Download LINK
>>>>> Download Now
Java 8 - Sonar : Lambda - Remove Useless Curly Braces Around Statement - >>>>> Download Full
>>>>> Download LINK L1