aboutsummaryrefslogtreecommitdiffstats
path: root/models-base
diff options
context:
space:
mode:
Diffstat (limited to 'models-base')
-rw-r--r--models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java2
-rw-r--r--models-base/src/main/java/org/onap/policy/models/base/PfConceptKey.java2
-rw-r--r--models-base/src/main/java/org/onap/policy/models/base/PfKeyUse.java2
-rw-r--r--models-base/src/main/java/org/onap/policy/models/base/PfModel.java2
-rw-r--r--models-base/src/main/java/org/onap/policy/models/base/PfReferenceKey.java2
-rw-r--r--models-base/src/test/java/org/onap/policy/models/base/PfKeyTest.java2
6 files changed, 6 insertions, 6 deletions
diff --git a/models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java b/models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java
index 99b5f9710..63ab14ee5 100644
--- a/models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java
+++ b/models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java
@@ -261,7 +261,7 @@ public class PfConceptContainer<C extends PfConcept, A extends PfNameVersion> ex
return 0;
}
if (getClass() != otherConcept.getClass()) {
- return this.hashCode() - otherConcept.hashCode();
+ return getClass().getName().compareTo(otherConcept.getClass().getName());
}
@SuppressWarnings("unchecked")
diff --git a/models-base/src/main/java/org/onap/policy/models/base/PfConceptKey.java b/models-base/src/main/java/org/onap/policy/models/base/PfConceptKey.java
index dfc356060..17fda7cfe 100644
--- a/models-base/src/main/java/org/onap/policy/models/base/PfConceptKey.java
+++ b/models-base/src/main/java/org/onap/policy/models/base/PfConceptKey.java
@@ -310,7 +310,7 @@ public class PfConceptKey extends PfKey {
return 0;
}
if (getClass() != otherObj.getClass()) {
- return this.hashCode() - otherObj.hashCode();
+ return getClass().getName().compareTo(otherObj.getClass().getName());
}
final PfConceptKey other = (PfConceptKey) otherObj;
diff --git a/models-base/src/main/java/org/onap/policy/models/base/PfKeyUse.java b/models-base/src/main/java/org/onap/policy/models/base/PfKeyUse.java
index 836707ef2..d56b0dbab 100644
--- a/models-base/src/main/java/org/onap/policy/models/base/PfKeyUse.java
+++ b/models-base/src/main/java/org/onap/policy/models/base/PfKeyUse.java
@@ -152,7 +152,7 @@ public class PfKeyUse extends PfKey {
return 0;
}
if (getClass() != otherObj.getClass()) {
- return this.hashCode() - otherObj.hashCode();
+ return getClass().getName().compareTo(otherObj.getClass().getName());
}
final PfKeyUse other = (PfKeyUse) otherObj;
diff --git a/models-base/src/main/java/org/onap/policy/models/base/PfModel.java b/models-base/src/main/java/org/onap/policy/models/base/PfModel.java
index 3dc233b02..07ec3af04 100644
--- a/models-base/src/main/java/org/onap/policy/models/base/PfModel.java
+++ b/models-base/src/main/java/org/onap/policy/models/base/PfModel.java
@@ -274,7 +274,7 @@ public abstract class PfModel extends PfConcept {
return 0;
}
if (getClass() != otherObj.getClass()) {
- return this.hashCode() - otherObj.hashCode();
+ return getClass().getName().compareTo(otherObj.getClass().getName());
}
final PfModel other = (PfModel) otherObj;
diff --git a/models-base/src/main/java/org/onap/policy/models/base/PfReferenceKey.java b/models-base/src/main/java/org/onap/policy/models/base/PfReferenceKey.java
index bda5aed12..bdf16dcdf 100644
--- a/models-base/src/main/java/org/onap/policy/models/base/PfReferenceKey.java
+++ b/models-base/src/main/java/org/onap/policy/models/base/PfReferenceKey.java
@@ -405,7 +405,7 @@ public class PfReferenceKey extends PfKey {
return 0;
}
if (getClass() != otherObj.getClass()) {
- return this.hashCode() - otherObj.hashCode();
+ return getClass().getName().compareTo(otherObj.getClass().getName());
}
final PfReferenceKey other = (PfReferenceKey) otherObj;
diff --git a/models-base/src/test/java/org/onap/policy/models/base/PfKeyTest.java b/models-base/src/test/java/org/onap/policy/models/base/PfKeyTest.java
index 9ef1aeb75..fca73b0d6 100644
--- a/models-base/src/test/java/org/onap/policy/models/base/PfKeyTest.java
+++ b/models-base/src/test/java/org/onap/policy/models/base/PfKeyTest.java
@@ -136,7 +136,7 @@ public class PfKeyTest {
.hasMessage("otherObj is marked @NonNull but is null");
assertEquals(0, someKey0.compareTo(someKey0));
- assertEquals(266127751, someKey0.compareTo(new DummyPfKey()));
+ assertEquals(-36, someKey0.compareTo(new DummyPfKey()));
assertFalse(someKey0.equals(null));
assertTrue(someKey0.equals(someKey0));