mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
16 lines
430 B
Java
16 lines
430 B
Java
// "Fix all ''Optional' can be replaced with sequence of 'if' statements' problems in file" "true"
|
|
|
|
import java.util.*;
|
|
|
|
class Test {
|
|
|
|
String exceptionIsThrownIfNull(String in) {
|
|
return Optional.ofNullable<caret>(in).filter(s -> s.length() > 2).get();
|
|
}
|
|
|
|
void ofNullableGetFinalVar(String in) {
|
|
final String out = Optional<caret>.ofNullable(in).get();
|
|
Runnable r = () -> java.lang.System.out.println(out);
|
|
}
|
|
|
|
} |