diff options
Diffstat (limited to 'model/engine-model/src/main')
-rw-r--r-- | model/engine-model/src/main/java/org/onap/policy/apex/model/enginemodel/concepts/AxEngineStats.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/model/engine-model/src/main/java/org/onap/policy/apex/model/enginemodel/concepts/AxEngineStats.java b/model/engine-model/src/main/java/org/onap/policy/apex/model/enginemodel/concepts/AxEngineStats.java index b7593e751..b35492356 100644 --- a/model/engine-model/src/main/java/org/onap/policy/apex/model/enginemodel/concepts/AxEngineStats.java +++ b/model/engine-model/src/main/java/org/onap/policy/apex/model/enginemodel/concepts/AxEngineStats.java @@ -530,16 +530,14 @@ public class AxEngineStats extends AxConcept { if (lastExecutionTime != other.lastExecutionTime) { return (int) (lastExecutionTime - other.lastExecutionTime); } - if (averageExecutionTime != other.averageExecutionTime) { - return (int) (averageExecutionTime - other.averageExecutionTime); + final int result = Double.compare(averageExecutionTime, other.averageExecutionTime); + if (result != 0) { + return result; } if (upTime != other.upTime) { return (int) (upTime - other.upTime); } - if (getLastStart() != other.getLastStart()) { - return (int) (getLastStart() - other.getLastStart()); - } - return 0; + return Long.compare(lastStart, other.lastStart); } } |