aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsurya-huawei <a.u.surya@huawei.com>2017-09-25 17:31:57 +0530
committersurya-huawei <a.u.surya@huawei.com>2017-09-25 17:40:34 +0530
commite5a46e5667e52c8bd8ceb4f322ff4d300223267c (patch)
treef34363a77176c6ad2ef3a1bb00f465c3e516d503
parentbbf1668256784af8268de8ce2b0b84e42c0e18d4 (diff)
Fix some sonar issues in sli/northbound
*Replace type specification with diamond operator This is done to reduce the verbosity of generics code *Replace ("") with ('') in String.lastIndexOf() This is more efficient for single character *Remove temp variable which is immediately returned New variable is not necessary as the caller cannot see this Issue-Id: CCSDK-87 Change-Id: I353652de723a624935d819b2bc817b4907af98ed Signed-off-by: surya-huawei <a.u.surya@huawei.com>
-rw-r--r--ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java
index 0664e828..5d83c5d1 100644
--- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java
+++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java
@@ -332,7 +332,7 @@ public class SdncUebCallback implements INotificationCallback {
deployList = new LinkedList[numPasses];
for (int i = 0 ; i < numPasses ; i++) {
- deployList[i] = new LinkedList<DeployableArtifact>();
+ deployList[i] = new LinkedList<>();
}
for (int pass = 0 ; pass < config.getMaxPasses() ; pass++) {
@@ -450,7 +450,7 @@ public class SdncUebCallback implements INotificationCallback {
}
- if (toscaYamlType == true) {
+ if (toscaYamlType) {
processToscaYaml (data, svcName, resourceName, artifact, spoolFile, archiveDir);
try {
@@ -547,7 +547,8 @@ public class SdncUebCallback implements INotificationCallback {
// Ingest Service Data - 1707
Metadata serviceMetadata = sdcCsarHelper.getServiceMetadata();
SdncServiceModel serviceModel = new SdncServiceModel(sdcCsarHelper, serviceMetadata);
- serviceModel.setFilename(spoolFile.toString().substring(spoolFile.toString().lastIndexOf("/")+1)); // will be csar file name
+ serviceModel.setFilename(spoolFile.toString().substring(spoolFile
+ .toString().lastIndexOf('/')+1)); // will be csar file name
serviceModel.setServiceInstanceNamePrefix(SdncBaseModel.extractSubstitutionMappingTypeName(sdcCsarHelper).substring(SdncBaseModel.extractSubstitutionMappingTypeName(sdcCsarHelper).lastIndexOf(".")+1));
try {
@@ -678,7 +679,7 @@ public class SdncUebCallback implements INotificationCallback {
}
// Insert VFC_TO_NETWORK_ROLE_MAPPING data
- Map<String, String> mappingParams = new HashMap<String, String>();
+ Map<String, String> mappingParams = new HashMap<>();
//String cpNetworkRoleTag = "\"" + sdcCsarHelper.getNodeTemplatePropertyLeafValue(cpNode, SdcPropertyNames.PROPERTY_NAME_NETWORKROLETAG) + "\"";
// extract network_role, network_role_tag and virtual_binding from this cpNode
SdncBaseModel.addParameter("network_role", SdncBaseModel.extractValue(sdcCsarHelper, cpNode, "network_role"), mappingParams);
@@ -963,8 +964,7 @@ public class SdncUebCallback implements INotificationCallback {
@Override
public long getTimestamp() {
- long currentTimeMillis = System.currentTimeMillis();
- return currentTimeMillis;
+ return System.currentTimeMillis();
}
@Override