Extend "remove braces from lambda expression" to any single expression block
See original GitHub issueTop Results From Across the Web
When are braces optional in Java 8 lambda syntax?
You may omit the braces when the lambda body is a single expression or a void method invocation. Every expression evaluates to a...
Read more >Lambda Expressions and Functional Interfaces: Tips and Best ...
Braces and return statements are optional in one-line lambda bodies. This means that they can be omitted for clarity and conciseness. We can...
Read more >Best practices when you use Lambda expressions in Java
A lambda expression is a block of code that can be passed around to execute. ... Braces and return statements are optional in...
Read more >Roslynator/README.md at main - Analyzers - GitHub
Id Title Severity
RCS1002 Remove braces None
RCS1004 Remove braces from if‑else None
RCS1005 Simplify nested using statement Hidden
Read more >Parentheses should be removed from a single lambda input ...
Parentheses should be removed from a single lambda input parameter when its type is inferred ... There are two possible syntaxes for a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oups, sorry, I used the wrong wording. Quick fixes should indeed be fixes. But intentions can totally change the semantics (something like “filp
,
” comes to mind).Fine, but this question has to be taken into account as user usually expects quick fixes to just work and not to mess up user’s code