mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-19 20:37:12 +07:00
11 lines
283 B
Java
11 lines
283 B
Java
// "Replace Optional.isPresent() 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);
|
|
}
|
|
} |