OSDN Git Service

2003-11-11 Michael Koch <konqueror@gmx.de>
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 Nov 2003 12:22:20 +0000 (12:22 +0000)
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 Nov 2003 12:22:20 +0000 (12:22 +0000)
* java/awt/Font.java,
java/awt/datatransfer/DataFlavor.java,
java/math/BigInteger.java,
java/net/Inet4Address.java,
java/net/Inet6Address.java,
java/rmi/MarshalledObject.java,
java/rmi/server/RMIClassLoader.java,
java/security/cert/CertStore.java,
java/sql/Timestamp.java,
java/text/SimpleDateFormat.java,
javax/naming/CompoundName.java:
Removed some redundant obj == null checks.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73448 138bc75d-0d04-0410-961f-82ee72b054a4

12 files changed:
libjava/ChangeLog
libjava/java/awt/Font.java
libjava/java/awt/datatransfer/DataFlavor.java
libjava/java/math/BigInteger.java
libjava/java/net/Inet4Address.java
libjava/java/net/Inet6Address.java
libjava/java/rmi/MarshalledObject.java
libjava/java/rmi/server/RMIClassLoader.java
libjava/java/security/cert/CertStore.java
libjava/java/sql/Timestamp.java
libjava/java/text/SimpleDateFormat.java
libjava/javax/naming/CompoundName.java

index 607d1f8..1d26a6f 100644 (file)
@@ -1,5 +1,20 @@
 2003-11-11  Michael Koch  <konqueror@gmx.de>
 
+       * java/awt/Font.java,
+       java/awt/datatransfer/DataFlavor.java,
+       java/math/BigInteger.java,
+       java/net/Inet4Address.java,
+       java/net/Inet6Address.java,
+       java/rmi/MarshalledObject.java,
+       java/rmi/server/RMIClassLoader.java,
+       java/security/cert/CertStore.java,
+       java/sql/Timestamp.java,
+       java/text/SimpleDateFormat.java,
+       javax/naming/CompoundName.java:
+       Removed some redundant obj == null checks.
+
+2003-11-11  Michael Koch  <konqueror@gmx.de>
+
        * java/nio/ByteBuffer.java
        (equals): Remove redundant obj == null check.
 
index d1ff566..8096843 100644 (file)
@@ -1226,9 +1226,6 @@ hashCode()
 public boolean
 equals(Object obj)
 {
-  if (obj == null)
-    return(false);
-
   if (!(obj instanceof Font))
     return(false);
 
index e56f975..897edff 100644 (file)
@@ -723,9 +723,6 @@ equals(DataFlavor flavor)
 public boolean
 equals(Object obj)
 {
-  if (obj == null)
-    return(false);
-
   if (!(obj instanceof DataFlavor))
     return(false);
 
index fb1cf7c..312a9e9 100644 (file)
@@ -1565,7 +1565,7 @@ public class BigInteger extends Number implements Comparable
   /* Assumes this and obj are both canonicalized. */
   public boolean equals(Object obj)
   {
-    if (obj == null || ! (obj instanceof BigInteger))
+    if (! (obj instanceof BigInteger))
       return false;
     return equals(this, (BigInteger) obj);
   }
index 3b18f6f..76abfc3 100644 (file)
@@ -258,7 +258,7 @@ public final class Inet4Address extends InetAddress
    */
   public boolean equals (Object obj)
   {
-    if (obj == null || ! (obj instanceof InetAddress))
+    if (! (obj instanceof InetAddress))
       return false;
     
     byte[] addr1 = addr;
index 4f4563d..c3418c6 100644 (file)
@@ -243,7 +243,7 @@ public final class Inet6Address extends InetAddress
    */
   public boolean equals (Object obj)
   {
-    if (obj == null || ! (obj instanceof Inet6Address))
+    if (! (obj instanceof Inet6Address))
       return false;
 
     Inet6Address tmp = (Inet6Address) obj;
index 9f966b9..0ba9158 100644 (file)
@@ -76,7 +76,7 @@ public final class MarshalledObject
   
   public boolean equals(Object obj) 
   {
-    if(obj == null || !(obj instanceof MarshalledObject) )
+    if (! (obj instanceof MarshalledObject))
       return false;
 
     // hashCode even differs, don't do the time-consuming comparisons
index 57e52a3..e6af682 100644 (file)
@@ -113,8 +113,7 @@ public class RMIClassLoader
      */
     public boolean equals (Object theOther)
     {
-      if (theOther != null
-          && theOther instanceof CacheKey)
+      if (theOther instanceof CacheKey)
       {
        CacheKey key = (CacheKey) theOther;
        
index 44143c5..55326a4 100644 (file)
@@ -215,8 +215,7 @@ public class CertStore
     catch (java.lang.reflect.InvocationTargetException ite)
       {
         Throwable cause = ite.getCause();
-        if (cause != null &&
-           (cause instanceof InvalidAlgorithmParameterException))
+        if (cause instanceof InvalidAlgorithmParameterException)
           throw (InvalidAlgorithmParameterException) cause;
         else
           throw new NoSuchAlgorithmException(type);
index 5ec75da..22108f5 100644 (file)
@@ -224,9 +224,6 @@ public class Timestamp extends java.util.Date
    */
   public boolean equals(Object obj)
   {
-    if (obj == null)
-      return false;
-
     if (!(obj instanceof Timestamp))
       return false;
 
index 3ad71ee..88aaf41 100644 (file)
@@ -374,9 +374,6 @@ public class SimpleDateFormat extends DateFormat
    */
   public boolean equals(Object o)
   {
-    if (o == null)
-      return false;
-
     if (!super.equals(o))
       return false;
 
index 2039639..4df89e9 100644 (file)
@@ -240,7 +240,7 @@ public class CompoundName implements Name, Cloneable, Serializable
 
   public int compareTo (Object obj)
   {
-    if (obj == null || ! (obj instanceof CompoundName))
+    if (! (obj instanceof CompoundName))
       throw new ClassCastException ("CompoundName.compareTo() expected CompoundName");
     CompoundName cn = (CompoundName) obj;
     int last = Math.min (cn.elts.size (), elts.size ());