aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorSébastien Determe <sd378r@intl.att.com>2018-07-05 08:10:59 +0000
committerGerrit Code Review <gerrit@onap.org>2018-07-05 08:10:59 +0000
commitc8082fed56fb0c4dc5ffe600972be5bf4d0bc75b (patch)
treebedf5f5de23258898d11e8c942ea665262d45675 /src/main/java
parentdc8a0a11cb008a3858b828701f33515b1f7e0644 (diff)
parent0cfec3c5d53ed995e66f135ccd584d7ab0950258 (diff)
Merge "Fix weakness causing NPE"
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/onap/clamp/clds/client/req/sdc/SdcCatalogServices.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/org/onap/clamp/clds/client/req/sdc/SdcCatalogServices.java b/src/main/java/org/onap/clamp/clds/client/req/sdc/SdcCatalogServices.java
index 9c9402100..240094e61 100644
--- a/src/main/java/org/onap/clamp/clds/client/req/sdc/SdcCatalogServices.java
+++ b/src/main/java/org/onap/clamp/clds/client/req/sdc/SdcCatalogServices.java
@@ -17,6 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END============================================
+ * Modifications copyright (c) 2018 Nokia
* ===================================================================
*
*/
@@ -227,13 +228,12 @@ public class SdcCatalogServices {
*/
public List<SdcResourceBasicInfo> removeDuplicateSdcResourceBasicInfo(
List<SdcResourceBasicInfo> rawCldsSdcResourceListBasicList) {
- List<SdcResourceBasicInfo> cldsSdcResourceBasicInfoList = null;
+ List<SdcResourceBasicInfo> cldsSdcResourceBasicInfoList = new ArrayList<>();
if (rawCldsSdcResourceListBasicList != null && !rawCldsSdcResourceListBasicList.isEmpty()) {
// sort list
Collections.sort(rawCldsSdcResourceListBasicList);
// and then take only the resources with the max version (last in
// the list with the same name)
- cldsSdcResourceBasicInfoList = new ArrayList<>();
for (int i = 1; i < rawCldsSdcResourceListBasicList.size(); i++) {
// compare name with previous - if not equal, then keep the
// previous (it's the last with that name)