mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-09 14:50:04 +07:00
15 lines
357 B
Java
15 lines
357 B
Java
// "Replace Optional.isPresent() condition with map().orElse()" "true"
|
|
|
|
import java.util.*;
|
|
|
|
public class Main {
|
|
public void testOptional(Optional<String> str) {
|
|
String val;
|
|
// line comment
|
|
// another line comment
|
|
//before trim
|
|
/* block comment *//*block comment*/
|
|
val = str.map(String::trim).orElse("");
|
|
System.out.println(val);
|
|
}
|
|
} |