preserve comments: replace switch with if (IDEA-113518)

This commit is contained in:
Anna.Kozlova
2017-12-28 15:51:27 +01:00
parent b7ecfbdd8b
commit a1239e3f1f
3 changed files with 47 additions and 28 deletions

View File

@@ -1,7 +1,15 @@
// "Replace 'switch' with 'if'" "true"
class X {
public void doSomething( String value) {
if ("case1".equals(value)) {
//comment1
//comment3
//comment4
//comment5
//comment6
//comment7
//comment8
if ("case1".equals(value)) {//comment2
} else if ("case2".equals(value)) {
} else {
}

View File

@@ -2,12 +2,13 @@
class X {
public void doSomething( String value) {
switch<caret> ( value ) {
case "case1":
break;
case "case2":
break;
default:
break;
}
case "case1"://comment1
//comment2
break;//comment3
case "case2"://comment4
break;//comment5
default://comment6
break;//comment7
}//comment8
}
}