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