aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2018-12-28 02:48:23 +0000
committerGerrit Code Review <gerrit@onap.org>2018-12-28 02:48:23 +0000
commite6eb5bfb02077473d20061bd16faf6c1a6fa4af4 (patch)
treeae5f7cddd75b2f850527aa238bae9f87addce61d
parent758b84fceb1c23ded8b8392dccb7b40fbbb7bafd (diff)
parent1fa73ab04d70420b6375c1919855a1efab157e57 (diff)
Merge "Fixed sonar issues in AllocationFunction.java"
-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 70092db3..0f533544 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) {