private void doMethod(CtBehavior method) throws NotFoundException, CannotCompileException {

        String signature = JavassistHelper.getSignature(method);
        String returnValue = JavassistHelper.returnValue(method);

        if (addEntryExit) {
            String messagePattern = "if ({}.{}()) {}.{}(\">> {}\");";
            Object[] arg1 = new Object[] { loggerName, levelEnabled, loggerName, level, signature };
            String before = MessageFormatter.arrayFormat(messagePattern, arg1).getMessage();
            // System.out.println(before);
            method.insertBefore(before);

            String messagePattern2 = "if ({}.{}()) {}.{}(\"<< {}{}\");";
            Object[] arg2 = new Object[] { loggerName, levelEnabled, loggerName, level, signature, returnValue };
            String after = MessageFormatter.arrayFormat(messagePattern2, arg2).getMessage();
            // System.out.println(after);
            method.insertAfter(after);
        }
    }
private void doMethod ( CtBehavior method ) throws NotFoundException , CannotCompileException { String signature = JavassistHelper . getSignature ( method ) ; String returnValue = JavassistHelper . returnValue ( method ) ; if ( addEntryExit ) { String messagePattern = "if ({}.{}()) {}.{}(\">> {}\");" ; Object [ ] arg1 = new Object [ ] { loggerName , levelEnabled , loggerName , level , signature } ; String before = MessageFormatter . arrayFormat ( messagePattern , arg1 ) . getMessage ( ) ; method . insertBefore ( before ) ; String messagePattern2 = "if ({}.{}()) {}.{}(\"<< {}{}\");" ; Object [ ] arg2 = new Object [ ] { loggerName , levelEnabled , loggerName , level , signature , returnValue } ; String after = MessageFormatter . arrayFormat ( messagePattern2 , arg2 ) . getMessage ( ) ; method . insertAfter ( after ) ; } }
process a single method - this means add entry/exit logging if requested.
It is only called for methods with a body.

@param method
method to work on
@throws NotFoundException
@throws CannotCompileException