Commit 54b6b241 by Tom Tromey Committed by 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.

From-SVN: r47095
parent 08f3a861
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> 2001-11-16 Mark Wielaard <mark@klomp.org>
* java/util/Timer.java (TaskQueue.isStopped): Remove method. * java/util/Timer.java (TaskQueue.isStopped): Remove method.
......
...@@ -176,7 +176,7 @@ public final class Integer extends Number implements Comparable ...@@ -176,7 +176,7 @@ public final class Integer extends Number implements Comparable
if (val == null) return def; if (val == null) return def;
try try
{ {
return decode(nm); return decode(val);
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
...@@ -364,6 +364,9 @@ public final class Integer extends Number implements Comparable ...@@ -364,6 +364,9 @@ public final class Integer extends Number implements Comparable
{ {
final int len; final int len;
if (str == null)
throw new NumberFormatException ();
if ((len = str.length()) == 0 || if ((len = str.length()) == 0 ||
radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) radix < Character.MIN_RADIX || radix > Character.MAX_RADIX)
throw new NumberFormatException(); throw new NumberFormatException();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment