IDEA-180288 Quick fix breaks code: Optional.ofNullable() with not-null argument

This commit is contained in:
Tagir Valeev
2017-10-11 10:28:14 +07:00
parent 92eb27389b
commit 6fcd75db84
7 changed files with 77 additions and 3 deletions
@@ -0,0 +1,10 @@
// "Replace with '.of()'" "true"
import java.util.Optional;
import static java.util.Optional.ofNullable;
class A{
void test(){
Optional.of(11);
}
}
@@ -0,0 +1,8 @@
// "Replace with '.of()'" "true"
import static java.util.Optional.*;
class A{
void test(){
of(11);
}
}
@@ -0,0 +1,12 @@
// "Replace with '.of()'" "true"
import java.util.Optional;
import static java.util.Optional.*;
class A{
void of() {}
void test(){
Optional.of(11);
}
}
@@ -0,0 +1,8 @@
// "Replace with '.of()'" "true"
import static java.util.Optional.ofNullable;
class A{
void test(){
ofNullable(1<caret>1);
}
}
@@ -0,0 +1,8 @@
// "Replace with '.of()'" "true"
import static java.util.Optional.*;
class A{
void test(){
ofNullable(1<caret>1);
}
}
@@ -0,0 +1,10 @@
// "Replace with '.of()'" "true"
import static java.util.Optional.*;
class A{
void of() {}
void test(){
ofNullable(1<caret>1);
}
}