Skip to content

Commit 1e32ff5

Browse files
committed
Add required @nonnull annotation
1 parent 900f1db commit 1e32ff5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/java.base/share/classes/java/util/Optional.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ public Stream<T> stream() {
437437
@CFComment({"optional: orElseThrow(Supplier) does not throw NoSuchElementException, so its receiver is @MaybePresent.",
438438
"Contrast with orElseThrow(), defined just above, whose receiver is @Present."})
439439
@EnsuresQualifier(expression = "this", qualifier = Present.class)
440-
public <X extends Throwable> T orElseThrow(Supplier<? extends X> exceptionSupplier) throws X {
440+
public <X extends Throwable> @NonNull T orElseThrow(Supplier<? extends X> exceptionSupplier) throws X {
441441
if (value != null) {
442442
return value;
443443
} else {

0 commit comments

Comments
 (0)