Merge "Fixed generation of Transfer Objects;"
authorGiovanni Meo <gmeo@cisco.com>
Wed, 15 May 2013 14:12:07 +0000 (14:12 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 15 May 2013 14:12:07 +0000 (14:12 +0000)
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/core/internal/PriorityMessage.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/ComponentActivatorAbstractBase.java

index 0c66dccd013b150e8c8631fdfe33f47b6b219ac2..6a2cb9e9c4f576949a79a1b63976605a3970d95f 100644 (file)
@@ -10,8 +10,6 @@ package org.opendaylight.controller.protocol_plugin.openflow.core.internal;
 
 import java.util.concurrent.atomic.AtomicLong;
 
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
 import org.openflow.protocol.OFMessage;
 
@@ -55,17 +53,41 @@ class PriorityMessage {
 
     @Override
     public int hashCode() {
-        return HashCodeBuilder.reflectionHashCode(this);
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((msg == null) ? 0 : msg.hashCode());
+        result = prime * result + priority;
+        result = prime * result + (int) (seqNum ^ (seqNum >>> 32));
+        result = prime * result + (syncReply ? 1231 : 1237);
+        return result;
     }
 
     @Override
     public boolean equals(Object obj) {
-        return EqualsBuilder.reflectionEquals(this, obj);
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        PriorityMessage other = (PriorityMessage) obj;
+        if (msg == null) {
+            if (other.msg != null)
+                return false;
+        } else if (!msg.equals(other.msg))
+            return false;
+        if (priority != other.priority)
+            return false;
+        if (seqNum != other.seqNum)
+            return false;
+        if (syncReply != other.syncReply)
+            return false;
+        return true;
     }
 
     @Override
     public String toString() {
-        return "PriorityMessage[" + ReflectionToStringBuilder.toString(this)
-                + "]";
+        return "PriorityMessage [msg=" + msg + ", priority=" + priority
+                + ", seqNum=" + seqNum + ", syncReply=" + syncReply + "]";
     }
 }
index 88a829ba0464ab7c57e2c0d320666df78d2a7175..039acf52e698945d6ec9275db7eb87dee1571d46 100644 (file)
@@ -32,7 +32,6 @@ import org.apache.felix.dm.DependencyManager;
 import org.apache.felix.dm.ServiceDependency;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceRegistration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -45,7 +44,6 @@ abstract public class ComponentActivatorAbstractBase implements
         BundleActivator, IContainerAware {
     Logger logger = LoggerFactory
             .getLogger(ComponentActivatorAbstractBase.class);
-    private ServiceRegistration containerAwareRegistration;
     private DependencyManager dm;
     private ConcurrentMap<ImmutablePair<String, Object>, Component> dbInstances = (ConcurrentMap<ImmutablePair<String, Object>, Component>) new ConcurrentHashMap<ImmutablePair<String, Object>, Component>();
     private ConcurrentMap<Object, Component> dbGlobalInstances = (ConcurrentMap<Object, Component>) new ConcurrentHashMap<Object, Component>();
@@ -356,9 +354,9 @@ abstract public class ComponentActivatorAbstractBase implements
                     }
                 }
             }
-
+            
             // Register with OSGi the provider for the service IContainerAware
-            this.containerAwareRegistration = context.registerService(
+            context.registerService(
                     IContainerAware.class.getName(), this, null);
 
             // Now call the derived class init function