You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Error Prone 2.24.0 with -Xep:StatementSwitchToExpressionSwitch -XepOpt:StatementSwitchToExpressionSwitch:EnableDirectConversion=true -XepPatchChecks:StatementSwitchToExpressionSwitch -XepPatchLocation:... and the code
For case 1 and case 2 this is nice.
For case 0 (which had already braces before) it adds redundant braces and it fails to remove the now unnecessary break;. For converting a large code base it would be nice if the output could be improved in this regard.
The text was updated successfully, but these errors were encountered:
If a case contains a single block statement, skip past the braces of the block statement.
Enables fixes like:
```
case 0 -> System.out.println("0");
```
Instead of:
```
case 0 -> {
{
System.out.println("0");
break;
}
}
```
Fixes#4222
PiperOrigin-RevId: 593453909
If a case contains a single block statement, skip past the braces of the block statement.
Enables fixes like:
```
case 0 -> System.out.println("0");
```
Instead of:
```
case 0 -> {
{
System.out.println("0");
break;
}
}
```
Fixes#4222
PiperOrigin-RevId: 593453909
On Error Prone 2.24.0 with
-Xep:StatementSwitchToExpressionSwitch -XepOpt:StatementSwitchToExpressionSwitch:EnableDirectConversion=true -XepPatchChecks:StatementSwitchToExpressionSwitch -XepPatchLocation:...
and the codethe suggestion from Error Prone is the following (after formatting):
For
case 1
andcase 2
this is nice.For
case 0
(which had already braces before) it adds redundant braces and it fails to remove the now unnecessarybreak;
. For converting a large code base it would be nice if the output could be improved in this regard.The text was updated successfully, but these errors were encountered: