From: Munir Ahmad Date: Fri, 9 Mar 2018 13:20:47 +0000 (-0500) Subject: Collapse catch clauses where applicable X-Git-Tag: v1.2.1~473^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=a97d603f3ff2325e43d624c7205122957ad1ff11;p=so.git Collapse catch clauses where applicable Change-Id: Idf9546b9d59bf23547bac4aa4f0fbee4f97a0255 Issue-ID: SO-437 Signed-off-by: Munir Ahmad --- diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/JsonWrapper.java b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/JsonWrapper.java index fbed36548e..f37db4abdd 100644 --- a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/JsonWrapper.java +++ b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/JsonWrapper.java @@ -92,12 +92,10 @@ public abstract class JsonWrapper implements Serializable { JSONObject json = new JSONObject(); try { json = new JSONObject(mapper.writeValueAsString(this)); - } catch (JSONException e) { - LOGGER.debug("Exception :",e); - } catch (IOException e) { + } catch (JSONException | IOException e) { LOGGER.debug("Exception :",e); } - return json; + return json; } public String listToJson(List list) { @@ -107,8 +105,6 @@ public abstract class JsonWrapper implements Serializable { String jsonString = ""; try { jsonString = mapper.writeValueAsString(list); - } catch (JsonGenerationException e) { - LOGGER.debug("Exception :",e); } catch (IOException e) { LOGGER.debug("Exception :",e); } diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/json/JsonWrapper.java b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/json/JsonWrapper.java index cfa5c853a3..2fe625849b 100644 --- a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/json/JsonWrapper.java +++ b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/json/JsonWrapper.java @@ -85,12 +85,10 @@ public abstract class JsonWrapper implements Serializable { JSONObject json = new JSONObject(); try { json = new JSONObject(mapper.writeValueAsString(this)); - } catch (JSONException e) { + } catch (JSONException | IOException e) { LOGGER.debug("Exception :",e); - } catch (IOException e) { - LOGGER.debug("Exception :",e); - } - return json; + } + return json; } public String listToJson(List list) { @@ -100,8 +98,6 @@ public abstract class JsonWrapper implements Serializable { String jsonString = ""; try { jsonString = mapper.writeValueAsString(list); - } catch (JsonGenerationException e) { - LOGGER.debug("Exception :",e); } catch (IOException e) { LOGGER.debug("Exception :",e); }