diff options
author | Dan Timoney <dt5972@att.com> | 2018-07-25 14:47:48 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-07-25 14:47:48 +0000 |
commit | dcbfe0d9bebc371623518c162a568361e61bc519 (patch) | |
tree | d18679743db7ddfda4a56e4cbbbbc6d40fc87267 /asdcApi | |
parent | 7e6d57e2c6dcf22567b7ef130d2a3c3a6866fe5f (diff) | |
parent | 75a7aa446b04504739cc2249d81116811a136111 (diff) |
Merge "Fix sonar issues"
Diffstat (limited to 'asdcApi')
-rw-r--r-- | asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java b/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java index 0c2ce2fc2..27280d2d3 100644 --- a/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java +++ b/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java @@ -179,14 +179,12 @@ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { InstanceIdentifier artifactInstanceId = InstanceIdentifier.<Artifacts>builder(Artifacts.class) .child(Artifact.class, new ArtifactKey(aName, aVersion)).build(); - ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction(); Optional<Artifact> data = null; - try { + try(ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction()) { data = (Optional<Artifact>) readTx.read(LogicalDatastoreType.CONFIGURATION, artifactInstanceId).get(); } catch (InterruptedException | ExecutionException e) { LOG.error("Caught Exception reading MD-SAL for ["+aName+","+ aVersion+"] " ,e); return false; - } return data.isPresent(); |