diff options
author | Bryce McKinlay <bryce@albatross.co.nz> | 2001-02-09 02:56:38 +0000 |
---|---|---|
committer | Bryce McKinlay <bryce@gcc.gnu.org> | 2001-02-09 02:56:38 +0000 |
commit | c97036e4c3dd29bcf32a3e72ce332e5fd8f5c325 (patch) | |
tree | 69de4af6d48ae5e4075714c8cdaa85fdc622abe4 /libjava/java/lang/Float.java | |
parent | 1c8b24ad46bf91f783be499851b08d0eaf7ca8c6 (diff) | |
download | gcc-c97036e4c3dd29bcf32a3e72ce332e5fd8f5c325.zip gcc-c97036e4c3dd29bcf32a3e72ce332e5fd8f5c325.tar.gz gcc-c97036e4c3dd29bcf32a3e72ce332e5fd8f5c325.tar.bz2 |
Byte.java: Remove redundant instanceof and null checks.
* 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.
From-SVN: r39556
Diffstat (limited to 'libjava/java/lang/Float.java')
-rw-r--r-- | libjava/java/lang/Float.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libjava/java/lang/Float.java b/libjava/java/lang/Float.java index 4a1f7fe..f15b06d 100644 --- a/libjava/java/lang/Float.java +++ b/libjava/java/lang/Float.java @@ -64,9 +64,6 @@ public final class Float extends Number implements Comparable public boolean equals (Object obj) { - if (obj == null) - return false; - if (!(obj instanceof Float)) return false; @@ -115,12 +112,8 @@ public final class Float extends Number implements Comparable return Double.toString ((double) v, true); } - public static Float valueOf (String s) throws NullPointerException, - NumberFormatException + public static Float valueOf (String s) throws NumberFormatException { - if (s == null) - throw new NullPointerException (); - return new Float (Double.valueOf (s).floatValue ()); } @@ -152,6 +145,13 @@ public final class Float extends Number implements Comparable } public static native int floatToIntBits (float value); + + public static int floatToRawIntBits (float value) + { + // FIXME: Is this supposed to be different? NaN values seem to be handled + // the same in the JDK. + return floatToIntBits (value); + } public static native float intBitsToFloat (int bits); |