From 27e5313f1da1197e28d6507b5fc20edb55c72f26 Mon Sep 17 00:00:00 2001 From: Sandeep J Date: Thu, 23 Aug 2018 04:12:20 +0530 Subject: fixed sonar issues in MsoNetworkAdapterAsyncImpl removed useless assignment of local variable "sMap" at lines 646,664,684. And, also removed keyset with entryset at line 650 Issue-ID: SO-882 Change-Id: I31a1a0c2c7aa4d65466125bda6948765326994eb Signed-off-by: Sandeep J --- .../so/adapters/network/MsoNetworkAdapterAsyncImpl.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'adapters/mso-openstack-adapters') diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java index b483d40b8a..83db2add0a 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java @@ -5,6 +5,8 @@ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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 @@ -643,13 +645,14 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { CreateNetworkNotification.SubnetIdMap subnetIdMap = new CreateNetworkNotification.SubnetIdMap (); if (hMap != null && hMap.value != null) { - Map sMap = new HashMap <> (); - sMap = hMap.value; + Map sMap = hMap.value; CreateNetworkNotification.SubnetIdMap.Entry entry = new CreateNetworkNotification.SubnetIdMap.Entry (); - for (String key : sMap.keySet ()) { + for (Map.Entry mapEntry : sMap.entrySet ()) { + String key = mapEntry.getKey(); + String value = mapEntry.getValue(); entry.setKey (key); - entry.setValue (sMap.get (key)); + entry.setValue (value); subnetIdMap.getEntry ().add (entry); } } @@ -661,8 +664,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { UpdateNetworkNotification.SubnetIdMap subnetIdMap = new UpdateNetworkNotification.SubnetIdMap (); if (hMap != null && hMap.value != null) { - Map sMap = new HashMap <> (); - sMap = hMap.value; + Map sMap = hMap.value; UpdateNetworkNotification.SubnetIdMap.Entry entry = new UpdateNetworkNotification.SubnetIdMap.Entry (); for (Map.Entry mapEntry : sMap.entrySet ()) { @@ -681,8 +683,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { QueryNetworkNotification.SubnetIdMap subnetIdMap = new QueryNetworkNotification.SubnetIdMap (); if (hMap != null && hMap.value != null) { - Map sMap = new HashMap <> (); - sMap = hMap.value; + Map sMap = hMap.value; QueryNetworkNotification.SubnetIdMap.Entry entry = new QueryNetworkNotification.SubnetIdMap.Entry (); for (Map.Entry mapEntry : sMap.entrySet ()) { -- cgit 1.2.3-korg