summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2017-09-08 14:05:15 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-08 14:05:15 +0000
commit0d864caf405da4167258601907c52edff265e5bf (patch)
tree082dafd715c63cee3bf8449e8894b88781775357
parentf28ba9bec18a636a9d5ecb38851f8af973e91f63 (diff)
parentaa5441ed5a583c3b0c9e487108cd691310c1e78a (diff)
Merge "Fix Sonar issues within SliPluginUtils module"
-rw-r--r--sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/SliPluginUtils.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/SliPluginUtils.java b/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/SliPluginUtils.java
index e6811e789..488dc395b 100644
--- a/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/SliPluginUtils.java
+++ b/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/SliPluginUtils.java
@@ -26,6 +26,7 @@ import java.io.FileOutputStream;
import java.io.PrintStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
@@ -489,6 +490,7 @@ public class SliPluginUtils implements SvcLogicJavaPlugin {
switch( logLevel ) {
case TRACE:
log.trace(log_message);
+ break;
case DEBUG:
log.debug(log_message);
break;
@@ -648,6 +650,38 @@ public class SliPluginUtils implements SvcLogicJavaPlugin {
return 0;
}
+
+ public boolean equals(Object object) {
+ if (this == object) {
+ return true;
+ }
+ if (!(object instanceof SortableCtxListElement)) {
+ return false;
+ }
+ if (!super.equals(object)) {
+ return false;
+ }
+
+ SortableCtxListElement that = (SortableCtxListElement) object;
+
+ if (child_elements != null ? !child_elements.equals(that.child_elements)
+ : that.child_elements != null) {
+ return false;
+ }
+ // Probably incorrect - comparing Object[] arrays with Arrays.equals
+ if (!Arrays.equals(sort_fields, that.sort_fields)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public int hashCode() {
+ int result = super.hashCode();
+ result = 31 * result + (child_elements != null ? child_elements.hashCode() : 0);
+ result = 31 * result + Arrays.hashCode(sort_fields);
+ return result;
+ }
}
/**