mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-22 06:20:54 +07:00
PR#2100 Co-authored-by: Tagir Valeev <tagir.valeev@jetbrains.com> GitOrigin-RevId: c0b8495f26bccf51c593deb6be927eb01c37d379
11 lines
280 B
Java
11 lines
280 B
Java
// "Replace Optional presence condition with functional style expression" "GENERIC_ERROR_OR_WARNING"
|
|
|
|
import java.util.*;
|
|
|
|
public class Main {
|
|
String myString;
|
|
|
|
public void testOptional(Optional<String> str) {
|
|
str.ifPresent(s -> myString = s.isEmpty() ? null : s);
|
|
}
|
|
} |