diff options
author | Ramu N <ramu.n@huawei.com> | 2017-09-07 15:09:16 +0530 |
---|---|---|
committer | Ramu N <ramu.n@huawei.com> | 2017-09-07 15:19:59 +0530 |
commit | 063858dc827a1684b6451fcad5ec897eab2db772 (patch) | |
tree | 6e101b1ebc9a1af4a1338c65766672917af5c462 | |
parent | c3342a09a1bec20195a9617ad5b31f5bd9ac7e00 (diff) |
Fix Blocker/Critical sonar issues
Fix Blocker/Critical sonar issues in vnfapi module
https://sonar.onap.org/component_issues?id=org.openecomp.sdnc.northbound%3Asdnc-northbound#resolved=false|severities=BLOCKER%2CCRITICAL
Issue-Id: SDNC-65
Change-Id: Ie5617b7f40ed1d05eb9657a9686fef4b4c9bec35
Signed-off-by: Ramu N <ramu.n@huawei.com>
-rw-r--r-- | vnfapi/provider/src/main/java/org/onap/sdnc/vnfapi/VnfSdnUtil.java | 6 | ||||
-rw-r--r-- | vnfapi/provider/src/main/java/org/onap/sdnc/vnfapi/vnfapiProvider.java | 19 |
2 files changed, 12 insertions, 13 deletions
diff --git a/vnfapi/provider/src/main/java/org/onap/sdnc/vnfapi/VnfSdnUtil.java b/vnfapi/provider/src/main/java/org/onap/sdnc/vnfapi/VnfSdnUtil.java index 69f59222..a206a8bc 100644 --- a/vnfapi/provider/src/main/java/org/onap/sdnc/vnfapi/VnfSdnUtil.java +++ b/vnfapi/provider/src/main/java/org/onap/sdnc/vnfapi/VnfSdnUtil.java @@ -8,9 +8,9 @@ * 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 - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -35,7 +35,7 @@ public class VnfSdnUtil extends MdsalHelper { private static final Logger LOG = LoggerFactory.getLogger(VnfSdnUtil.class); - public static File ODLHOME = null; + private static File ODLHOME = null; private static Properties properties; diff --git a/vnfapi/provider/src/main/java/org/onap/sdnc/vnfapi/vnfapiProvider.java b/vnfapi/provider/src/main/java/org/onap/sdnc/vnfapi/vnfapiProvider.java index a86def15..83fb2609 100644 --- a/vnfapi/provider/src/main/java/org/onap/sdnc/vnfapi/vnfapiProvider.java +++ b/vnfapi/provider/src/main/java/org/onap/sdnc/vnfapi/vnfapiProvider.java @@ -8,9 +8,9 @@ * 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 - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -189,7 +189,7 @@ public class vnfapiProvider implements AutoCloseable, VNFAPIService, DataChangeL try { VnfSdnUtil.loadProperties(); } catch (Exception e) { - log.error("Caught Exception while trying to load properties file"); + log.error("Caught Exception while trying to load properties file: ", e); } rpcRegistration = rpcRegistry.addRpcImplementation(VNFAPIService.class, this); @@ -242,7 +242,6 @@ public class vnfapiProvider implements AutoCloseable, VNFAPIService, DataChangeL } catch (InterruptedException | ExecutionException e) { log.error("Create Containers Failed: " + e); - e.printStackTrace(); } } @@ -559,7 +558,7 @@ public class vnfapiProvider implements AutoCloseable, VNFAPIService, DataChangeL log.error("Caught Exception reading MD-SAL ("+type+") for ["+siid+"] " ,e); } - if ( data.isPresent()) { + if (data != null && data.isPresent()) { ServiceData serviceData = (ServiceData) data.get().getServiceData(); if (serviceData != null) { log.info("Read MD-SAL ("+type+") data for ["+siid+"] ServiceData: " + serviceData); @@ -599,7 +598,7 @@ public class vnfapiProvider implements AutoCloseable, VNFAPIService, DataChangeL log.error("Caught Exception reading MD-SAL ("+type+") for ["+siid+"] " ,e); } - if ( data.isPresent()) { + if (data != null && data.isPresent()) { VnfInstanceServiceData vnfInstanceServiceData = (VnfInstanceServiceData) data.get().getVnfInstanceServiceData(); if (vnfInstanceServiceData != null) { log.info("Read MD-SAL ("+type+") data for ["+siid+"] VnfInstanceServiceData: " + vnfInstanceServiceData); @@ -639,7 +638,7 @@ public class vnfapiProvider implements AutoCloseable, VNFAPIService, DataChangeL log.error("Caught Exception reading MD-SAL ("+type+") for ["+siid+"] " ,e); } - if ( data.isPresent()) { + if (data != null && data.isPresent()) { VfModuleServiceData vfModuleServiceData = (VfModuleServiceData) data.get().getVfModuleServiceData(); if (vfModuleServiceData != null) { log.info("Read MD-SAL ("+type+") data for ["+siid+"] VfModuleServiceData: " + vfModuleServiceData); @@ -679,7 +678,7 @@ public class vnfapiProvider implements AutoCloseable, VNFAPIService, DataChangeL log.error("Caught Exception reading MD-SAL ("+type+") for ["+preload_name+","+preload_type+"] " ,e); } - if ( data.isPresent()) { + if (data != null && data.isPresent()) { PreloadData preloadData = (PreloadData) data.get().getPreloadData(); if (preloadData != null) { log.info("Read MD-SAL ("+type+") data for ["+preload_name+","+preload_type+"] PreloadData: " + preloadData); @@ -716,7 +715,7 @@ public class vnfapiProvider implements AutoCloseable, VNFAPIService, DataChangeL log.error("Caught Exception reading MD-SAL ("+type+") for ["+preload_name+","+preload_type+"] " ,e); } - if ( data.isPresent()) { + if (data != null && data.isPresent()) { VnfInstancePreloadData preloadData = (VnfInstancePreloadData) data.get().getVnfInstancePreloadData(); if (preloadData != null) { log.info("Read MD-SAL ("+type+") data for ["+preload_name+","+preload_type+"] VnfInstancePreloadData: " + preloadData); @@ -751,7 +750,7 @@ public class vnfapiProvider implements AutoCloseable, VNFAPIService, DataChangeL log.error("Caught Exception reading MD-SAL ("+type+") for ["+preload_name+","+preload_type+"] " ,e); } - if ( data.isPresent()) { + if (data != null && data.isPresent()) { VfModulePreloadData preloadData = (VfModulePreloadData) data.get().getVfModulePreloadData(); if (preloadData != null) { log.info("Read MD-SAL ("+type+") data for ["+preload_name+","+preload_type+"] VfModulePreloadData: " + preloadData); |