1 8 package org.codehaus.aspectwerkz.transform.inlining.weaver; 9 10 import org.objectweb.asm.ClassAdapter; 11 import org.objectweb.asm.ClassVisitor; 12 import org.objectweb.asm.CodeVisitor; 13 import org.objectweb.asm.Attribute; 14 import org.objectweb.asm.CodeAdapter; 15 import org.objectweb.asm.Label; 16 import org.codehaus.aspectwerkz.transform.inlining.ContextImpl; 17 import org.codehaus.aspectwerkz.transform.Context; 18 19 22 public class LabelToLineNumberVisitor extends ClassAdapter { 23 24 private ContextImpl m_ctx; 25 26 public LabelToLineNumberVisitor(ClassVisitor cv, Context ctx) { 27 super(cv); 28 m_ctx = (ContextImpl)ctx; 29 } 30 31 public CodeVisitor visitMethod(int i, String s, String s1, String [] strings, Attribute attribute) { 32 return new CodeAdapter(super.visitMethod(i, s, s1, strings, attribute)) { 33 public void visitLineNumber(int i, Label label) { 34 super.visitLineNumber(i, label); 35 m_ctx.addLineNumberInfo(label, i); 36 } 37 }; 38 } 39 } 40 | Popular Tags |