6463998: Undocumented NullPointerExeption from Float.parseFloat and Double.parseDouble

Reviewed-by: lancea, iris
This commit is contained in:
Joe Darcy 2009-07-15 14:43:13 -07:00
parent 8c000e858b
commit b8fae2d33c
2 changed files with 5 additions and 3 deletions

View file

@ -529,6 +529,7 @@ public final class Double extends Number implements Comparable<Double> {
* @param s the string to be parsed. * @param s the string to be parsed.
* @return the {@code double} value represented by the string * @return the {@code double} value represented by the string
* argument. * argument.
* @throws NullPointerException if the string is null
* @throws NumberFormatException if the string does not contain * @throws NumberFormatException if the string does not contain
* a parsable {@code double}. * a parsable {@code double}.
* @see java.lang.Double#valueOf(String) * @see java.lang.Double#valueOf(String)

View file

@ -438,12 +438,13 @@ public final class Float extends Number implements Comparable<Float> {
* represented by the specified {@code String}, as performed * represented by the specified {@code String}, as performed
* by the {@code valueOf} method of class {@code Float}. * by the {@code valueOf} method of class {@code Float}.
* *
* @param s the string to be parsed. * @param s the string to be parsed.
* @return the {@code float} value represented by the string * @return the {@code float} value represented by the string
* argument. * argument.
* @throws NumberFormatException if the string does not contain a * @throws NullPointerException if the string is null
* @throws NumberFormatException if the string does not contain a
* parsable {@code float}. * parsable {@code float}.
* @see java.lang.Float#valueOf(String) * @see java.lang.Float#valueOf(String)
* @since 1.2 * @since 1.2
*/ */
public static float parseFloat(String s) throws NumberFormatException { public static float parseFloat(String s) throws NumberFormatException {