Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/optionalToIf/beforeIfPresent.java
Artemiy Sartakov d98814d304 OptionalToIfInspection: added missing imports (IDEA-212269)
GitOrigin-RevId: afbeaa1f10b2266cd1401da83b71cf0bf6862824
2019-08-07 17:02:43 +03:00

19 lines
470 B
Java

// "Fix all 'Optional can be replaced with sequence of if statements' problems in file" "true"
import java.util.*;
class Test {
void simple(String in) {
Optional.ofNullable<caret>(in).ifPresent(System.out::println);
}
void lambdaIsNotSimplified(String in, String p1, String p2) {
if (in == null || p1 == null) throw new IllegalArgumentException();
Optional.ofNullable(in).ifPresent(s -> {
String tmp = "foo";
tmp = "bar";
});
}
}