From cbbfda22f07e95ffa2332ac16d8276655d7307c1 Mon Sep 17 00:00:00 2001 From: Michael Ernst Date: Thu, 19 Aug 2021 15:44:10 -0700 Subject: [PATCH] Test case for issue #4889 --- checker/tests/nullness/Issue4889.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 checker/tests/nullness/Issue4889.java diff --git a/checker/tests/nullness/Issue4889.java b/checker/tests/nullness/Issue4889.java new file mode 100644 index 00000000000..f30aa016776 --- /dev/null +++ b/checker/tests/nullness/Issue4889.java @@ -0,0 +1,14 @@ +import java.util.Objects; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; + +class Issue4889 { + void f(@Nullable String s) { + Objects.toString(s, "").toString(); + } + + void g(@Nullable String s) { + @NonNull String x = Objects.toString(s, ""); + @Nullable String y = Objects.toString(s, null); + } +}