mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-11 02:39:37 +07:00
Fix for IDEA-165369 Replace Optional.isPresent() should be disabled if the thenBranch contains non-local control flow
12 lines
324 B
Java
12 lines
324 B
Java
// "Replace Optional.isPresent() condition with functional style expression" "GENERIC_ERROR_OR_WARNING"
|
|
|
|
import java.util.*;
|
|
|
|
public class Main {
|
|
public void testOptional(Optional<String> str) {
|
|
if (str == null) str = Optional.empty();
|
|
if (str.isPrese<caret>nt()) {
|
|
System.out.println(str.get());
|
|
}
|
|
}
|
|
} |