Files
openide/java/java-tests/testData/inspection/duplicateBranchesInSwitchFix/afterGuard2.java
Tagir Valeev 623ee94480 [java-inspections] DuplicateBranchesInSwitchInspection improvements
1. Do not merge pattern with non-pattern branch
2. Colon labels with guards should not be merged into a single label
Leftovers after IDEA-326939

GitOrigin-RevId: 9fc54e643eda666771af2fc017dbef7d925dd76b
2023-09-19 01:24:53 +00:00

14 lines
363 B
Java

// "Merge with 'case Integer _'" "true"
class X {
void foo(Object o) {
switch (o) {
case Integer _, StringBuffer _:
case String _ when o.hashCode()==1:
System.out.println("hello");
break;
default:
System.out.println("hello2");
break;
}
}
}