diff options
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;
}
|