src/share/classes/com/sun/tools/classfile/ClassWriter.java

changeset 282
fc634a593812
parent 46
7708bd6d800d
child 308
03944ee4fac4
equal deleted inserted replaced
281:f838537fb1ac 282:fc634a593812
116 116
117 protected void writeConstantPool() { 117 protected void writeConstantPool() {
118 ConstantPool pool = classFile.constant_pool; 118 ConstantPool pool = classFile.constant_pool;
119 int size = pool.size(); 119 int size = pool.size();
120 out.writeShort(size); 120 out.writeShort(size);
121 try { 121 for (CPInfo cpInfo: pool.entries())
122 for (int i = 1; i < size; ) { 122 constantPoolWriter.write(cpInfo, out);
123 i += constantPoolWriter.write(pool.get(i), out);
124 }
125 } catch (ConstantPoolException e) {
126 throw new Error(e); // ??
127 }
128 } 123 }
129 124
130 protected void writeFields() throws IOException { 125 protected void writeFields() throws IOException {
131 Field[] fields = classFile.fields; 126 Field[] fields = classFile.fields;
132 out.writeShort(fields.length); 127 out.writeShort(fields.length);

mercurial