ReplaceWithTernaryOperatorFix: use template instead of selection (IDEA-202345)

This commit is contained in:
Tagir Valeev
2018-11-18 16:26:42 +07:00
parent 990ff8c7ba
commit 1f800bf982
5 changed files with 17 additions and 10 deletions
@@ -5,6 +5,6 @@ import java.lang.Integer;
class A{
void test(){
Integer integer = null;
int i = integer != null ? integer.toString().length() : <caret><selection>0</selection>;
int i = integer != null ? integer.toString().length() : 0<caret>;
}
}
@@ -5,6 +5,6 @@ import org.jetbrains.annotations.NotNull;
class A{
void test(@NotNull List l) {
final List list = null;
test(list != null ? list : <selection>null</selection>);
test(list != null ? list : null<caret>);
}
}
@@ -5,6 +5,6 @@ import java.lang.Integer;
class A{
void test(){
Integer integer = null;
int i = integer != null ? integer.intValue() : <selection>0</selection>;
int i = integer != null ? integer.intValue() : 0<caret>;
}
}
@@ -3,6 +3,6 @@
class A{
void test(){
List list = null;
Object o = list != null ? list.get(0) : <selection>null</selection>;
Object o = list != null ? list.get(0) : null<caret>;
}
}