switch
statements or switch
expressions that have a redundant code block.
Example:
String s = switch (n) {
case 1 -> { yield Integer.toString(n); }
default -> "default";
};
After the quick-fix is applied:
String s = switch (n) {
case 1 -> Integer.toString(n);
default -> "default";
};
This inspection only reports if the language level of the project or module is 14 or higher.
New in 2019.1