File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
checker-qual/src/main/java/org/checkerframework/checker/optional/qual Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 99import org .checkerframework .framework .qual .PostconditionAnnotation ;
1010
1111/**
12- * Indicates that the expression evaluates to a non-empty Optional, if the method terminates
12+ * Indicates that the expression evaluates to a present Optional, if the method terminates
1313 * successfully.
1414 *
15- * <p>This postcondition annotation is useful for methods that construct a non-empty Optional:
15+ * <p>This postcondition annotation is useful for methods that construct a present Optional:
1616 *
1717 * <pre><code>
1818 * {@literal @}EnsuresPresent("optStr")
Original file line number Diff line number Diff line change 179179 Optional<T> wrapWithOptional(...) { ... }
180180
181181 void myMethod() {
182- @SuppressWarnings("optional") // with argument x, wrapWithOptional always returns a non-empty Optional
182+ @SuppressWarnings("optional") // with argument x, wrapWithOptional always returns a present Optional
183183 @Present Optional<T> optX = wrapWithOptional(x);
184184 }
185185\end {Verbatim }
214214It is useful if you wish to suppress a warning within an expression.
215215
216216The Optional Checker considers both the return value, and also the
217- argument, to be an instance of a non-empty Optional after the \< castPresent>
217+ argument, to be an instance of a present Optional after the \< castPresent>
218218method call.
219219The Optional Checker issues no warnings in any of the following
220220code:
You can’t perform that action at this time.
0 commit comments