Author: pferraro
Date: 2009-03-17 13:19:02 -0400 (Tue, 17 Mar 2009)
New Revision: 2373
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/ModClusterServiceDRMEntry.java
Log:
[MODCLUSTER-60] Don't consider jvmRoutes in equals(...)
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/ModClusterServiceDRMEntry.java
===================================================================
---
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/ModClusterServiceDRMEntry.java 2009-03-17
12:49:11 UTC (rev 2372)
+++
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/ModClusterServiceDRMEntry.java 2009-03-17
17:19:02 UTC (rev 2373)
@@ -56,6 +56,7 @@
public ModClusterServiceDRMEntry(ClusterNode peer, Set<MCMPServerState>
mcmpServerStates, Set<String> jvmRoutes)
{
assert peer != null : "peer is null";
+ assert jvmRoutes != null : "jvmRoutes is null";
this.peer = peer;
this.mcmpServerStates = mcmpServerStates;
@@ -157,28 +158,29 @@
if (obj instanceof ModClusterServiceDRMEntry)
{
ModClusterServiceDRMEntry other = (ModClusterServiceDRMEntry) obj;
- return (this.peer.equals(other.peer)
- && this.safeEquals(this.mcmpServerStates,
other.mcmpServerStates)
- && this.safeEquals(this.jvmRoutes, other.jvmRoutes));
+
+ return this.peer.equals(other.peer) &&
this.safeEquals(this.mcmpServerStates, other.mcmpServerStates);
}
+
return false;
}
@Override
public int hashCode()
{
- int result = 17;
- result += 23 * this.peer.hashCode();
- result += 23 * (this.mcmpServerStates == null ? 0 :
this.mcmpServerStates.hashCode());
- result += 23 * (this.jvmRoutes == null ? 0 : this.jvmRoutes.hashCode());
- return result;
+ return this.peer.hashCode();
}
@Override
public String toString()
{
- return new StringBuilder(this.getClass().getName())
-
.append("{peer=").append(this.peer).append("}").toString();
+ StringBuilder builder = new StringBuilder(this.getClass().getName());
+ builder.append("{peer=").append(this.peer);
+ if (this.mcmpServerStates != null)
+ {
+ builder.append(",states=").append(this.mcmpServerStates);
+ }
+ return builder.append("}").toString();
}
private boolean safeEquals(Object a, Object b)
Show replies by date