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