use Optional.of() instead ofNullable() in "opt" postfix template when expression is not null

This commit is contained in:
Dmitry Batkovich
2017-09-15 15:55:54 +03:00
parent 7e8441d8d4
commit 5116aad4cc
4 changed files with 46 additions and 16 deletions
@@ -0,0 +1,12 @@
import org.jetbrains.annotations.NotNull;
class Test {
@NotNull
String foo() {
return "";
}
void m() {
foo().opt<caret>
}
}
@@ -0,0 +1,12 @@
import org.jetbrains.annotations.NotNull;
class Test {
@NotNull
String foo() {
return "";
}
void m() {
java.util.Optional.of(foo())
}
}