Ignore those exceptions never occurs 01/30301/1
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Mon, 5 Feb 2018 15:04:11 +0000 (20:34 +0530)
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Mon, 5 Feb 2018 15:04:11 +0000 (20:34 +0530)
Issue-ID: CLI-50

Change-Id: If7de4980b0c7b205bd6fcbb8ead71eb017ec1a43
Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
framework/src/main/java/org/onap/cli/fw/registrar/OnapCommandRegistrar.java
framework/src/main/java/org/onap/cli/fw/utils/OnapCommandHelperUtils.java
profiles/http/src/main/java/org/onap/cli/fw/http/conf/OnapCommandHttpConstants.java
profiles/http/src/main/java/org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java
profiles/http/src/main/java/org/onap/cli/fw/http/utils/OnapCommandHttpUtils.java

index 19dc3f5..854b55b 100644 (file)
@@ -314,8 +314,8 @@ public class OnapCommandRegistrar {
         String versionInfo = "";
         try {
             versionInfo = IOUtils.toString(this.getClass().getClassLoader().getResourceAsStream(OnapCommandConstants.VERSION_INFO));
-        } catch (IOException e) {
-            //Never occurs  // NOSONAR
+        } catch (IOException e) { // NOSONAR
+            //Never occurs
         }
 
         versionInfo = versionInfo.replaceAll(OnapCommandConstants.VERSION_INFO_PLACE_HOLDER_ENB_PRD_VER, configuredProductVersion);
index 5e8c3f5..81589b0 100644 (file)
@@ -53,7 +53,7 @@ public class OnapCommandHelperUtils {
 
             impBuildDate = attributes.getValue("Build-Time");
         }
-        catch (IOException e)
+        catch (IOException e)  // NOSONAR
         {
             //Ignore it as it will never occur
         }
index cd10849..b18545c 100644 (file)
@@ -34,7 +34,7 @@ public class OnapCommandHttpConstants {
     public static final String APPLICATION_JSON = "application/json";
     public static final String DEFAULT_PARAMETER_HTTP_FILE_NAME = "default_input_parameters_http.yaml";
     public static final String DEAFULT_PARAMETER_USERNAME = "host-username";
-    public static final String DEAFULT_PARAMETER_PASSWORD = "host-password";
+    public static final String DEAFULT_PARAMETER_PASSWORD = "host-password"; // NOSONAR
     public static final String DEAFULT_PARAMETER_HOST_URL = "host-url";
     public static final String DEFAULT_PARAMETER_NO_AUTH = "no-auth";
     public static final String HTTP_SCHEMA_PROFILE = "http";
index 6dd1588..09dac49 100644 (file)
@@ -431,7 +431,7 @@ public class OnapCommandSchemaHttpLoader {
                        forCmd.getInfo().getService() + "-" +
                        forCmd.getService().getAuthType() + "-" + authAction,
                        forCmd.getInfo().getProduct());
-           } catch (OnapCommandNotFound e) {
+           } catch (OnapCommandNotFound e) {  // NOSONAR
                auth = OnapCommandRegistrar.getRegistrar().get(
                        forCmd.getService().getAuthType() + "-" + authAction,
                        forCmd.getInfo().getProduct());
index cd91878..7b10dbc 100644 (file)
@@ -107,8 +107,8 @@ public class OnapCommandHttpUtils {
             String key = entry.getKey();
             try {
                 resultsProcessed.put(key, OnapCommandHttpUtils.replaceLineFromOutputResults(resultMap.get(key), resultHttp));
-            } catch(OnapCommandResultEmpty e) {
-                // pass // NOSONAR
+            } catch(OnapCommandResultEmpty e) {  // NOSONAR
+                // pass
             }
         }
 
@@ -174,7 +174,7 @@ public class OnapCommandHttpUtils {
             try {
                 // JSONArray or String
                 value = JsonPath.read(resultHttp.getBody(), jsonPath);
-            } catch (PathNotFoundException e1) {
+            } catch (PathNotFoundException e1) { // NOSONAR
                 //set to blank for those entries which are missing from the output json
                 value = "";
             } catch (Exception e) {