Files
Mikhail Pyltsinandintellij-monorepo-bot e5b3e91017 [java-inspections] DuplicateBranchesInSwitchInspection improvements
- Leftovers after IDEA-326939
- merge branches and rules if they have the same guard
- not move branches and rules it they are not close (not to break dominance)
- allow to copy in guarded case
- not use firstLabel instead of full label set

GitOrigin-RevId: 289882c1be7275d33e97037217de8095f59346aa
2023-09-20 14:17:06 +00:00

16 lines
312 B
Java

// "Merge with 'case Integer _'" "true-preview"
class C {
enum T {A, B,}
void foo(Object o) {
switch (o) {
case Integer _ :
case T.A:
case String _ when o.hashCode()==1:
System.out.println("1");
break;
default:
System.out.println("3");
}
}
}