Fixing a few bugs in the statistics printout.
[jpf-core.git] / src / main / gov / nasa / jpf / listener / VariableConflictTracker.java
index 561a4091ce9e71d7e337d36ba607c563d5410a6e..0359ed14b0cd54802e17fe7623a3057c1b29a8df 100644 (file)
@@ -93,7 +93,7 @@ public class VariableConflictTracker extends ListenerAdapter {
           byte type  = getType(ti, executedInsn);
           String value = getValue(ti, executedInsn, type);
           //System.out.println("\n\n" + ti.getStackTrace() + "\n\n");
-          String writer = getWriter(ti.getStack());
+          String writer = getWriter(ti.getStack());         
           // Just return if the writer is not one of the listed apps in the .jpf file
           if (writer == null)
             return;
@@ -148,9 +148,11 @@ public class VariableConflictTracker extends ListenerAdapter {
         current.value = value;
       }
     } else {
-      // First write to the variable
-      VarChange change = new VarChange(writer, value);
-      writeMap.put(var, change);
+      // First write to the variable only if it is not null
+                       if (value != null) {
+                               VarChange change = new VarChange(writer, value);
+                               writeMap.put(var, change);
+                       }
     }
   }