private void around ( final CtMethod m , final String before , final String after , final List < VarDeclarationData > declarations ) throws CannotCompileException , NotFoundException { String signature = Modifier . toString ( m . getModifiers ( ) ) + " " + m . getReturnType ( ) . getName ( ) + " " + m . getLongName ( ) ; LOG . info ( "--- Instrumenting " + signature ) ; for ( VarDeclarationData declaration : declarations ) { m . addLocalVariable ( declaration . getName ( ) , pool . get ( declaration . getType ( ) ) ) ; } m . insertBefore ( before ) ; m . insertAfter ( after ) ; }
Method introducing code before and after a given javassist method .