mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 00:11:26 +07:00
Test and comment for IDEA-176340 "Optional.isPresent not highlighted"
Actually was fixed in 0234c70
This commit is contained in:
+2
-2
@@ -1,4 +1,4 @@
|
||||
// "Replace Optional.isPresent() condition with functional style expression" "true"
|
||||
// "Replace Optional.isPresent() condition with functional style expression" "GENERIC_ERROR_OR_WARNING"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -6,6 +6,6 @@ public class Main {
|
||||
String myString;
|
||||
|
||||
public void testOptional(Optional<String> str) {
|
||||
str.ifPresent(s -> myString = s);
|
||||
str.ifPresent(s -> myString = s.isEmpty() ? null : s);
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
// "Replace Optional.isPresent() condition with functional style expression" "true"
|
||||
// "Replace Optional.isPresent() condition with functional style expression" "GENERIC_ERROR_OR_WARNING"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -7,7 +7,7 @@ public class Main {
|
||||
|
||||
public void testOptional(Optional<String> str) {
|
||||
if (str.isPrese<caret>nt()) {
|
||||
myString = str.get();
|
||||
myString = str.get().isEmpty() ? null : str.get();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user