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
This commit is contained in:
Bryce McKinlay 2001-02-09 02:56:38 +00:00 committed by Bryce McKinlay
parent 1c8b24ad46
commit c97036e4c3
7 changed files with 50 additions and 51 deletions

View file

@ -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);