diff --git a/TracerOnJavassist/src/tracer/JSONArrayAdvisor.java b/TracerOnJavassist/src/tracer/JSONArrayAdvisor.java index 3608896..8bcbe47 100644 --- a/TracerOnJavassist/src/tracer/JSONArrayAdvisor.java +++ b/TracerOnJavassist/src/tracer/JSONArrayAdvisor.java @@ -116,7 +116,8 @@ public static void arrayWriteObject(Object array, int index, Object value) { long threadId = Thread.currentThread().getId(); long timeStamp = System.nanoTime(); - JSONTraceGenerator.arraySetOutput(array.getClass().getName(), Integer.toString(System.identityHashCode(array)), index, value.getClass().getName(), Integer.toString(System.identityHashCode(value)), threadId, timeStamp); + JSONTraceGenerator.arraySetOutput(array.getClass().getName(), Integer.toString(System.identityHashCode(array)), index, + ((value !=null)?value.getClass().getName():"---"), ((value != null)?Integer.toString(System.identityHashCode(value)):"0"), threadId, timeStamp); ((Object [])array)[index] = value; } @@ -124,7 +125,8 @@ Object value = ((Object [])array)[index]; long threadId = Thread.currentThread().getId(); long timeStamp = System.nanoTime(); - JSONTraceGenerator.arrayGetOutput(array.getClass().getName(), Integer.toString(System.identityHashCode(array)), index, value.getClass().getName(), Integer.toString(System.identityHashCode(value)), threadId, timeStamp); + JSONTraceGenerator.arrayGetOutput(array.getClass().getName(), Integer.toString(System.identityHashCode(array)), index, + ((value !=null)?value.getClass().getName():"---"), ((value != null)?Integer.toString(System.identityHashCode(value)):"0"), threadId, timeStamp); return value; } }