summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMunir Ahmad <munir.ahmad@bell.ca>2018-03-09 08:20:47 -0500
committerMunir Ahmad <munir.ahmad@bell.ca>2018-03-09 14:40:55 +0000
commita97d603f3ff2325e43d624c7205122957ad1ff11 (patch)
tree8bc9a216153a53bf1cc6e18bd947699a731d1421
parentf3b28a0aafd83a57d42afbf23c9f6fbe6f546db3 (diff)
Collapse catch clauses where applicable
Change-Id: Idf9546b9d59bf23547bac4aa4f0fbee4f97a0255 Issue-ID: SO-437 Signed-off-by: Munir Ahmad <munir.ahmad@bell.ca>
-rw-r--r--bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/JsonWrapper.java8
-rw-r--r--bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/json/JsonWrapper.java10
2 files changed, 5 insertions, 13 deletions
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);
}