1 4 package com.tc.aspectwerkz.transform.inlining.weaver; 5 6 import java.util.Set ; 7 8 import com.tc.asm.MethodVisitor; 9 import com.tc.asm.Opcodes; 10 11 import com.tc.aspectwerkz.transform.TransformationConstants; 12 import com.tc.aspectwerkz.transform.inlining.AsmNullAdapter; 13 14 20 public class AlreadyAddedMethodAdapter extends AsmNullAdapter.NullClassAdapter implements Opcodes, TransformationConstants { 21 22 26 private final Set m_addedMethods; 27 28 33 public AlreadyAddedMethodAdapter(final Set wrappers) { 34 m_addedMethods = wrappers; 35 } 36 37 47 public MethodVisitor visitMethod(final int access, 48 final String name, 49 final String desc, 50 final String signature, 51 final String [] exceptions) { 52 if (name.startsWith(WRAPPER_METHOD_PREFIX) 53 || name.startsWith(ORIGINAL_METHOD_PREFIX)) { 54 m_addedMethods.add(getMethodKey(name, desc)); 55 } 56 return super.visitMethod(access, name, desc, signature, exceptions); 57 } 58 59 static String getMethodKey(String name, String desc) { 60 StringBuffer sb = new StringBuffer (name); 61 return sb.append(desc).toString(); 62 } 63 } 64 | Popular Tags |