mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-11 20:07:01 +07:00
15 lines
319 B
Java
15 lines
319 B
Java
// "Replace Optional.isPresent() condition with functional style expression" "true"
|
|
|
|
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);
|
|
}
|
|
} |