preserve comments: invert if (IDEA-205835)

This commit is contained in:
Anna.Kozlova
2019-01-22 18:48:18 +01:00
parent c518058bfc
commit cc6b79a309
6 changed files with 44 additions and 10 deletions
@@ -0,0 +1,14 @@
// "Invert 'if' condition" "true"
public class C {
public boolean isAcceptable(Object element) {
if (element == null) {
return false;
}
System.out.println();
//c1
if (true) {
//c2
}
return false;
}
}
@@ -0,0 +1,13 @@
// "Invert 'if' condition" "true"
public class C {
public boolean isAcceptable(Object element) {
i<caret>f (element != null) {
System.out.println();
//c1
if (true) {
//c2
}
}
return false;
}
}
@@ -4,6 +4,8 @@ class T {
void f(boolean b) {
if (b)
throw new RuntimeException("When true");
//c1
System.out.println("Otherwise");
}
}
@@ -6,6 +6,6 @@ class T {
throw new RuntimeException("When true");
<caret>else {
System.out.println("Otherwise");
}
}//c1
}
}