convert switch -> if: ignore whitespaces (IDEA-165260)

This commit is contained in:
Anna Kozlova
2018-06-29 20:20:36 +03:00
parent 731f16c508
commit a6db339c7d
3 changed files with 1 additions and 2 deletions

View File

@@ -296,6 +296,7 @@ public class ConvertSwitchToIfIntention implements IntentionAction {
}
private static void appendElement(PsiElement element, @NonNls StringBuilder out, CommentTracker commentTracker) {
if (element instanceof PsiWhiteSpace) return;
if (element instanceof PsiBreakStatement) {
final PsiBreakStatement breakStatement = (PsiBreakStatement)element;
final PsiIdentifier identifier = breakStatement.getLabelIdentifier();

View File

@@ -5,7 +5,6 @@ class Precedence {
int a = 10;
if ((a & 1) == 0) {
System.out.println("0");
} else if ((a & 1) == 1) {
System.out.println("1");
}

View File

@@ -9,7 +9,6 @@ class X {
//comment7
//comment8
if ("case1".equals(value)) {//comment2
} else if ("case2".equals(value)) {
} else {
}