Corrected equals & hashcode methods in extension keys
[openflowjava.git] / openflow-protocol-api / src / main / java / org / opendaylight / openflowjava / protocol / api / keys / ActionSerializerKey.java
index 623bdea4b9bd238c99cf930b6ac07414f9405481..38b8cd498d075199a3b9f2d7ad294e757e317ed3 100644 (file)
@@ -33,16 +33,24 @@ public class ActionSerializerKey<TYPE extends ActionBase> extends MessageTypeKey
         this.experimenterId = experimenterId;\r
     }\r
 \r
+    @Override\r
+    public int hashCode() {\r
+        final int prime = 31;\r
+        int result = super.hashCode();\r
+        result = prime * result + ((actionType == null) ? 0 : actionType.hashCode());\r
+        result = prime * result + ((experimenterId == null) ? 0 : experimenterId.hashCode());\r
+        return result;\r
+    }\r
+\r
     @Override\r
     public boolean equals(Object obj) {\r
         if (this == obj)\r
             return true;\r
         if (!super.equals(obj))\r
             return false;\r
-        if (getClass() != obj.getClass())\r
+        if (!(obj instanceof ActionSerializerKey))\r
             return false;\r
-        @SuppressWarnings("rawtypes")\r
-        ActionSerializerKey other = (ActionSerializerKey) obj;\r
+        ActionSerializerKey<?> other = (ActionSerializerKey<?>) obj;\r
         if (actionType == null) {\r
             if (other.actionType != null)\r
                 return false;\r