Files
openide/java/java-impl/resources/inspectionDescriptions/UnsatisfiedRange.html
Leonid Shalupov 40795fe787 IJI-2422: community/java: move resources under resources root
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
2025-02-05 04:43:28 +00:00

26 lines
1.3 KiB
HTML

<html>
<body>
Reports numeric values returned from methods that don't conform to the declared method return range.
You can declare method return range using a number of annotations:
<ul>
<li><code>org.jetbrains.annotations.Range</code> from JetBrains annotations package (specify 'from' and 'to')</li>
<li><code>org.checkerframework.common.value.qual.IntRange</code> from Checker Framework annotations package (specify 'from' and 'to')</li>
<li><code>org.checkerframework.checker.index.qual.GTENegativeOne</code> from Checker Framework annotations package (range is '>= -1')</li>
<li><code>org.checkerframework.checker.index.qual.NonNegative</code> from Checker Framework annotations package (range is '>= 0')</li>
<li><code>org.checkerframework.checker.index.qual.Positive</code> from Checker Framework annotations package (range is '> 0')</li>
<li><code>javax.annotation.Nonnegative</code> from JSR 305 annotations package (range is '>= 0')</li>
<li><code>javax.validation.constraints.Min</code> (specify minimum value)</li>
<li><code>javax.validation.constraints.Max</code> (specify maximum value)</li>
</ul>
<p>Example:</p>
<pre><code>
@Range(from = 0, to = Integer.MAX_VALUE) int getValue() {
// Warning: -1 is outside of declared range
return -1;
}
</code></pre>
<!-- tooltip end -->
<p><small>New in 2021.2</small></p>
</body>
</html>