Debian Codegraph @

checker/tests/nullness/java8/Issue366.java

raw
1 // Test case for Issue 366:
2 // https://github.com/typetools/checker-framework/issues/366
3 // but amended for Issue 1098:
4 // https://github.com/typetools/checker-framework/issues/1098
5
6 import java.util.Optional;
7 import org.checkerframework.checker.nullness.qual.NonNull;
8 import org.checkerframework.checker.nullness.qual.Nullable;
9
10 class Issue366 {
11 static Optional<@NonNull String> getPossiblyEmptyString() {
12 return Optional.ofNullable(null);
13 }
14
15 static Optional<@Nullable String> getPossiblyEmptyString2() {
16 return Optional.ofNullable(null);
17 }
18 }