diff options
author | Lukasz Muszkieta <lukasz.muszkieta@nokia.com> | 2019-10-14 14:41:58 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-10-14 14:41:58 +0000 |
commit | ac035d57c099f12aed66b9baeab7035934fc1f47 (patch) | |
tree | 92fa32940b62dbb903ea0f55d5d773e7e14d249d | |
parent | 30247c5de4bba80962cd96196e7ecd21d96f7d6e (diff) | |
parent | 719e468042aa84b17624c7daf7f29b1684768b64 (diff) |
Merge "Added throw statement for created exception object to prevent static analyzer warning about exception ending up never thrown; removed redundant initializer for serviceFromDB variable"
-rw-r--r-- | adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/ServiceRestImpl.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/ServiceRestImpl.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/ServiceRestImpl.java index bc4d0064d0..9663033c20 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/ServiceRestImpl.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/ServiceRestImpl.java @@ -63,7 +63,7 @@ public class ServiceRestImpl { public Service findService(@PathParam("modelUUID") String modelUUID, @QueryParam("depth") int depth) { org.onap.so.db.catalog.beans.Service service = serviceRepo.findOneByModelUUID(modelUUID); if (service == null) { - new CatalogEntityNotFoundException("Unable to find Service " + modelUUID); + throw new CatalogEntityNotFoundException("Unable to find Service " + modelUUID); } return serviceMapper.mapService(service, depth); } @@ -79,7 +79,7 @@ public class ServiceRestImpl { required = false) @QueryParam("distributionStatus") String distributionStatus, @Parameter(description = "depth", required = false) @QueryParam("depth") int depth) { List<Service> services = new ArrayList<>(); - List<org.onap.so.db.catalog.beans.Service> serviceFromDB = new ArrayList<>(); + List<org.onap.so.db.catalog.beans.Service> serviceFromDB; if (!Strings.isNullOrEmpty(modelName) && !Strings.isNullOrEmpty(distributionStatus)) { serviceFromDB = serviceRepo.findByModelNameAndDistrobutionStatus(modelName, distributionStatus); } else if (!Strings.isNullOrEmpty(modelName)) { |