21 package com.sun.org.apache.bcel.internal.classfile; |
21 package com.sun.org.apache.bcel.internal.classfile; |
22 |
22 |
23 import java.io.DataInput; |
23 import java.io.DataInput; |
24 import java.io.DataOutputStream; |
24 import java.io.DataOutputStream; |
25 import java.io.IOException; |
25 import java.io.IOException; |
|
26 |
26 import com.sun.org.apache.bcel.internal.Const; |
27 import com.sun.org.apache.bcel.internal.Const; |
27 |
28 |
28 // The new table is used when generic types are about... |
29 // The new table is used when generic types are about... |
|
30 |
29 //LocalVariableTable_attribute { |
31 //LocalVariableTable_attribute { |
30 // u2 attribute_name_index; |
32 // u2 attribute_name_index; |
31 // u4 attribute_length; |
33 // u4 attribute_length; |
32 // u2 local_variable_table_length; |
34 // u2 local_variable_table_length; |
33 // { u2 start_pc; |
35 // { u2 start_pc; |
35 // u2 name_index; |
37 // u2 name_index; |
36 // u2 descriptor_index; |
38 // u2 descriptor_index; |
37 // u2 index; |
39 // u2 index; |
38 // } local_variable_table[local_variable_table_length]; |
40 // } local_variable_table[local_variable_table_length]; |
39 // } |
41 // } |
|
42 |
40 //LocalVariableTypeTable_attribute { |
43 //LocalVariableTypeTable_attribute { |
41 // u2 attribute_name_index; |
44 // u2 attribute_name_index; |
42 // u4 attribute_length; |
45 // u4 attribute_length; |
43 // u2 local_variable_type_table_length; |
46 // u2 local_variable_type_table_length; |
44 // { |
47 // { |
59 |
63 |
60 public LocalVariableTypeTable(final LocalVariableTypeTable c) { |
64 public LocalVariableTypeTable(final LocalVariableTypeTable c) { |
61 this(c.getNameIndex(), c.getLength(), c.getLocalVariableTypeTable(), c.getConstantPool()); |
65 this(c.getNameIndex(), c.getLength(), c.getLocalVariableTypeTable(), c.getConstantPool()); |
62 } |
66 } |
63 |
67 |
64 public LocalVariableTypeTable(final int name_index, final int length, |
68 public LocalVariableTypeTable(final int name_index, final int length, final LocalVariable[] local_variable_table, final ConstantPool constant_pool) { |
65 final LocalVariable[] local_variable_table, final ConstantPool constant_pool) { |
|
66 super(Const.ATTR_LOCAL_VARIABLE_TYPE_TABLE, name_index, length, constant_pool); |
69 super(Const.ATTR_LOCAL_VARIABLE_TYPE_TABLE, name_index, length, constant_pool); |
67 this.local_variable_type_table = local_variable_table; |
70 this.local_variable_type_table = local_variable_table; |
68 } |
71 } |
69 |
72 |
70 LocalVariableTypeTable(final int nameIdx, final int len, final DataInput input, |
73 LocalVariableTypeTable(final int nameIdx, final int len, final DataInput input, final ConstantPool cpool) throws IOException { |
71 final ConstantPool cpool) throws IOException { |
|
72 this(nameIdx, len, (LocalVariable[]) null, cpool); |
74 this(nameIdx, len, (LocalVariable[]) null, cpool); |
73 |
75 |
74 final int local_variable_type_table_length = input.readUnsignedShort(); |
76 final int local_variable_type_table_length = input.readUnsignedShort(); |
75 local_variable_type_table = new LocalVariable[local_variable_type_table_length]; |
77 local_variable_type_table = new LocalVariable[local_variable_type_table_length]; |
76 |
78 |