1 4 package com.tc.aspectwerkz.transform.inlining.weaver; 5 6 import com.tc.asm.ClassAdapter; 7 import com.tc.asm.ClassVisitor; 8 import com.tc.asm.MethodVisitor; 9 import com.tc.asm.MethodAdapter; 10 import com.tc.asm.Label; 11 12 import com.tc.aspectwerkz.transform.InstrumentationContext; 13 14 17 public class LabelToLineNumberVisitor extends ClassAdapter { 18 19 private InstrumentationContext m_ctx; 20 21 public LabelToLineNumberVisitor(ClassVisitor cv, InstrumentationContext ctx) { 22 super(cv); 23 m_ctx = (InstrumentationContext) ctx; 24 } 25 26 public MethodVisitor visitMethod(int access, String name, String desc, String signature, String [] exceptions) { 27 return new MethodAdapter(super.visitMethod(access, name, desc, signature, exceptions)) { 28 public void visitLineNumber(int i, Label label) { 29 super.visitLineNumber(i, label); 30 m_ctx.addLineNumberInfo(label, i); 31 } 32 }; 33 } 34 } 35 | Popular Tags |