}
private void addCode(Method[] methods) {
for (int i = 0; i < methods.length; i++) {
Code code = methods[i].getCode();
if(code != null) {
int header = 0;
int maxLocals = code.getMaxLocals();
int maxStack = code.getMaxStack();
CodeException[] exceptions = code.getExceptionTable();
int handlers = exceptions.length;
if(handlers <= 2) {
if (handlers == 0) {
if(maxLocals < 11 && maxStack < 11) {
header = 12*maxLocals + maxStack + 1;
}
} else if (handlers == 1) {
if(maxLocals < 7 && maxStack < 7) {
header = 8*maxLocals + maxStack + 145;
}
} else if (handlers == 2) {
if(maxLocals < 6 && maxStack < 6) {
header = 7*maxLocals + maxStack + 209;
}
}
}
codeHeaders.add(new Integer(header));
if(header == 0) {
codeMaxStack.add(new Integer(maxStack));
codeMaxLocals.add(new Integer(maxLocals));
codeHandlerCount.add(new Integer(handlers));
}
for (int j = 0; j < exceptions.length; j++) {
int startPC = exceptions[j].getStartPC();
int endPC = exceptions[j].getEndPC();
int catchPC = exceptions[j].getHandlerPC();
int[] renumbered = renumberBCI(code.getCode());
int renumberedStart = renumbered[startPC];
int renumberedEnd = renumbered[endPC] - renumberedStart;
int renumberedCatch = renumbered[catchPC] - renumberedEnd;
codeHandlerStartP.add(new Integer(renumberedStart));
codeHandlerEndPO.add(new Integer(renumberedEnd));