mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-200030 Quick-fix to remove unreachable should remove body only if previous branch has 'break' at the end
This commit is contained in:
+1
-1
@@ -700,7 +700,7 @@ public class DataFlowInspectionBase extends AbstractBaseJavaLocalInspectionTool
|
||||
if (!current.isDefaultCase()) {
|
||||
holder.registerProblem(current,
|
||||
InspectionsBundle.message("dataflow.message.unreachable.switch.label"),
|
||||
new DeleteSwitchLabelFix((PsiSwitchLabelStatement)psiAnchor));
|
||||
new DeleteSwitchLabelFix(current));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// "Remove switch label '"two"'" "true"
|
||||
class Main {
|
||||
static void fff() {
|
||||
switch ("one") {
|
||||
case "one":
|
||||
System.out.println("one");
|
||||
// quick-fix removes body as well
|
||||
System.out.println("two");
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
fff();
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// "Remove switch label '"two"'" "true"
|
||||
class Main {
|
||||
static void fff() {
|
||||
switch ("one") {
|
||||
case "one":
|
||||
System.out.println("one");
|
||||
case "<caret>two": // quick-fix removes body as well
|
||||
System.out.println("two");
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
fff();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user