sonar critical throw a dedicated exception 75/29475/1
authorSnigdha Sucharita Patra <sp00503415@techmahindra.com>
Mon, 29 Jan 2018 09:03:42 +0000 (14:33 +0530)
committerSnigdha Sucharita Patra <sp00503415@techmahindra.com>
Mon, 29 Jan 2018 09:04:29 +0000 (14:34 +0530)
Define and throw a dedicated exception instead of using a generic one
Sonar Link:
https://sonar.onap.org/component_issues?id=org.onap.dcaegen2.platform%3Ainventory-api#resolved=false|severities=CRITICAL|assignees=Snigdha503415
Location:
src/main/java/org/onap/dcae/inventory/daos/InventoryDAOManager.java
Line No-143

Change-Id: I52ecbd360bff6efa8906623ae7345ef694491d6b
Issue-ID: DCAEGEN2-215
Signed-off-by: Snigdha Sucharita Patra <sp00503415@techmahindra.com>
src/main/java/org/onap/dcae/inventory/daos/InventoryDAOManager.java

index 717d8c9..c2527e2 100644 (file)
@@ -140,7 +140,7 @@ public final class InventoryDAOManager {
 
     private InventoryDAO getDAO(Class<? extends InventoryDAO> klass) {
         if (jdbi == null) {
-            throw new RuntimeException("InventoryDAOManager has not been initialized!");
+            throw new InventoryDAOManagerSetupException("InventoryDAOManager has not been initialized!");
         }
 
         // Using this approach to constructing the DAO, the client is not responsible for closing the handle.