Typo in Javadoc of Optional{Int, Double, Long}
Mike Duigou
mike.duigou at oracle.com
Thu Nov 21 13:36:50 PST 2013
Thank you.
I have created https://bugs.openjdk.java.net/browse/JDK-8028816 for this issue and will push your patch as the solution.
Mike
On Nov 21 2013, at 08:49 , bitter_fox <bitterfoxc at gmail.com> wrote:
> Hi,
> I found a typo in Javadoc of Optional{Int, Double, Long}:
>
> --------------------------------------------------------------
> /**
> * {@code get()} will return the value.
> */
> public final class OptionalInt {
> ...
> public int getAsInt() {
> ---------------------------------------------------------
>
> " * {@code get()} will return the value."
> would be
> " * {@code getAsInt()} will return the value."
>
> OptionalDouble and Long have a same typo.
>
> diff -r 042a473535aa src/share/classes/java/util/OptionalDouble.java
> --- a/src/share/classes/java/util/OptionalDouble.java Thu Oct 17 19:47:47
> 2013 -0700
> +++ b/src/share/classes/java/util/OptionalDouble.java Fri Nov 22 01:44:55
> 2013 +0900
> @@ -31,7 +31,7 @@
> /**
> * A container object which may or may not contain a {@code double} value.
> * If a value is present, {@code isPresent()} will return {@code true} and
> - * {@code get()} will return the value.
> + * {@code getAsDouble()} will return the value.
> *
> * <p>Additional methods that depend on the presence or absence of a
> contained
> * value are provided, such as {@link #orElse(double) orElse()}
> diff -r 042a473535aa src/share/classes/java/util/OptionalInt.java
> --- a/src/share/classes/java/util/OptionalInt.java Thu Oct 17 19:47:47
> 2013 -0700
> +++ b/src/share/classes/java/util/OptionalInt.java Fri Nov 22 01:44:55
> 2013 +0900
> @@ -31,7 +31,7 @@
> /**
> * A container object which may or may not contain a {@code int} value.
> * If a value is present, {@code isPresent()} will return {@code true} and
> - * {@code get()} will return the value.
> + * {@code getAsInt()} will return the value.
> *
> * <p>Additional methods that depend on the presence or absence of a
> contained
> * value are provided, such as {@link #orElse(int) orElse()}
> diff -r 042a473535aa src/share/classes/java/util/OptionalLong.java
> --- a/src/share/classes/java/util/OptionalLong.java Thu Oct 17 19:47:47
> 2013 -0700
> +++ b/src/share/classes/java/util/OptionalLong.java Fri Nov 22 01:44:55
> 2013 +0900
> @@ -31,7 +31,7 @@
> /**
> * A container object which may or may not contain a {@code long} value.
> * If a value is present, {@code isPresent()} will return {@code true} and
> - * {@code get()} will return the value.
> + * {@code getAsLong()} will return the value.
> *
> * <p>Additional methods that depend on the presence or absence of a
> contained
> * value are provided, such as {@link #orElse(long) orElse()}
>
> Regards,
> bitter_fox
>
More information about the lambda-dev
mailing list