summaryrefslogtreecommitdiffstats
path: root/aai-service/provider
diff options
context:
space:
mode:
authorshashikanth <shashikanth.vh@huawei.com>2017-09-14 17:52:04 +0530
committerShashikanth VH <shashikanth.vh@huawei.com>2017-09-18 08:49:07 +0000
commit907bcb0e2f666c1c8cbc301d1e51072c378293e2 (patch)
tree93fa7528b585c65ee5ae7374b3d11eb258077ca7 /aai-service/provider
parent43c6f425177393be30c3f065522c9ad9bc340639 (diff)
Fix Blocker/Critical sonar issues
Fix Blocker/Critical sonar issues in ccsdk/sli/adaptors module https://sonar.onap.org/component_issues?id=org.onap.ccsdk.sli.adaptors%3Accsdk-sli-adaptors#resolved=false|severities=BLOCKER Deleted redundant code. Issue-Id: CCSDK-67 Change-Id: Iccdfc4815b7a28a6e95251c24e7196221f1b25df Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
Diffstat (limited to 'aai-service/provider')
-rw-r--r--aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java33
1 files changed, 4 insertions, 29 deletions
diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java
index bf5adc50..bea26328 100644
--- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java
+++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java
@@ -849,7 +849,6 @@ public class AAIService extends AAIDeclarations implements AAIClient, SvcLogicRe
@Override
public Complex requestNetworkComplexData(String pLocId) throws AAIServiceException {
Complex response = null;
- InputStream inputStream = null;
try {
AAIRequest request = AAIRequest.getRequestFromResource("complex");
@@ -865,14 +864,6 @@ public class AAIService extends AAIDeclarations implements AAIClient, SvcLogicRe
} catch (Exception exc) {
LOG.warn("requestNetworkComplexData", exc);
throw new AAIServiceException(exc);
- } finally {
- if(inputStream != null){
- try {
- inputStream.close();
- } catch(Exception exc) {
-
- }
- }
}
return response;
}
@@ -1070,7 +1061,6 @@ public class AAIService extends AAIDeclarations implements AAIClient, SvcLogicRe
@Override
public DvsSwitch requestDvsSwitchData(String vnf_id) throws AAIServiceException {
DvsSwitch response = null;
- InputStream inputStream = null;
try {
AAIRequest request = AAIRequest.getRequestFromResource("dvs-switch");
@@ -1086,14 +1076,6 @@ public class AAIService extends AAIDeclarations implements AAIClient, SvcLogicRe
} catch (Exception exc) {
LOG.warn("requestDvsSwitchData", exc);
throw new AAIServiceException(exc);
- } finally {
- if(inputStream != null){
- try {
- inputStream.close();
- } catch(Exception exc) {
-
- }
- }
}
return response;
}
@@ -1902,7 +1884,6 @@ public class AAIService extends AAIDeclarations implements AAIClient, SvcLogicRe
@Override
public L3Network requestL3NetworkQueryByName(String networkName) throws AAIServiceException {
L3Network response = null;
- InputStream inputStream = null;
try {
AAIRequest request = AAIRequest.getRequestFromResource("l3-network");
@@ -1919,14 +1900,6 @@ public class AAIService extends AAIDeclarations implements AAIClient, SvcLogicRe
} catch (Exception exc) {
LOG.warn("requestL3NetworkQueryByName", exc);
throw new AAIServiceException(exc);
- } finally {
- if(inputStream != null){
- try {
- inputStream.close();
- } catch(Exception exc) {
-
- }
- }
}
return response;
}
@@ -2167,7 +2140,8 @@ public class AAIService extends AAIDeclarations implements AAIClient, SvcLogicRe
while( ( line = reader.readLine() ) != null ) {
stringBuilder.append( line );
}
- LOGwriteEndingTrace(responseCode, "SUCCESS", (stringBuilder != null) ? stringBuilder.toString() : "{no-data}");
+ LOGwriteEndingTrace(responseCode, "SUCCESS", (stringBuilder.length() > 0) ? stringBuilder.toString() :
+ "{no-data}");
return true;
} else {
ErrorResponse errorresponse = mapper.readValue(reader, ErrorResponse.class);
@@ -2794,7 +2768,8 @@ public class AAIService extends AAIDeclarations implements AAIClient, SvcLogicRe
while( ( line = reader.readLine() ) != null ) {
stringBuilder.append( line );
}
- LOGwriteEndingTrace(responseCode, responseMessage, (stringBuilder != null) ? stringBuilder.toString() : "{no-data}");
+ LOGwriteEndingTrace(responseCode, responseMessage,
+ (stringBuilder.length() > 0) ? stringBuilder.toString() : "{no-data}");
return true;
} else {
StringBuilder stringBuilder = new StringBuilder();