Skip to content

Commit

Permalink
Updating docs: "non-empty" to "present" Optional
Browse files Browse the repository at this point in the history
  • Loading branch information
jyoo980 authored Nov 27, 2024
1 parent e6aa0ff commit 4b24d19
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import org.checkerframework.framework.qual.PostconditionAnnotation;

/**
* Indicates that the expression evaluates to a non-empty Optional, if the method terminates
* Indicates that the expression evaluates to a present Optional, if the method terminates
* successfully.
*
* <p>This postcondition annotation is useful for methods that construct a non-empty Optional:
* <p>This postcondition annotation is useful for methods that construct a present Optional:
*
* <pre><code>
* {@literal @}EnsuresPresent("optStr")
Expand Down
4 changes: 2 additions & 2 deletions docs/manual/optional-checker.tex
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
Optional<T> wrapWithOptional(...) { ... }
void myMethod() {
@SuppressWarnings("optional") // with argument x, wrapWithOptional always returns a non-empty Optional
@SuppressWarnings("optional") // with argument x, wrapWithOptional always returns a present Optional
@Present Optional<T> optX = wrapWithOptional(x);
}
\end{Verbatim}
Expand Down Expand Up @@ -214,7 +214,7 @@
It is useful if you wish to suppress a warning within an expression.

The Optional Checker considers both the return value, and also the
argument, to be an instance of a non-empty Optional after the \<castPresent>
argument, to be an instance of a present Optional after the \<castPresent>
method call.
The Optional Checker issues no warnings in any of the following
code:
Expand Down

0 comments on commit 4b24d19

Please sign in to comment.