mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 10:20:15 +07:00
dataflow inspection: suggest to replace Optional.of with Optional.ofNullable if value could be null (IDEA-124359)
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
// "Replace with '.ofNullable()'" "true"
|
||||
class A{
|
||||
void test(){
|
||||
java.util.Optional.ofNullable(null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Replace with '.ofNullable()'" "false"
|
||||
class A{
|
||||
void test(){
|
||||
java.util.Optional.of(1<caret>1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Replace with '.ofNullable()'" "true"
|
||||
class A{
|
||||
void test(){
|
||||
java.util.Optional.of(nu<caret>ll);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Replace with '.ofNullable()'" "false"
|
||||
class A{
|
||||
void test(){
|
||||
Optional.of(nu<caret>ll);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user