aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2001-11-16 19:52:24 +0000
committerTom Tromey <tromey@gcc.gnu.org>2001-11-16 19:52:24 +0000
commit54b6b24152d94ccc92632bd6a67812ede20b1aae (patch)
tree24bf36c68ab6e2699d0d81c74950f12b9a6771a2 /libjava
parent08f3a861a03b6e67fafa8787f7a1ddbdd9b6d6fb (diff)
downloadgcc-54b6b24152d94ccc92632bd6a67812ede20b1aae.zip
gcc-54b6b24152d94ccc92632bd6a67812ede20b1aae.tar.gz
gcc-54b6b24152d94ccc92632bd6a67812ede20b1aae.tar.bz2
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
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog8
-rw-r--r--libjava/java/lang/Integer.java5
2 files changed, 12 insertions, 1 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 02fa0b3..31373d6 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -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.
diff --git a/libjava/java/lang/Integer.java b/libjava/java/lang/Integer.java
index afa42a4..ad53dab 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();