diff --git a/TracerOnJavassist/src/tracer/PlainTextTraceGenerator.java b/TracerOnJavassist/src/tracer/PlainTextTraceGenerator.java index 05a87ad..8326a08 100644 --- a/TracerOnJavassist/src/tracer/PlainTextTraceGenerator.java +++ b/TracerOnJavassist/src/tracer/PlainTextTraceGenerator.java @@ -10,29 +10,18 @@ @Override public String generateReplaceStatementsForFieldSet(String targetClass, String targetObject, String argClass, String argObject, String threadId, String timeStamp) { - String output = "{$proceed($$); " + - "tracer.MyPrintStream.println(\"set:\" + " + targetClass + " + \":\" + " + targetObject + " + \":\" + " + - argClass + " + \":\" + " + argObject + " + " + LINE_AND_THREAD + threadId + ");}"; - System.out.println(output); - return output; -// return "{$proceed($$); " + -// "tracer.MyPrintStream.print(\"set:\" + " + targetClass + " + \":\" + " + targetObject + " + \":\" + " + -// argClass + " + \":\" + " + argObject + " + " + LINE_AND_THREAD + threadId + ");}"; + return "{$proceed($$); " + + "tracer.MyPrintStream.println(\"set:\" + " + targetClass + " + \":\" + " + targetObject + " + \":\" + " + + argClass + " + \":\" + " + argObject + " + " + LINE_AND_THREAD + threadId + ");}"; } @Override public String generateReplaceStatementsForFieldGet(String thisClass, String thisObject, String targetClass, String targetObject, String returnedClass, String returnedObject, String threadId, String timeStamp) { - String output = "{$_ = $proceed(); " + - "tracer.MyPrintStream.println(\"get:\" + " + thisClass + " + \":\" + " + thisObject + " + \":\" + " + - targetClass + " + \":\" + " + targetObject + " + \":\" + " + - returnedClass + " + \":\" + " + returnedObject + " + " + LINE_AND_THREAD + threadId + ");}"; - System.out.println(output); - return output; -// return "{$_ = $proceed(); " + -// "tracer.MyPrintStream.print(\"get:\" + " + thisClass + " + \":\" + " + thisObject + " + \":\" + " + -// targetClass + " + \":\" + " + targetObject + " + \":\" + " + -// returnedClass + " + \":\" + " + returnedObject + " + \":\" + " + LINE_AND_THREAD + threadId + ");}"; + return "{$_ = $proceed(); " + + "tracer.MyPrintStream.println(\"get:\" + " + thisClass + " + \":\" + " + thisObject + " + \":\" + " + + targetClass + " + \":\" + " + targetObject + " + \":\" + " + + returnedClass + " + \":\" + " + returnedObject + " + \":\" + " + LINE_AND_THREAD + threadId + ");}"; } @Override @@ -65,7 +54,6 @@ + " + \":\" + " + thisObject + " + " + LINE + " + " + timeStamp + " + \":ThreadNo \" + " + threadId + ");"; classOutput = "tracer.MyPrintStream.println(\"Class \" + " + thisClass + " + \":\" + " + thisObject + " + " + LINE_AND_THREAD + threadId + ");"; - System.out.println(newOutput + methodOutput + classOutput + argsOutput); return newOutput + methodOutput + classOutput + argsOutput; } @@ -92,7 +80,7 @@ String returnOutput = "tracer.MyPrintStream.print(\"Return " + invocationType + "(" + shortName + "):\" + " + returnedClass + " + \":\" + " + returnedObject + " + \":\");" + "tracer.MyPrintStream.println(\"\" + " + thisObject + " + " + LINE_AND_THREAD + threadId + ");"; - System.out.println(returnOutput); + return returnOutput; } }