Cleanup sonar-reported code smells
[bgpcep.git] / pcep / spi / src / main / java / org / opendaylight / protocol / pcep / spi / PCEPErrorIdentifier.java
index 5cadeb46550064c2269c37e734f9031e7ea690eb..0871128d239f94c57322cd4b9f1b04fc4d962cb1 100644 (file)
@@ -7,10 +7,13 @@
  */
 package org.opendaylight.protocol.pcep.spi;
 
+import java.io.Serializable;
+
 /**
- * Caret for combination of Error-type and Error-value
+ * Caret for combination of Error-type and Error-value.
  */
-final class PCEPErrorIdentifier {
+final class PCEPErrorIdentifier implements Serializable {
+    private static final long serialVersionUID = 2434590156751699872L;
     private final short type;
     private final short value;
 
@@ -41,20 +44,11 @@ final class PCEPErrorIdentifier {
         if (this == obj) {
             return true;
         }
-        if (obj == null) {
-            return false;
-        }
-        if (this.getClass() != obj.getClass()) {
+        if (obj == null || this.getClass() != obj.getClass()) {
             return false;
         }
         final PCEPErrorIdentifier other = (PCEPErrorIdentifier) obj;
-        if (this.type != other.type) {
-            return false;
-        }
-        if (this.value != other.value) {
-            return false;
-        }
-        return true;
+        return this.type == other.type && this.value == other.value;
     }
 
     @Override