From b8fae2d33cfffdf41f134b530fd3790da65ed2a5 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Wed, 15 Jul 2009 14:43:13 -0700 Subject: [PATCH] 6463998: Undocumented NullPointerExeption from Float.parseFloat and Double.parseDouble Reviewed-by: lancea, iris --- jdk/src/share/classes/java/lang/Double.java | 1 + jdk/src/share/classes/java/lang/Float.java | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/jdk/src/share/classes/java/lang/Double.java b/jdk/src/share/classes/java/lang/Double.java index 9866d5d4aee..8efb241b808 100644 --- a/jdk/src/share/classes/java/lang/Double.java +++ b/jdk/src/share/classes/java/lang/Double.java @@ -529,6 +529,7 @@ public final class Double extends Number implements Comparable { * @param s the string to be parsed. * @return the {@code double} value represented by the string * argument. + * @throws NullPointerException if the string is null * @throws NumberFormatException if the string does not contain * a parsable {@code double}. * @see java.lang.Double#valueOf(String) diff --git a/jdk/src/share/classes/java/lang/Float.java b/jdk/src/share/classes/java/lang/Float.java index 1c89a458fa7..eb133016f6b 100644 --- a/jdk/src/share/classes/java/lang/Float.java +++ b/jdk/src/share/classes/java/lang/Float.java @@ -438,12 +438,13 @@ public final class Float extends Number implements Comparable { * represented by the specified {@code String}, as performed * 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 * 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}. - * @see java.lang.Float#valueOf(String) + * @see java.lang.Float#valueOf(String) * @since 1.2 */ public static float parseFloat(String s) throws NumberFormatException {