8059324: orElseThrow has different signatures for OptionalPrimitive and Optional<T>

Reviewed-by: lancea, chegar
This commit is contained in:
Paul Sandoz 2015-02-02 14:19:00 +01:00
parent 8aae81b484
commit 3b9021981f
3 changed files with 3 additions and 3 deletions

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {