From 23b36e3c69f25d8322afb79d5e6bace519db7cd3 Mon Sep 17 00:00:00 2001 From: "Tait,Trevor(rt0435)" Date: Tue, 30 Oct 2018 13:22:36 -0400 Subject: Address Bugs and Vulnerabilities in Sonar Report Addressing Bugs and Vulnerabilities in Sonar Report. https://sonar.onap.org/dashboard?id=org.onap.logging-analytics.pomba%3Apomba-sdnc-context-builder Issue-ID: LOG-791 Change-Id: I11b984cac77c8a5674103672fa0e1332ed0aa4f7 Signed-off-by: Tait,Trevor(rt0435) --- .../org/onap/pomba/contextbuilder/sdnc/model/VnfVm.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfVm.java') diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfVm.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfVm.java index ab39105..c312ec0 100644 --- a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfVm.java +++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfVm.java @@ -30,14 +30,15 @@ public class VnfVm { private String vmType; @SerializedName("vm-networks") @Expose - private List vmNetworks = new ArrayList(); + private List vmNetworks = new ArrayList<>(); @SerializedName("vm-count") @Expose private Integer vmCount; @SerializedName("vm-names") @Expose - private List vmNames = new ArrayList(); + private List vmNames = new ArrayList<>(); + private final static String NULL_STR = ""; /** * No args constructor for use in serialization @@ -99,19 +100,19 @@ public class VnfVm { sb.append(VnfVm.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); sb.append("vmType"); sb.append('='); - sb.append(((this.vmType == null)?"":this.vmType)); + sb.append(((this.vmType == null)?NULL_STR:this.vmType)); sb.append(','); sb.append("vmNetworks"); sb.append('='); - sb.append(((this.vmNetworks == null)?"":this.vmNetworks)); + sb.append(((this.vmNetworks == null)?NULL_STR:this.vmNetworks)); sb.append(','); sb.append("vmCount"); sb.append('='); - sb.append(((this.vmCount == null)?"":this.vmCount)); + sb.append(((this.vmCount == null)?NULL_STR:this.vmCount)); sb.append(','); sb.append("vmNames"); sb.append('='); - sb.append(((this.vmNames == null)?"":this.vmNames)); + sb.append(((this.vmNames == null)?NULL_STR:this.vmNames)); sb.append(','); if (sb.charAt((sb.length()- 1)) == ',') { sb.setCharAt((sb.length()- 1), ']'); @@ -136,7 +137,7 @@ public class VnfVm { if (other == this) { return true; } - if ((other instanceof VnfVm) == false) { + if (!(other instanceof VnfVm)) { return false; } VnfVm rhs = ((VnfVm) other); -- cgit 1.2.3-korg