From: Tom Tromey Date: Fri, 16 Nov 2001 19:52:24 +0000 (+0000) Subject: Re-merge with Classpath, from Brian Jones: X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=54b6b24152d94ccc92632bd6a67812ede20b1aae;p=gcc.git Re-merge with Classpath, from Brian Jones: * java/lang/Integer.java (getInteger): Attempt to decode the value of the system property instead of the name of the system property. (parseInt): Throw NumberFormatException explicitly in the case of a null argument in keeping with JDK 1.3. From-SVN: r47095 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 02fa0b36da7..31373d6c620 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,11 @@ +2001-11-16 Tom Tromey + + Re-merge with Classpath, from Brian Jones: + * java/lang/Integer.java (getInteger): Attempt to decode the value + of the system property instead of the name of the system property. + (parseInt): Throw NumberFormatException explicitly in the case of + a null argument in keeping with JDK 1.3. + 2001-11-16 Mark Wielaard * java/util/Timer.java (TaskQueue.isStopped): Remove method. diff --git a/libjava/java/lang/Integer.java b/libjava/java/lang/Integer.java index afa42a439f6..ad53dab3b4c 100644 --- a/libjava/java/lang/Integer.java +++ b/libjava/java/lang/Integer.java @@ -176,7 +176,7 @@ public final class Integer extends Number implements Comparable if (val == null) return def; try { - return decode(nm); + return decode(val); } catch (NumberFormatException e) { @@ -364,6 +364,9 @@ public final class Integer extends Number implements Comparable { final int len; + if (str == null) + throw new NumberFormatException (); + if ((len = str.length()) == 0 || radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) throw new NumberFormatException();