Fixed some major sonar issues in yang-data-codec-json. 59/27159/6
authorIgor Foltin <igor.foltin@pantheon.sk>
Fri, 18 Sep 2015 12:55:47 +0000 (14:55 +0200)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 23 Sep 2015 07:36:06 +0000 (07:36 +0000)
Change-Id: I31f2342a226fc68742f9f892d7e9fff712fef282
Signed-off-by: Igor Foltin <igor.foltin@pantheon.sk>
yang/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/JSONNormalizedNodeStreamWriter.java
yang/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/JsonParserStream.java

index 8e9537c790836448791954ca6f3da3c5291a4c9b..e3913c81659e29ab2edebf8f128758cd9286532c 100644 (file)
@@ -28,7 +28,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaPath;
  * Values of leaf and leaf-list are NOT translated according to codecs.
  *
  */
-public class JSONNormalizedNodeStreamWriter implements NormalizedNodeStreamWriter {
+public final class JSONNormalizedNodeStreamWriter implements NormalizedNodeStreamWriter {
     /**
      * RFC6020 deviation: we are not required to emit empty containers unless they
      * are marked as 'presence'.
index 68b6d16861d499d0193e237f0d303caa19b689d6..da5315bba17e805dc5e10d021e077065ef186cd7 100644 (file)
@@ -69,7 +69,7 @@ public final class JsonParserStream implements Closeable, Flushable {
         return new JsonParserStream(writer, schemaContext, schemaContext);
     }
 
-    public JsonParserStream parse(final JsonReader reader) throws JsonIOException, JsonSyntaxException {
+    public JsonParserStream parse(final JsonReader reader) {
         // code copied from gson's JsonParser and Stream classes
 
         final boolean lenient = reader.isLenient();
@@ -83,11 +83,9 @@ public final class JsonParserStream implements Closeable, Flushable {
             compositeNodeDataWithSchema.write(writer);
 
             return this;
-            // return read(reader);
         } catch (final EOFException e) {
             if (isEmpty) {
                 return this;
-                // return JsonNull.INSTANCE;
             }
             // The stream ended prematurely so it is likely a syntax error.
             throw new JsonSyntaxException(e);