diff --git a/TracerOnJavassist/src/tracer/OutputStatementsGenerator.java b/TracerOnJavassist/src/tracer/OutputStatementsGenerator.java index f4e2011..c9a92de 100644 --- a/TracerOnJavassist/src/tracer/OutputStatementsGenerator.java +++ b/TracerOnJavassist/src/tracer/OutputStatementsGenerator.java @@ -72,15 +72,15 @@ } public String generateReplaceStatementsForCall(CtClass cls, CtBehavior m) throws NotFoundException { - return generateInsertBeforeStatements(cls, m, true) + " $_ = $proceed($$); " + generateInsertAfterStatements(cls, m, true); + return "{" + generateInsertBeforeStatements(cls, m, true) + " $_ = $proceed($$); " + generateInsertAfterStatements(cls, m, true) + "}"; } public String generateInsertBeforeStatementsForMethodBody(CtClass cls, CtBehavior m) throws NotFoundException { - return generateInsertBeforeStatements(cls, m, false); + return "{" + generateInsertBeforeStatements(cls, m, false) + "}"; } public String generateInsertAfterStatementsForMethodBody(CtClass cls, CtBehavior m) throws NotFoundException { - return generateInsertAfterStatements(cls, m, false); + return "{" + generateInsertAfterStatements(cls, m, false) + "}"; } /**