diff options
author | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-02-09 02:56:38 +0000 |
---|---|---|
committer | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-02-09 02:56:38 +0000 |
commit | 8cc2e82455f265d2664f4aa786e85bce34195919 (patch) | |
tree | 69de4af6d48ae5e4075714c8cdaa85fdc622abe4 /libjava/java/lang/Double.java | |
parent | 95e4499f5b9dc067678b1fb219edc11aadfedc4a (diff) | |
download | gcc-8cc2e82455f265d2664f4aa786e85bce34195919.tar.gz |
* java/lang/Byte.java: Remove redundant instanceof and null checks.
* java/lang/Integer.java: Likewise.
* java/lang/Long.java: Likewise.
* java/lang/Short.java: Likewise.
* java/lang/Double.java: Likewise.
(doubleToRawLongBits): New method.
* java/lang/Float.java: As above.
(floatToRawIntBits): New method.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39556 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/lang/Double.java')
-rw-r--r-- | libjava/java/lang/Double.java | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/libjava/java/lang/Double.java b/libjava/java/lang/Double.java index 8de429e4fc4..a656b510e06 100644 --- a/libjava/java/lang/Double.java +++ b/libjava/java/lang/Double.java @@ -1,4 +1,4 @@ -/* Copyright (C) 1998, 1999, 2000 Free Software Foundation +/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation This file is part of libgcj. @@ -54,9 +54,6 @@ public final class Double extends Number implements Comparable public boolean equals (Object obj) { - if (obj == null) - return false; - if (!(obj instanceof Double)) return false; @@ -108,12 +105,8 @@ public final class Double extends Number implements Comparable return toString (v, false); } - public static Double valueOf (String s) throws NullPointerException, - NumberFormatException + public static Double valueOf (String s) throws NumberFormatException { - if (s == null) - throw new NullPointerException (); - return new Double (parseDouble (s)); } @@ -146,6 +139,12 @@ public final class Double extends Number implements Comparable public static native long doubleToLongBits (double value); + public static long doubleToRawLongBits (double value) + { + // FIXME: Check that this is correct with respect to NaN values. + return doubleToLongBits (value); + } + public static native double longBitsToDouble (long bits); public int compareTo (Double d) |