summaryrefslogtreecommitdiffstats
path: root/models-pdp/src/main/java/org
diff options
context:
space:
mode:
authorHenry.Sun <henry.a.sun@est.tech>2019-08-07 03:41:50 +0000
committerHenry.Sun <henry.a.sun@est.tech>2019-08-07 03:41:50 +0000
commitb7909b8e74c0bc5920f5d0397a4371988df9e8b2 (patch)
tree3307c4c2c260c0ea975aceb6c5a5eedbb6aa5230 /models-pdp/src/main/java/org
parent52d2377853af5eb2acba40381e61de17f3fe0d29 (diff)
replace hashCode function with compareTo
Issue-ID: POLICY-1600 Change-Id: If660cbe84424e492b6db3ab11ef97b37f046b3aa Signed-off-by: Henry.Sun <henry.a.sun@est.tech>
Diffstat (limited to 'models-pdp/src/main/java/org')
-rw-r--r--models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdp.java2
-rw-r--r--models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpSubGroup.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdp.java b/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdp.java
index 528d6fbe7..7d90c03b1 100644
--- a/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdp.java
+++ b/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdp.java
@@ -210,7 +210,7 @@ public class JpaPdp extends PfConcept implements PfAuthorative<Pdp>, Serializabl
return 0;
}
if (getClass() != otherConcept.getClass()) {
- return this.hashCode() - otherConcept.hashCode();
+ return getClass().getName().compareTo(otherConcept.getClass().getName());
}
final JpaPdp other = (JpaPdp) otherConcept;
diff --git a/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpSubGroup.java b/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpSubGroup.java
index f0ff4a6c2..723d427de 100644
--- a/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpSubGroup.java
+++ b/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpSubGroup.java
@@ -360,7 +360,7 @@ public class JpaPdpSubGroup extends PfConcept implements PfAuthorative<PdpSubGro
return 0;
}
if (getClass() != otherConcept.getClass()) {
- return this.hashCode() - otherConcept.hashCode();
+ return getClass().getName().compareTo(otherConcept.getClass().getName());
}
final JpaPdpSubGroup other = (JpaPdpSubGroup) otherConcept;