mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-09 01:48:34 +00:00
8059324: orElseThrow has different signatures for OptionalPrimitive and Optional<T>
Reviewed-by: lancea, chegar
This commit is contained in:
parent
8aae81b484
commit
3b9021981f
@ -182,7 +182,7 @@ public final class OptionalDouble {
|
||||
* @throws NullPointerException if no value is present and
|
||||
* {@code exceptionSupplier} is null
|
||||
*/
|
||||
public<X extends Throwable> double orElseThrow(Supplier<X> exceptionSupplier) throws X {
|
||||
public<X extends Throwable> double orElseThrow(Supplier<? extends X> exceptionSupplier) throws X {
|
||||
if (isPresent) {
|
||||
return value;
|
||||
} else {
|
||||
|
||||
@ -182,7 +182,7 @@ public final class OptionalInt {
|
||||
* @throws NullPointerException if no value is present and
|
||||
* {@code exceptionSupplier} is null
|
||||
*/
|
||||
public<X extends Throwable> int orElseThrow(Supplier<X> exceptionSupplier) throws X {
|
||||
public<X extends Throwable> int orElseThrow(Supplier<? extends X> exceptionSupplier) throws X {
|
||||
if (isPresent) {
|
||||
return value;
|
||||
} else {
|
||||
|
||||
@ -182,7 +182,7 @@ public final class OptionalLong {
|
||||
* @throws NullPointerException if no value is present and
|
||||
* {@code exceptionSupplier} is null
|
||||
*/
|
||||
public<X extends Throwable> long orElseThrow(Supplier<X> exceptionSupplier) throws X {
|
||||
public<X extends Throwable> long orElseThrow(Supplier<? extends X> exceptionSupplier) throws X {
|
||||
if (isPresent) {
|
||||
return value;
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user