public static LineNumberNode findLineNumberForInstruction(InsnList insnList,AbstractInsnNode insnNode){
  Validate.notNull(insnList);
  Validate.notNull(insnNode);
  int idx=insnList.indexOf(insnNode);
  Validate.isTrue(idx != -1);
  ListIterator<AbstractInsnNode> insnIt=insnList.iterator(idx);
  while (insnIt.hasPrevious()) {
    AbstractInsnNode node=insnIt.previous();
    if (node instanceof LineNumberNode) {
      return (LineNumberNode)node;
    }
  }
  return null;
}

public static LineNumberNode findLineNumberForInstruction ( InsnList insnList , AbstractInsnNode insnNode ) { Validate . notNull ( insnList ) ; Validate . notNull ( insnNode ) ; int idx = insnList . indexOf ( insnNode ) ; Validate . isTrue ( idx != - 1 ) ; ListIterator < AbstractInsnNode > insnIt = insnList . iterator ( idx ) ; while ( insnIt . hasPrevious ( ) ) { AbstractInsnNode node = insnIt . previous ( ) ; if ( node instanceof LineNumberNode ) { return ( LineNumberNode ) node ; } } return null ; }
find line number associated with an instruction .
