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
{{ message }}
Repository navigation
[2.9.7] Switch expression: enum constant case labels are wrapped in parentheses, producing non-compiling code #946
When formatting a switch expression whose case labels are bare enum constants (constant case labels), the plugin wraps each label in parentheses, e.g. case BOOLEAN -> becomes case (BOOLEAN) ->.
This output does not compile: Fehler: Symbol nicht gefunden case (BOOLEAN) -> value -> writeBoolean((boolean) value);
This worked correctly before 2.9.7 (tested in 2.8.1) and is still broken in 2.10.0 (tested).
privateWritergetRawValueWriter(finalTypetype) {
returnswitch (type) {
case (BOOLEAN) -> value -> writeBoolean((boolean) value);
case (DOUBLE) -> value -> writeDouble((double) value);
case (LONG) -> value -> writeLong((long) value);
case (NULL) -> ignored -> writeNull();
case (STRING) -> value -> writeString((String) value);
};
}
Expected output
Identical to the input — constant case labels should not be parenthesized.
Activity
ArLau commentedon Jun 26, 2026
@jtkiesel Thx for the quick fix!