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