mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-19 01:50:56 +07:00
PR#2100 Co-authored-by: Tagir Valeev <tagir.valeev@jetbrains.com> GitOrigin-RevId: c0b8495f26bccf51c593deb6be927eb01c37d379
18 lines
500 B
Java
18 lines
500 B
Java
// "Replace Optional presence 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 = // line comment
|
|
// another line comment
|
|
str.get()//before trim
|
|
.trim() /* block comment *//*block comment*/;
|
|
} else {
|
|
val = "";
|
|
}
|
|
System.out.println(val);
|
|
}
|
|
} |