void complete(BCMethod mb, ClassHolder ch,
ClassMember method, int maxStack, int maxLocals) {
int codeLength = getPC();
ClassFormatOutput out = cout;
try {
out.putU2(0); // exception_table_length
if (SanityManager.DEBUG) {
if (SanityManager.DEBUG_ON("ClassLineNumbers")) {
// Add a single attribute - LineNumberTable
// This add fake line numbers that are the pc offset in the method.
out.putU2(1); // attributes_count
int cpiUTF = ch.addUtf8("LineNumberTable");
out.putU2(cpiUTF);
out.putU4((codeLength * 4) + 2);
out.putU2(codeLength);
for (int i = 0; i < codeLength; i++) {
out.putU2(i);
out.putU2(i);
}
} else {
out.putU2(0); // attributes_count
}
} else {
out.putU2(0); // attributes_count
// attributes is empty, a 0-element array.
}
} catch (IOException ioe) {
limitHit(ioe);
}