Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrescobar2010-11-03 14:31:52 -0400
committerRyan D. Brooks2010-11-03 14:31:52 -0400
commitbe62ee2b2635df7c7d07abfb8a859cf55d250a16 (patch)
treefcf271082c0b29d111798b79196e0c13f9b5b937 /plugins/org.eclipse.osee.framework.database
parent9e30e486b5d9fb291503f12368bd6ed228831812 (diff)
downloadorg.eclipse.osee-be62ee2b2635df7c7d07abfb8a859cf55d250a16.tar.gz
org.eclipse.osee-be62ee2b2635df7c7d07abfb8a859cf55d250a16.tar.xz
org.eclipse.osee-be62ee2b2635df7c7d07abfb8a859cf55d250a16.zip
bug: Fix CharJoinQuery hashCode and equals methods
Diffstat (limited to 'plugins/org.eclipse.osee.framework.database')
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/CharJoinQuery.java35
1 files changed, 34 insertions, 1 deletions
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/CharJoinQuery.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/CharJoinQuery.java
index 7a092f6457..7ab05345bd 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/CharJoinQuery.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/CharJoinQuery.java
@@ -30,14 +30,47 @@ public final class CharJoinQuery extends AbstractJoinQuery {
}
@Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ CharJoinEntry other = (CharJoinEntry) obj;
+ if (!getOuterType().equals(other.getOuterType())) {
+ return false;
+ }
+ if (value == null) {
+ if (other.value != null) {
+ return false;
+ }
+ } else if (!value.equals(other.value)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
public int hashCode() {
- return 37 * value.hashCode();
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + getOuterType().hashCode();
+ result = prime * result + ((value == null) ? 0 : value.hashCode());
+ return result;
}
@Override
public String toString() {
return value;
}
+
+ private CharJoinQuery getOuterType() {
+ return CharJoinQuery.this;
+ }
}
protected CharJoinQuery(IJoinAccessor joinAccessor, int queryId) {

Back to the top