mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 10:20:15 +07:00
15 lines
327 B
Java
15 lines
327 B
Java
// "Replace Optional.isPresent() condition with functional style expression" "true-preview"
|
|
|
|
import java.util.*;
|
|
|
|
public class Main {
|
|
public void testOptional(Optional<String> str) {
|
|
String val;
|
|
if (str.isPrese<caret>nt()) {
|
|
val = str.get();
|
|
} else {
|
|
val = "";
|
|
}
|
|
System.out.println(val);
|
|
}
|
|
} |