mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-18 00:20:54 +07:00
Fixes IDEA-344453 Intellij should not try to initialize an Optional var with null GitOrigin-RevId: 8097988bf1335a282138e8d09e350c3a5f65204d
13 lines
289 B
Java
13 lines
289 B
Java
// "Initialize variable 'msg'" "true-preview"
|
|
|
|
import java.util.Optional;
|
|
|
|
public class OptionalTest {
|
|
public static void main(String[] args) {
|
|
Optional<String> msg;
|
|
if (args.length > 5) {
|
|
msg = Optional.of("hello");
|
|
}
|
|
System.out.println("msg = "+<caret>msg);
|
|
}
|
|
} |