package fr.univ.nantes.processor;

import spoon.processing.AbstractProcessor;
import spoon.reflect.code.CtCodeSnippetStatement;
import spoon.reflect.declaration.CtMethod;

/**
 * @author Alexis Giraudet
 * @author Thomas Minier
 */
public class MethodCallCounterProcessor extends AbstractProcessor<CtMethod> {
    @Override
    public void process(CtMethod method) {
        System.out.println(method.getParent().getSignature() + ": " + method.getSignature() + ";");
        String code = "fr.univ.nantes.logger.LogWriter.call(\"" + method.getParent().getSignature() + ": " + method.getSignature() + "\")";
        CtCodeSnippetStatement snippet = getFactory().Code().createCodeSnippetStatement(code);
        method.getBody().insertBegin(snippet);
    }
}

@@ -99,27 +99,16 @@
 .code.Ct
-CodeSnippet
 Statemen
@@ -444,14 +444,8 @@
 re()
- + %22;%22
 );%0A 
@@ -593,27 +593,16 @@
       Ct
-CodeSnippet
 Statemen

fix syntax