[infinispan-commits] Infinispan SVN: r768 - trunk/core/src/main/java/org/infinispan/commands/write.

infinispan-commits at lists.jboss.org infinispan-commits at lists.jboss.org
Thu Sep 3 05:26:53 EDT 2009


Author: mircea.markus
Date: 2009-09-03 05:26:53 -0400 (Thu, 03 Sep 2009)
New Revision: 768

Modified:
   trunk/core/src/main/java/org/infinispan/commands/write/InvalidateCommand.java
Log:
findbugs:
 Class doesn't override equals in superclass
This class extends a class that defines an equals method and adds fields, but doesn't define an equals method itself. Thus, equality on instances of this class will ignore the identity of the subclass and the added fields. Be sure this is what is intended, and that you don't need to override the equals method. Even if you don't need to override the equals method, consider overriding it anyway to document the fact that the equals method for the subclass just return the result of invoking super.equals(o).

Modified: trunk/core/src/main/java/org/infinispan/commands/write/InvalidateCommand.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/commands/write/InvalidateCommand.java	2009-09-03 09:23:22 UTC (rev 767)
+++ trunk/core/src/main/java/org/infinispan/commands/write/InvalidateCommand.java	2009-09-03 09:26:53 UTC (rev 768)
@@ -127,4 +127,16 @@
    public Object[] getKeys() {
       return keys;
    }
+
+   @Override
+   public boolean equals(Object o) {
+      if (this == o) return true;
+      if (!(o instanceof InvalidateCommand)) return false;
+      if (!super.equals(o)) return false;
+
+      InvalidateCommand that = (InvalidateCommand) o;
+
+      if (!Arrays.equals(keys, that.keys)) return false;
+      return true;
+   }
 }
\ No newline at end of file



More information about the infinispan-commits mailing list