diff --git a/checker/tests/nullness/jdkannotations/Issue8325.java b/checker/tests/nullness/jdkannotations/Issue8325.java new file mode 100644 index 000000000000..66021ef10c93 --- /dev/null +++ b/checker/tests/nullness/jdkannotations/Issue8325.java @@ -0,0 +1,28 @@ +// Test case for https://github.com/typetools/checker-framework/issues/8325 + +import java.util.BitSet; +import org.checkerframework.checker.nullness.qual.Nullable; + +public class Issue8325 { + + @Nullable Object field; + + void clearAll(BitSet bits) { + bits.clear(); + } + + void clearOne(BitSet bits) { + bits.clear(0); + } + + void clearRange(BitSet bits) { + bits.clear(0, 10); + } + + void refinementPreserved(BitSet bits) { + if (field != null) { + bits.clear(); + field.toString(); + } + } +}