Annotation Type IntRangeFromNonNegative
-
@Documented @Retention(SOURCE) @Target({}) @SubtypeOf(UnknownVal.class) public @interface IntRangeFromNonNegativeAn expression with this type is exactly the same as anIntRangeannotation whosefromfield is0and whosetofield isInteger.MAX_VALUE. However, this annotation is derived from anorg.checkerframework.checker.index.qual.NonNegativeannotation.IntRangeFromNonNegative annotations derived from NonNegative annotations are used to create IntRange annotations, but IntRangeFromNonNegative annotations are not checked when they appear on the left hand side of expressions. Therefore, the Index Checker MUST be run on any code with @NonNegative annotations on the left-hand side of expressions, since the Value Checker will derive information from them but not check them.
It is an error to write this annotation directly.
@NonNegativeorIntRange(from = 0, to = Integer.MAX_VALUE)should always be written instead. This annotation is not retained in bytecode, but is replaced with@UnknownVal, so that it is not enforced on method boundaries. The@NonNegativeannotation it replaced is retained in bytecode by the Lower Bound Checker instead.- See the Checker Framework Manual:
- Constant Value Checker