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/Short.java | |
| parent | 1c8b24ad46bf91f783be499851b08d0eaf7ca8c6 (diff) | |
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/Short.java')
| -rw-r--r-- | libjava/java/lang/Short.java | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/libjava/java/lang/Short.java b/libjava/java/lang/Short.java index 6733607da14..66eb4fdfeed 100644 --- a/libjava/java/lang/Short.java +++ b/libjava/java/lang/Short.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. @@ -115,18 +115,15 @@ public final class Short 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 Short) - return this.value - ((Short) o).value; - else - throw new ClassCastException(); + return this.value - ((Short) o).value; } public boolean equals(Object obj) { - return (obj != null && (obj instanceof Short) - && ((Short) obj).value == value); + return (obj instanceof Short) && ((Short) obj).value == value; } // Verified that hashCode is returns plain value (see Short_1 test). |
