Remove useless exception 33/45633/1
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>
Wed, 2 May 2018 11:03:53 +0000 (13:03 +0200)
committerDeterme, Sebastien (sd378r) <sd378r@intl.att.com>
Wed, 2 May 2018 11:03:53 +0000 (13:03 +0200)
Remove useless exception in code + re-align comments

Issue-ID: CLAMP-147
Change-Id: I2ebced0ac87ff0a9ce5c3b8681a8965b6d8115a5
Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java

index 289f31b..6bab230 100644 (file)
@@ -122,7 +122,7 @@ public class DcaeInventoryServices {
     }\r
 \r
     private void analyzeAndSaveDcaeResponse(DcaeInventoryResponse dcaeResponse, CldsModel cldsModel,\r
-            DcaeEvent dcaeEvent, String userId) throws ParseException {\r
+            DcaeEvent dcaeEvent, String userId) {\r
         if (dcaeResponse != null) {\r
             logger.info("Dcae Response for query on inventory: " + dcaeResponse);\r
             String oldTypeId = cldsModel.getTypeId();\r
@@ -169,8 +169,7 @@ public class DcaeInventoryServices {
         String fullUrl = refProp.getStringValue(DCAE_INVENTORY_URL) + "/dcae-service-types" + queryString;\r
         logger.info("Dcae Inventory Service full url - " + fullUrl);\r
         String dcaeInventoryResponse = null;\r
-\r
-        String responseStr = queryDCAEInventory (fullUrl);\r
+        String responseStr = queryDCAEInventory(fullUrl);\r
         JSONParser parser = new JSONParser();\r
         Object obj0 = parser.parse(responseStr);\r
         JSONObject jsonObj = (JSONObject) obj0;\r
@@ -188,16 +187,15 @@ public class DcaeInventoryServices {
         return JacksonUtils.getObjectMapperInstance().readValue(dcaeInventoryResponse, DcaeInventoryResponse.class);\r
     }\r
 \r
-    private String queryDCAEInventory (String fullUrl) throws IOException, InterruptedException {\r
+    private String queryDCAEInventory(String fullUrl) throws IOException, InterruptedException {\r
         int retryInterval = 0;\r
         int retryLimit = 1;\r
         if (refProp.getStringValue(DCAE_INVENTORY_RETRY_LIMIT) != null) {\r
             retryLimit = Integer.valueOf(refProp.getStringValue(DCAE_INVENTORY_RETRY_LIMIT));\r
         }\r
         if (refProp.getStringValue(DCAE_INVENTORY_RETRY_INTERVAL) != null) {\r
-               retryInterval = Integer.valueOf(refProp.getStringValue(DCAE_INVENTORY_RETRY_INTERVAL));\r
+            retryInterval = Integer.valueOf(refProp.getStringValue(DCAE_INVENTORY_RETRY_INTERVAL));\r
         }\r
-\r
         int i = 0;\r
         while (i < retryLimit) {\r
             i++;\r
@@ -205,7 +203,8 @@ public class DcaeInventoryServices {
                 return DcaeHttpConnectionManager.doDcaeHttpQuery(fullUrl, "GET", null, null);\r
             } catch (BadRequestException e) {\r
                 if (i == retryLimit) {\r
-                    // reach the retry limit, but still failed to connect to DCAE\r
+                    // reach the retry limit, but still failed to connect to\r
+                    // DCAE\r
                     throw e;\r
                 } else {\r
                     // wait for a while and try to connect to DCAE again\r
@@ -213,9 +212,11 @@ public class DcaeInventoryServices {
                 }\r
             }\r
         }\r
-        // normally it should not go to this branch. It should either return the DCAE query result, or throw exception\r
+        // normally it should not go to this branch. It should either return the\r
+        // DCAE query result, or throw exception\r
         return null;\r
     }\r
+\r
     /**\r
      * Inserts a new DCAEServiceType or updates an existing instance. If the\r
      * typeName is same second time(already exists) then the\r