if (codeAttr.getAttributes() != null) {
lnAttr = codeAttr.getAttributes().getLineNumberTable();
lvs = codeAttr.getAttributes().getLocalVariableTable();
}
Code code = codeAttr.getCode();
DecompilationContext dc = code.createDecompilationContext();
dc.setPosition(0);
for (Instruction instruction : code.getInstructions()) {
if (instruction instanceof Label) {
LabelRow lr = new LabelRow((Label) instruction, mdr);
lr.setParentCode(code);
this.rows.add(lr);
mdr.addCodeRow(lr);
} else {
int lineNumber = -1;
if (lnAttr != null) {
lineNumber = lnAttr.getLineNumber(dc.getPosition());
}
if (lvs != null) {
List locals = lvs
.getLocalVariable(dc.getPosition());
for (int k = 0; k < locals.size(); k++) {
LocalVariable lv = (LocalVariable) locals
.get(k);
LocalVariableDefRow lvdr = new LocalVariableDefRow(
lv, mdr);
this.rows.add(lvdr);
mdr.addLocalVariable(lvdr);
}
}
CodeRow cd = new CodeRow(cf, mdr, instruction);
cd.setPosition(dc.getPosition());
cd.setDecompilationContext(dc);
cd.setParentCode(code);
cd.setBreakpoint(EditorFacade.getInstance()
.getBreakpoint(cf.getFullClassName(),
method.getName(),
method.getDescriptor(),
dc.getPosition()));
if (lineNumber != -1) {
cd.setLineNumber(lineNumber);
}
this.rows.add(cd);
mdr.addCodeRow(cd);
dc.incrementPosition(instruction);
}
}
this.rows.add(new MethodDefRow(cf, method, false, true));