X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=models-tosca%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fmodels%2Ftosca%2Fsimple%2Fconcepts%2FJpaToscaTrigger.java;h=10a9d2f66d834fe8c01e672d032b7f661bfbe01f;hb=4c4946e339942863e73e20726dd95aaacfcfb5a6;hp=417e83fe0200e5b6f8e5f297e1aa81666ce3c040;hpb=ab145590ffdf99b9f4e132e5f20241099d6c5cbe;p=policy%2Fmodels.git diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTrigger.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTrigger.java index 417e83fe0..10a9d2f66 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTrigger.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTrigger.java @@ -3,7 +3,7 @@ * ONAP Policy Model * ================================================================================ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -137,7 +137,7 @@ public class JpaToscaTrigger extends PfConcept { this.eventType = copyConcept.eventType; this.schedule = (copyConcept.schedule != null ? new JpaToscaTimeInterval(copyConcept.schedule) : null); this.targetFilter = - (copyConcept.targetFilter != null ? new JpaToscaEventFilter(copyConcept.targetFilter) : null); + (copyConcept.targetFilter != null ? new JpaToscaEventFilter(copyConcept.targetFilter) : null); this.condition = copyConcept.condition; this.constraint = copyConcept.constraint; this.period = copyConcept.period; @@ -245,16 +245,16 @@ public class JpaToscaTrigger extends PfConcept { } final JpaToscaTrigger other = (JpaToscaTrigger) otherConcept; - if (!key.equals(other.key)) { - return key.compareTo(other.key); + int result = key.compareTo(other.key); + if (result != 0) { + return result; } return compareFields(other); } /** - * Compare the fields of this ToscaTrigger object with the fields of the other ToscaProperty - * object. + * Compare the fields of this ToscaTrigger object with the fields of the other ToscaProperty object. * * @param other the other ToscaTrigger object */