Commented out dead/unreachable code (maybe some error in control logic?) 96/89496/1
authorOleksandr Moliavko <o.moliavko@samsung.com>
Thu, 6 Jun 2019 09:39:03 +0000 (12:39 +0300)
committerOleksandr Moliavko <o.moliavko@samsung.com>
Thu, 6 Jun 2019 09:39:11 +0000 (12:39 +0300)
Issue-ID: AAF-837
Change-Id: I6661713112a2f3537db7a1bfb8c14af20360f36d
Signed-off-by: AlexMolyavko <o.moliavko@samsung.com>
misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/OutJson.java

index 6c86837..2d93bb4 100644 (file)
@@ -39,13 +39,13 @@ public class OutJson extends Out {
         } else {
             ipw = null;
         }
-        
+
         // If it's a fragment, print first Object Name.  If root Object, skip first name
         Stack<LevelStack> jsonLevel = new Stack<LevelStack>();
         jsonLevel.push(new LevelStack(options.length>1 && options[1]));
         boolean print = true, hadData=false;
         char afterName=0, beforeName=0, maybe = 0, prev=0;
-        
+
         int count = 0;
         while ((p = prs.parse(in,p.reuse())).valid()) {
             ++count;
@@ -112,18 +112,20 @@ public class OutJson extends Out {
                 default:
                     print = true;
             }
-        
+
             if (maybe!=0) {
                 if (ipw==null)writer.append(maybe); 
                 else ipw.println(maybe);
                 maybe = 0;
             }
-            
-            if (beforeName!=0) {
-                if (ipw==null)writer.append(beforeName);
-                else ipw.println(beforeName);
-                beforeName = 0;
-            }
+
+            // commented out unreachable code (as it is, beforeName is never
+            // assigned any value except 0
+            //if (beforeName!=0) {
+            //    if (ipw==null)writer.append(beforeName);
+            //    else ipw.println(beforeName);
+            //    beforeName = 0;
+            //}
             if (print) {
                 if (p.hasName()) {
                     writer.append('"');