From a97d603f3ff2325e43d624c7205122957ad1ff11 Mon Sep 17 00:00:00 2001 From: Munir Ahmad Date: Fri, 9 Mar 2018 08:20:47 -0500 Subject: Collapse catch clauses where applicable Change-Id: Idf9546b9d59bf23547bac4aa4f0fbee4f97a0255 Issue-ID: SO-437 Signed-off-by: Munir Ahmad --- .../java/org/openecomp/mso/bpmn/core/domain/JsonWrapper.java | 8 ++------ .../java/org/openecomp/mso/bpmn/core/json/JsonWrapper.java | 10 +++------- 2 files changed, 5 insertions(+), 13 deletions(-) (limited to 'bpmn/MSOCoreBPMN/src/main') 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); } -- cgit 1.2.3-korg