mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 02:09:59 +07:00
[java-inspections] Delete switch branch when guard is false
Part of IDEA-326939 Support multi-pattern switch labels that define no variables GitOrigin-RevId: 6d089c7e9f705a28f29376f1208ed39d4c8aa881
This commit is contained in:
committed by
intellij-monorepo-bot
parent
efbff7c99c
commit
dbccf5f59b
@@ -0,0 +1,10 @@
|
||||
// "Remove switch label" "true-preview"
|
||||
class X {
|
||||
void test(Object obj) {
|
||||
switch (obj) {
|
||||
default:
|
||||
System.out.println("something else");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Remove switch label" "true-preview"
|
||||
class X {
|
||||
void test(Object obj) {
|
||||
switch (obj) {
|
||||
case String s when s.length()<caret> < 0:
|
||||
System.out.println("oops");
|
||||
break;
|
||||
default:
|
||||
System.out.println("something else");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user