1 8 9 package jas; 10 11 import java.io.*; 12 13 public class CatchEntry 14 { 15 Label start_pc, end_pc, handler_pc; 16 CP catch_cpe; 17 29 public 30 CatchEntry(Label start, Label end, Label handler, CP cat) 31 { 32 start_pc = start; 33 end_pc = end; 34 handler_pc = handler; 35 catch_cpe = cat; 36 } 37 38 void resolve(ClassEnv e) 39 { if (catch_cpe != null) e.addCPItem(catch_cpe); } 40 41 void write(ClassEnv e, CodeAttr ce, DataOutputStream out) 42 throws IOException, jasError 43 { 44 start_pc.writeOffset(ce, null, out); 45 end_pc.writeOffset(ce, null, out); 46 handler_pc.writeOffset(ce, null, out); 47 if (catch_cpe != null) 48 { out.writeShort(e.getCPIndex(catch_cpe)); } 49 else 50 { out.writeShort(0); } 51 } 52 } 53 | Popular Tags |