From c97036e4c3dd29bcf32a3e72ce332e5fd8f5c325 Mon Sep 17 00:00:00 2001 From: Bryce McKinlay Date: Fri, 9 Feb 2001 02:56:38 +0000 Subject: 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 --- libjava/java/lang/Float.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'libjava/java/lang/Float.java') diff --git a/libjava/java/lang/Float.java b/libjava/java/lang/Float.java index 4a1f7fecc02..f15b06d2157 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); -- cgit v1.2.3