mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-11 20:07:01 +07:00
18 lines
495 B
Java
18 lines
495 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 = // line comment
|
|
// another line comment
|
|
str.get()//before trim
|
|
.trim() /* block comment *//*block comment*/;
|
|
} else {
|
|
val = "";
|
|
}
|
|
System.out.println(val);
|
|
}
|
|
} |