Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/optionalToIf/afterIsEmpty.java
T
Artemiy Sartakov 6f1efb8fc0 OptionalToIfInspection: added inspection to desugar optional chain to sequence of if statements (IDEA-212269)
GitOrigin-RevId: c83b70e05544529b3dfffe24bc87997910edcb56
2019-08-07 17:02:43 +03:00

19 lines
489 B
Java

// "Fix all 'Optional can be replaced with sequence of if statements' problems in file" "true"
class Test {
boolean isPresent(String in) {
if (in == null) throw new NullPointerException();
String s = in.substring(3);
if (s.startsWith("1")) return true;
return false;
}
boolean isEmpty(String in) {
if (in == null) throw new NullPointerException();
String s = in.substring(3);
if (s.startsWith("1")) return false;
return true;
}
}