diff options
author | Arindam Mondal <arind.mondal@samsung.com> | 2018-07-30 19:02:59 +0900 |
---|---|---|
committer | ONAP <arind.mondal@samsung.com> | 2018-07-30 19:04:56 +0900 |
commit | ec0a5672d39fc3caed1292abe1c4e1c2f814d2e5 (patch) | |
tree | 8f0ba137fbb5e9204035be45f84b919e30066fa2 /holmes-actions/src | |
parent | ca7eb991c910002e2c798d29e52a812caed7729c (diff) |
Fix sonar issues holmes-common
Issue-ID: HOLMES-153
Change-Id: Ib90db2040b472e601a622550e69008e0cc9cc6ef
Signed-off-by: Arindam Mondal <arind.mondal@samsung.com>
Diffstat (limited to 'holmes-actions/src')
3 files changed, 6 insertions, 6 deletions
diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/aai/AaiQuery.java b/holmes-actions/src/main/java/org/onap/holmes/common/aai/AaiQuery.java index a13c627..f20462f 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/aai/AaiQuery.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/aai/AaiQuery.java @@ -72,7 +72,7 @@ public class AaiQuery { private String getVmResourceLinks(String vserverId, String vserverName) throws CorrelationException { String response = getResourceLinksResponse(vserverId, vserverName); List linkList = aaiResponseUtil.convertJsonToVmResourceLink(response); - if (linkList.size() != 0) { + if (!linkList.isEmpty()) { return aaiResponseUtil.convertJsonToVmResourceLink(response).get(0).getResourceLink(); } return ""; @@ -134,7 +134,7 @@ public class AaiQuery { addrSplits[1] = addrSplits[0] + "-" + addrSplits[2]; addrSplits[2] = ret; addrSplits[0] = "api"; - StringBuffer stringBuffer = new StringBuffer(); + StringBuilder stringBuffer = new StringBuilder(); for (String split : addrSplits) { stringBuffer.append("/" + split); } diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/aai/entity/RelationshipList.java b/holmes-actions/src/main/java/org/onap/holmes/common/aai/entity/RelationshipList.java index 533760c..faf5297 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/aai/entity/RelationshipList.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/aai/entity/RelationshipList.java @@ -28,7 +28,7 @@ public class RelationshipList { public Relationship getRelationship(String relatedTo) { Relationship relationship = null; - if(null == relationships || relationships.size() == 0) + if(null == relationships || relationships.isEmpty()) return relationship; for(int i = 0; i < relationships.size(); i++) { if (relatedTo.equals(relationships.get(i).getRelatedTo())) { @@ -49,7 +49,7 @@ public class RelationshipList { public String getRelatedToPropertyValue(String key) { String value = ""; - if (null == relatedToPropertyList || relatedToPropertyList.size() == 0) { + if (null == relatedToPropertyList || relatedToPropertyList.isEmpty()) { return ""; } for(int i = 0; i < relatedToPropertyList.size(); i++) { @@ -63,7 +63,7 @@ public class RelationshipList { public String getRelationshipDataValue(String key) { String value = ""; - if (null == relationshipDataList || relationshipDataList.size() == 0) { + if (null == relationshipDataList || relationshipDataList.isEmpty()) { return ""; } for(int i = 0; i < relationshipDataList.size(); i++) { diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/dcae/utils/DcaeConfigurationParser.java b/holmes-actions/src/main/java/org/onap/holmes/common/dcae/utils/DcaeConfigurationParser.java index 092e478..2c878b0 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/dcae/utils/DcaeConfigurationParser.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/dcae/utils/DcaeConfigurationParser.java @@ -57,7 +57,7 @@ public class DcaeConfigurationParser { JSONObject finalJsonObject = jsonObject;
Stream.of(jsonObject.keySet().toArray(new String[0]))
.filter(key -> !OBJECT_ATTRS.contains(key))
- .forEach(key -> ret.put(key.toString(), finalJsonObject.getString(String.valueOf(key))));
+ .forEach(key -> ret.put(key, finalJsonObject.getString(String.valueOf(key))));
return ret;
}
|