Remove unneeded "throws" 11/78711/1
authorJim Hahn <jrh3@att.com>
Mon, 18 Feb 2019 22:03:29 +0000 (17:03 -0500)
committerJim Hahn <jrh3@att.com>
Mon, 18 Feb 2019 22:04:55 +0000 (17:04 -0500)
Fixed sonar issue:
- remove the declaration of thrown exception
'com.google.gson.JsonParseException' which is a runtime exception

Change-Id: Ice29a875891a06a55932fcf80107d4dec2b10d1f
Issue-ID: POLICY-1533
Signed-off-by: Jim Hahn <jrh3@att.com>
feature-pooling-dmaap/src/main/java/org/onap/policy/drools/pooling/Serializer.java

index eee26ef..80eee50 100644 (file)
@@ -82,9 +82,8 @@ public class Serializer {
      * 
      * @param filter filter to be encoded
      * @return the filter, serialized as a JSON string
-     * @throws JsonParseException if it cannot be de-serialized
      */
-    public String encodeFilter(Map<String, Object> filter) throws JsonParseException {
+    public String encodeFilter(Map<String, Object> filter) {
         return gson.toJson(filter);
     }
 
@@ -93,9 +92,8 @@ public class Serializer {
      * 
      * @param msg message to be encoded
      * @return the message, serialized as a JSON string
-     * @throws JsonParseException if it cannot be de-serialized
      */
-    public String encodeMsg(Message msg) throws JsonParseException {
+    public String encodeMsg(Message msg) {
         JsonElement jsonEl = gson.toJsonTree(msg);
 
         String type = class2type.get(msg.getClass());
@@ -113,9 +111,8 @@ public class Serializer {
      * 
      * @param msg JSON string representing the message
      * @return the message
-     * @throws JsonParseException if it cannot be serialized
      */
-    public Message decodeMsg(String msg) throws JsonParseException {
+    public Message decodeMsg(String msg) {
         JsonElement jsonEl = gson.fromJson(msg, JsonElement.class);
 
         JsonElement typeEl = jsonEl.getAsJsonObject().get(TYPE_FIELD);