summaryrefslogtreecommitdiffstats
path: root/resource-assignment/provider
diff options
context:
space:
mode:
authorezhil <ezhrajam@in.ibm.com>2018-12-26 16:14:22 +0530
committerezhil <ezhrajam@in.ibm.com>2018-12-26 16:14:35 +0530
commit1fa73ab04d70420b6375c1919855a1efab157e57 (patch)
tree21b7f9e2a17a504a7fb4aea7707e164f8569ac99 /resource-assignment/provider
parent5df4fb30eaf3bbbd6ac5802a8f75fcf8c19d4e6f (diff)
Fixed sonar issues in AllocationFunction.java
Fixed bug and major issues Issue-ID: CCSDK-875 Change-Id: I425a25eab33bc3203fcd30fa2abe4216a6bd4bc8 Signed-off-by: ezhil <ezhrajam@in.ibm.com>
Diffstat (limited to 'resource-assignment/provider')
-rw-r--r--resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/comp/AllocationFunction.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/comp/AllocationFunction.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/comp/AllocationFunction.java
index 70092db36..0f5335443 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/comp/AllocationFunction.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/comp/AllocationFunction.java
@@ -5,6 +5,8 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -105,7 +107,8 @@ class AllocationFunction extends SynchronizedFunction {
@Override
public void _exec() throws ResourceLockedException {
outcome = allocate(request);
- if (outcome.status == AllocationStatus.Success) {
+
+ if ((outcome!=null) && (outcome.status == AllocationStatus.Success)) {
for (Resource r : updateList) {
resourceDao.saveResource(r);
}
@@ -132,7 +135,7 @@ class AllocationFunction extends SynchronizedFunction {
}
private MultiAssetAllocationOutcome allocateMultiAsset(MultiAssetAllocationRequest req) {
- // TODO Auto-generated method stub
+
return null;
}
@@ -252,7 +255,7 @@ class AllocationFunction extends SynchronizedFunction {
out.status = AllocationStatus.Success;
foundNumbers = req.requestedNumbers;
} else {
- if (req.requestedNumbers != null && req.requestedNumbers.size() > 0) {
+ if (req.requestedNumbers != null && !req.requestedNumbers.isEmpty()) {
foundNumbers = req.requestedNumbers;
out.status = AllocationStatus.Success;
for (int n : foundNumbers) {
iteral.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
dependencies:
  - name: common
    version: ~2.0.0
    repository: '@local'