"push condition inside call" intention replaced with "Conditional can be pushed inside branch" inspection

This commit is contained in:
Bas Leijdekkers
2017-04-04 22:47:39 +02:00
parent f96e053e52
commit 94fdc35577
16 changed files with 109 additions and 326 deletions
@@ -1,7 +0,0 @@
// "Push condition 'b' inside method call" "true"
class Foo {
void bar(boolean b){
String s = foo(b ? "true" : "false");
}
String foo(String p) {return p;}
}
@@ -1,7 +0,0 @@
// "Push condition 'b' inside method call" "true"
class Foo {
void bar(boolean b){
String s = foo(b ? "true" : "false", true).substring(0);
}
String foo(String p, boolean b) {return p;}
}
@@ -1,7 +0,0 @@
// "Push condition 'b' inside method call" "true"
class Foo {
void bar(boolean b){
String s = foo("true", true).substring(b ? 1 : 2).substring(0);
}
String foo(String p, boolean b) {return p;}
}
@@ -1,7 +0,0 @@
// "Push condition 'b' inside method call" "true"
class Foo {
void bar(boolean b){
String s = b <caret>? foo("true") : foo("false");
}
String foo(String p) {return p;}
}
@@ -1,8 +0,0 @@
// "Push condition 'b' inside method call" "false"
class Foo {
void bar(boolean b){
String s = b <caret>? foo("true") : foo(false);
}
String foo(String p) {return p;}
String foo(boolean b) {return "false";}
}
@@ -1,7 +0,0 @@
// "Push condition 'b' inside method call" "true"
class Foo {
void bar(boolean b){
String s = b <caret>? foo("true", true).substring(0) : foo("false", true).substring(0);
}
String foo(String p, boolean b) {return p;}
}
@@ -1,7 +0,0 @@
// "Push condition 'b' inside method call" "false"
class Foo {
void bar(boolean b){
String s = b <caret>? foo("true", true).substring(0) : foo("false", true).substring(1);
}
String foo(String p, boolean b) {return p;}
}
@@ -1,7 +0,0 @@
// "Push condition 'b' inside method call" "true"
class Foo {
void bar(boolean b){
String s = b <caret>? foo("true", true).substring(1).substring(0) : foo("true", true).substring(2).substring(0);
}
String foo(String p, boolean b) {return p;}
}
@@ -1,7 +0,0 @@
// "Push condition 'b' inside method call" "false"
class Foo {
void bar(boolean b){
String s = b <caret>? foo("true", true) : foo("false", false);
}
String foo(String p, boolean b) {return p;}
}