From b7909b8e74c0bc5920f5d0397a4371988df9e8b2 Mon Sep 17 00:00:00 2001 From: "Henry.Sun" Date: Wed, 7 Aug 2019 03:41:50 +0000 Subject: replace hashCode function with compareTo Issue-ID: POLICY-1600 Change-Id: If660cbe84424e492b6db3ab11ef97b37f046b3aa Signed-off-by: Henry.Sun --- .../policy/models/tosca/simple/concepts/JpaToscaConstraintLogical.java | 2 +- .../models/tosca/simple/concepts/JpaToscaConstraintValidValues.java | 2 +- .../org/onap/policy/models/tosca/simple/concepts/JpaToscaDataType.java | 2 +- .../onap/policy/models/tosca/simple/concepts/JpaToscaEntityType.java | 2 +- .../onap/policy/models/tosca/simple/concepts/JpaToscaEventFilter.java | 2 +- .../org/onap/policy/models/tosca/simple/concepts/JpaToscaModel.java | 2 +- .../org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicy.java | 2 +- .../onap/policy/models/tosca/simple/concepts/JpaToscaPolicyType.java | 2 +- .../org/onap/policy/models/tosca/simple/concepts/JpaToscaProperty.java | 2 +- .../policy/models/tosca/simple/concepts/JpaToscaServiceTemplate.java | 2 +- .../onap/policy/models/tosca/simple/concepts/JpaToscaTimeInterval.java | 2 +- .../policy/models/tosca/simple/concepts/JpaToscaTopologyTemplate.java | 2 +- .../org/onap/policy/models/tosca/simple/concepts/JpaToscaTrigger.java | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) (limited to 'models-tosca/src') diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintLogical.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintLogical.java index 632f84add..41cd1c274 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintLogical.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintLogical.java @@ -140,7 +140,7 @@ public class JpaToscaConstraintLogical extends JpaToscaConstraint { return 0; } if (getClass() != otherConstraint.getClass()) { - return this.hashCode() - otherConstraint.hashCode(); + return getClass().getName().compareTo(otherConstraint.getClass().getName()); } final JpaToscaConstraintLogical other = (JpaToscaConstraintLogical) otherConstraint; diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintValidValues.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintValidValues.java index 248ca496c..2a121573c 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintValidValues.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintValidValues.java @@ -92,7 +92,7 @@ public class JpaToscaConstraintValidValues extends JpaToscaConstraint { return 0; } if (getClass() != otherConstraint.getClass()) { - return this.hashCode() - otherConstraint.hashCode(); + return getClass().getName().compareTo(otherConstraint.getClass().getName()); } final JpaToscaConstraintValidValues other = (JpaToscaConstraintValidValues) otherConstraint; diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaDataType.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaDataType.java index cf1150af8..7e2b641a2 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaDataType.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaDataType.java @@ -244,7 +244,7 @@ public class JpaToscaDataType extends JpaToscaEntityType implemen return 0; } if (getClass() != otherConcept.getClass()) { - return this.hashCode() - otherConcept.hashCode(); + return getClass().getName().compareTo(otherConcept.getClass().getName()); } final JpaToscaDataType other = (JpaToscaDataType) otherConcept; diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEntityType.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEntityType.java index a39515b49..bade7a227 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEntityType.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEntityType.java @@ -248,7 +248,7 @@ public class JpaToscaEntityType extends PfConcept impleme return 0; } if (getClass() != otherConcept.getClass()) { - return this.hashCode() - otherConcept.hashCode(); + return getClass().getName().compareTo(otherConcept.getClass().getName()); } @SuppressWarnings("unchecked") diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEventFilter.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEventFilter.java index 3907a1b0c..40727c9c0 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEventFilter.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEventFilter.java @@ -161,7 +161,7 @@ public class JpaToscaEventFilter extends PfConcept { return 0; } if (getClass() != otherConcept.getClass()) { - return this.hashCode() - otherConcept.hashCode(); + return getClass().getName().compareTo(otherConcept.getClass().getName()); } final JpaToscaEventFilter other = (JpaToscaEventFilter) otherConcept; diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaModel.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaModel.java index 204ef5b9d..5e4bd4f5c 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaModel.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaModel.java @@ -137,7 +137,7 @@ public class JpaToscaModel extends PfModel { } if (getClass() != otherConcept.getClass()) { - return this.hashCode() - otherConcept.hashCode(); + return getClass().getName().compareTo(otherConcept.getClass().getName()); } final JpaToscaModel other = (JpaToscaModel) otherConcept; diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicy.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicy.java index 30ad2b246..7b4ffd164 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicy.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicy.java @@ -331,7 +331,7 @@ public class JpaToscaPolicy extends JpaToscaEntityType implements P } if (getClass() != otherConcept.getClass()) { - return this.hashCode() - otherConcept.hashCode(); + return getClass().getName().compareTo(otherConcept.getClass().getName()); } final JpaToscaPolicy other = (JpaToscaPolicy) otherConcept; diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyType.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyType.java index a6bc835b4..d7560c46e 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyType.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyType.java @@ -280,7 +280,7 @@ public class JpaToscaPolicyType extends JpaToscaEntityType impl return 0; } if (getClass() != otherConcept.getClass()) { - return this.hashCode() - otherConcept.hashCode(); + return getClass().getName().compareTo(otherConcept.getClass().getName()); } final JpaToscaPolicyType other = (JpaToscaPolicyType) otherConcept; diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaProperty.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaProperty.java index e2b6e6f93..10e8b5d04 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaProperty.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaProperty.java @@ -286,7 +286,7 @@ public class JpaToscaProperty extends PfConcept implements PfAuthorative