Re-merge with Classpath, from Brian Jones:
authorTom Tromey <tromey@redhat.com>
Fri, 16 Nov 2001 19:52:24 +0000 (19:52 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Fri, 16 Nov 2001 19:52:24 +0000 (19:52 +0000)
* 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

libjava/ChangeLog
libjava/java/lang/Integer.java

index 02fa0b36da718d89f4facc97ebfc596b6f7bb7a8..31373d6c6209ef68ae0402814acdf528bb289e95 100644 (file)
@@ -1,3 +1,11 @@
+2001-11-16  Tom Tromey  <tromey@redhat.com>
+
+       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  <mark@klomp.org>
 
        * java/util/Timer.java (TaskQueue.isStopped): Remove method.
index afa42a439f6f466ea72305e626cc5750e07453fe..ad53dab3b4c7e7f51ae7186a73426434e6bbfaa4 100644 (file)
@@ -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();