We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 900f1db commit 1e32ff5Copy full SHA for 1e32ff5
src/java.base/share/classes/java/util/Optional.java
@@ -437,7 +437,7 @@ public Stream<T> stream() {
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."})
439
@EnsuresQualifier(expression = "this", qualifier = Present.class)
440
- public <X extends Throwable> T orElseThrow(Supplier<? extends X> exceptionSupplier) throws X {
+ public <X extends Throwable> @NonNull T orElseThrow(Supplier<? extends X> exceptionSupplier) throws X {
441
if (value != null) {
442
return value;
443
} else {
0 commit comments