summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/collection/Collection.java
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2014-10-03 23:56:29 +0200
committerAndrew Branson <andrew.branson@cern.ch>2014-10-03 23:56:29 +0200
commitc48883b9584a41db39154f3d6370d13b8c8f8018 (patch)
tree0dd45f1be966483d47bb1d8fec8a3fb95b1d71e1 /src/main/java/com/c2kernel/collection/Collection.java
parentb68ea0f2b12c4c5189c5fc7c182a1b242dc63579 (diff)
More FindBugs cleanup
Diffstat (limited to 'src/main/java/com/c2kernel/collection/Collection.java')
-rw-r--r--src/main/java/com/c2kernel/collection/Collection.java36
1 files changed, 33 insertions, 3 deletions
diff --git a/src/main/java/com/c2kernel/collection/Collection.java b/src/main/java/com/c2kernel/collection/Collection.java
index 7ab9fb2..2bedfb2 100644
--- a/src/main/java/com/c2kernel/collection/Collection.java
+++ b/src/main/java/com/c2kernel/collection/Collection.java
@@ -20,8 +20,6 @@
*/
package com.c2kernel.collection;
-import java.util.Iterator;
-
import com.c2kernel.common.InvalidCollectionModification;
import com.c2kernel.common.ObjectAlreadyExistsException;
import com.c2kernel.common.ObjectNotFoundException;
@@ -173,6 +171,38 @@ abstract public class Collection<E extends CollectionMember> implements C2KLocal
public abstract void removeMember(int memberId) throws ObjectNotFoundException;
@Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((mMembers == null) ? 0 : mMembers.hashCode());
+ result = prime * result + ((mName == null) ? 0 : mName.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Collection<?> other = (Collection<?>) obj;
+ if (mMembers == null) {
+ if (other.mMembers != null)
+ return false;
+ } else if (!mMembers.equals(other.mMembers))
+ return false;
+ if (mName == null) {
+ if (other.mName != null)
+ return false;
+ } else if (!mName.equals(other.mName))
+ return false;
+ return true;
+ }
+
+ /*@Override
public boolean equals(Object other) {
if (!(other instanceof Collection<?>)) return false;
Collection<?> otherColl = (Collection<?>)other;
@@ -188,7 +218,7 @@ abstract public class Collection<E extends CollectionMember> implements C2KLocal
}
}
return true;
- }
+ }*/
}