Collapse catch clauses where applicable 53/34953/2
authorMunir Ahmad <munir.ahmad@bell.ca>
Fri, 9 Mar 2018 13:20:47 +0000 (08:20 -0500)
committerMunir Ahmad <munir.ahmad@bell.ca>
Fri, 9 Mar 2018 14:40:55 +0000 (14:40 +0000)
Change-Id: Idf9546b9d59bf23547bac4aa4f0fbee4f97a0255
Issue-ID: SO-437
Signed-off-by: Munir Ahmad <munir.ahmad@bell.ca>
bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/JsonWrapper.java
bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/json/JsonWrapper.java

index fbed365..f37db4a 100644 (file)
@@ -92,12 +92,10 @@ public abstract class JsonWrapper implements Serializable  {
         JSONObject json = new JSONObject();\r
          try {\r
                        json = new JSONObject(mapper.writeValueAsString(this));\r
-               } catch (JSONException e) {\r
-                       LOGGER.debug("Exception :",e);\r
-               } catch (IOException e) {\r
+               } catch (JSONException | IOException e) {\r
                        LOGGER.debug("Exception :",e);\r
                }\r
-         return json; \r
+        return json;\r
        }\r
        \r
        public String listToJson(List list) {\r
@@ -107,8 +105,6 @@ public abstract class JsonWrapper implements Serializable  {
                String jsonString = "";\r
                try {\r
                        jsonString = mapper.writeValueAsString(list);\r
-               } catch (JsonGenerationException e) {\r
-                       LOGGER.debug("Exception :",e);\r
                } catch (IOException e) {\r
                        LOGGER.debug("Exception :",e);\r
                }\r
index cfa5c85..2fe6258 100644 (file)
@@ -85,12 +85,10 @@ public abstract class JsonWrapper implements Serializable  {
         JSONObject json = new JSONObject();\r
          try {\r
                        json = new JSONObject(mapper.writeValueAsString(this));\r
-               } catch (JSONException e) {\r
+               } catch (JSONException | IOException e) {\r
                        LOGGER.debug("Exception :",e);\r
-               } catch (IOException e) {\r
-                       LOGGER.debug("Exception :",e);\r
-               }               \r
-         return json; \r
+               }\r
+        return json;\r
        }\r
        \r
        public String listToJson(List list)  {\r
@@ -100,8 +98,6 @@ public abstract class JsonWrapper implements Serializable  {
                String jsonString = "";\r
                try {\r
                        jsonString = mapper.writeValueAsString(list);\r
-               } catch (JsonGenerationException e) {\r
-                       LOGGER.debug("Exception :",e);\r
                } catch (IOException e) {\r
                        LOGGER.debug("Exception :",e);\r
                }\r