KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > alt > jiapi > reflect > LNTableEntry


1 package alt.jiapi.reflect;
2
3 import alt.jiapi.file.LineNumberTableAttribute;
4
5 /**
6  * This class is a container for alt.jiapi.file.LineNumberTable.Entry
7  * class.
8  * This is used to hold Instruction references to linenumber-table,
9  * while alt.jiapi.file.LineNumberTable.Entry holds byte offset.
10  *
11  * @author Mika Riekkinen
12  */

13 class LNTableEntry {
14     private Instruction instruction;
15     private LineNumberTableAttribute.Entry entry;
16
17     LNTableEntry(LineNumberTableAttribute.Entry entry, Instruction ins) {
18         this.entry = entry;
19         this.instruction = ins;
20     }
21
22     /**
23      * Called, when bytecode instrumentation is done.
24      * This method updates offset of the instruction to reflect
25      * offset changes.
26      */

27     void update() {
28         if (instruction != null) {
29 // System.out.println(">> updating " + entry.getStartPc() + " to " +
30
// instruction.getOffset());
31
entry.setStartPc(instruction.getOffset());
32         }
33     }
34 }
35
Popular Tags