aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/lang/Long.java
diff options
context:
space:
mode:
authorBryce McKinlay <bryce@albatross.co.nz>2001-02-09 02:56:38 +0000
committerBryce McKinlay <bryce@gcc.gnu.org>2001-02-09 02:56:38 +0000
commitc97036e4c3dd29bcf32a3e72ce332e5fd8f5c325 (patch)
tree69de4af6d48ae5e4075714c8cdaa85fdc622abe4 /libjava/java/lang/Long.java
parent1c8b24ad46bf91f783be499851b08d0eaf7ca8c6 (diff)
downloadgcc-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/Long.java')
-rw-r--r--libjava/java/lang/Long.java17
1 files changed, 7 insertions, 10 deletions
diff --git a/libjava/java/lang/Long.java b/libjava/java/lang/Long.java
index e6872db..cb2cec2 100644
--- a/libjava/java/lang/Long.java
+++ b/libjava/java/lang/Long.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.
@@ -86,11 +86,9 @@ public final class Long extends Number implements Comparable
}
// Added in JDK 1.2
- public int compareTo(Object o) throws ClassCastException
+ /** @throws ClassCastException */
+ public int compareTo(Object o)
{
- if (!(o instanceof Long))
- throw new ClassCastException();
-
return this.compareTo((Long) o);
}
@@ -102,7 +100,7 @@ public final class Long extends Number implements Comparable
int radix = 10;
final int len;
- if (str == null || (len = str.length()) == 0)
+ if ((len = str.length()) == 0)
throw new NumberFormatException();
// Negative numbers are always radix 10.
@@ -141,8 +139,7 @@ public final class Long extends Number implements Comparable
public boolean equals(Object obj)
{
- return (obj != null && (obj instanceof Long)
- && ((Long) obj).value == value);
+ return (obj instanceof Long && ((Long) obj).value == value);
}
public static Long getLong(String prop)
@@ -183,8 +180,8 @@ public final class Long extends Number implements Comparable
{
final int len;
- if (str == null || (len = str.length()) == 0 ||
- radix < Character.MIN_RADIX || radix > Character.MAX_RADIX)
+ if ((len = str.length()) == 0 || radix < Character.MIN_RADIX
+ || radix > Character.MAX_RADIX)
throw new NumberFormatException();
boolean isNeg = false;