mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-11 11:36:59 +07:00
13 lines
319 B
Java
13 lines
319 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) {
|
|
if (str.isPrese<caret>nt()) {
|
|
myString = str.get().isEmpty() ? null : str.get();
|
|
}
|
|
}
|
|
} |