File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
src/java.base/share/classes/java/util Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -434,8 +434,10 @@ public T orElseThrow(@Present Optional<T> this) {
434434 * @throws NullPointerException if no value is present and the exception
435435 * supplying function is {@code null}
436436 */
437+ @ CFComment ({"optional: orElseThrow(Supplier) does not throw NoSuchElementException, so its receiver is @MaybePresent." ,
438+ "Contrast with orElseThrow(), defined just above, whose receiver is @Present." })
437439 @ EnsuresQualifier (expression = "this" , qualifier = Present .class )
438- public <X extends Throwable > T orElseThrow (@ Present Optional < T > this , Supplier <? extends X > exceptionSupplier ) throws X {
440+ public <X extends Throwable > T orElseThrow (Supplier <? extends X > exceptionSupplier ) throws X {
439441 if (value != null ) {
440442 return value ;
441443 } else {
You can’t perform that action at this time.
0 commit comments