8059324: orElseThrow has different signatures for OptionalPrimitive and Optional<T>
Reviewed-by: lancea, chegar
--- a/jdk/src/java.base/share/classes/java/util/OptionalDouble.java Mon Feb 02 14:18:54 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/util/OptionalDouble.java Mon Feb 02 14:19:00 2015 +0100
@@ -182,7 +182,7 @@
* @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 {
--- a/jdk/src/java.base/share/classes/java/util/OptionalInt.java Mon Feb 02 14:18:54 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/util/OptionalInt.java Mon Feb 02 14:19:00 2015 +0100
@@ -182,7 +182,7 @@
* @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 {
--- a/jdk/src/java.base/share/classes/java/util/OptionalLong.java Mon Feb 02 14:18:54 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/util/OptionalLong.java Mon Feb 02 14:19:00 2015 +0100
@@ -182,7 +182,7 @@
* @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 {