1 8 package org.codehaus.aspectwerkz.transform.inlining.weaver; 9 10 import org.objectweb.asm.CodeVisitor; 11 import org.objectweb.asm.Attribute; 12 import org.codehaus.aspectwerkz.transform.TransformationConstants; 13 import org.codehaus.aspectwerkz.annotation.instrumentation.asm.AsmAnnotationHelper; 14 15 import java.util.Set ; 16 17 23 public class AlreadyAddedMethodVisitor extends AsmAnnotationHelper.NullClassAdapter implements TransformationConstants { 24 25 29 private final Set m_addedMethods; 30 31 36 public AlreadyAddedMethodVisitor(final Set wrappers) { 37 m_addedMethods = wrappers; 38 } 39 40 50 public CodeVisitor visitMethod(final int access, 51 final String name, 52 final String desc, 53 final String [] exceptions, 54 final Attribute attrs) { 55 if (name.startsWith(WRAPPER_METHOD_PREFIX) || 56 name.startsWith(ORIGINAL_METHOD_PREFIX)) { 57 m_addedMethods.add(getMethodKey(name, desc)); 59 } 60 return super.visitMethod(access, name, desc, exceptions, attrs); 61 } 62 63 70 static String getMethodKey(final String name, final String desc) { 71 StringBuffer sb = new StringBuffer (name); 72 return sb.append(desc).toString(); 73 } 74 } 75 | Popular Tags |