diff options
author | Seshu Kumar M <seshu.kumar.m@huawei.com> | 2019-08-08 11:34:36 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-08-08 11:34:36 +0000 |
commit | 5ececa1257c70420d398a903db267e14b14b3a6a (patch) | |
tree | 869a0e806ced0830bd1fda9c11500e5f21e09bb2 | |
parent | 7eb95648f98d7cfc551a0db144a8cfc5d447ee25 (diff) | |
parent | 0e7aae7f2480cb9c5e438949aa033139b861f22d (diff) |
Merge "Replace collections.size with isEmpty for better performance"
3 files changed, 7 insertions, 7 deletions
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java b/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java index 325ba913f8..e048d4c567 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java @@ -92,7 +92,7 @@ public class DeployActivitySpecs { private void mapCategoryList(List<ActivitySpecActivitySpecCategories> activitySpecActivitySpecCategories, ActivitySpec activitySpec) { - if (activitySpecActivitySpecCategories == null || activitySpecActivitySpecCategories.size() == 0) { + if (activitySpecActivitySpecCategories == null || activitySpecActivitySpecCategories.isEmpty()) { return; } List<String> categoryList = new ArrayList<>(); @@ -108,7 +108,7 @@ public class DeployActivitySpecs { private void mapInputsAndOutputs(List<ActivitySpecActivitySpecParameters> activitySpecActivitySpecParameters, ActivitySpec activitySpec) { - if (activitySpecActivitySpecParameters == null || activitySpecActivitySpecParameters.size() == 0) { + if (activitySpecActivitySpecParameters == null || activitySpecActivitySpecParameters.isEmpty()) { return; } List<Input> inputs = new ArrayList<>(); diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/WorkflowResource.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/WorkflowResource.java index 46c440db0d..a68d98e0b0 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/WorkflowResource.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/WorkflowResource.java @@ -140,7 +140,7 @@ public class WorkflowResource { VnfResourceWorkflow vnfResourceWorkflow = new VnfResourceWorkflow(); vnfResourceWorkflow.setVnfResourceModelUUID(vfResourceModelUuid); vnfResourceWorkflow.setWorkflow(workflow); - List<VnfResourceWorkflow> vnfResourceWorkflows = new ArrayList<VnfResourceWorkflow>(); + List<VnfResourceWorkflow> vnfResourceWorkflows = new ArrayList<>(); vnfResourceWorkflows.add(vnfResourceWorkflow); workflow.setVnfResourceWorkflow(vnfResourceWorkflows); @@ -174,7 +174,7 @@ public class WorkflowResource { } protected List<String> getActivityNameList(String bpmnContent) { - List<String> activityNameList = new ArrayList<String>(); + List<String> activityNameList = new ArrayList<>(); Pattern p = Pattern.compile(pattern); Matcher m = p.matcher(bpmnContent); @@ -186,10 +186,10 @@ public class WorkflowResource { protected List<WorkflowActivitySpecSequence> getWorkflowActivitySpecSequence(List<String> activityNames, Workflow workflow) throws Exception { - if (activityNames == null || activityNames.size() == 0) { + if (activityNames == null || activityNames.isEmpty()) { return null; } - List<WorkflowActivitySpecSequence> workflowActivitySpecs = new ArrayList<WorkflowActivitySpecSequence>(); + List<WorkflowActivitySpecSequence> workflowActivitySpecs = new ArrayList<>(); int seqNo = 1; for (String activityName : activityNames) { ActivitySpec activitySpec = activityRepo.findByName(activityName); diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java index ef1e5128de..276b8183a8 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java @@ -1117,7 +1117,7 @@ public class ToscaResourceInstaller { } } - if (tempGroupList.size() != 0 && tempGroupList.size() < groupList.size()) { + if (!tempGroupList.isEmpty() && tempGroupList.size() < groupList.size()) { getVNFCGroupSequenceList(strSequence, tempGroupList, nodes, iSdcCsarHelper); } } |