ic.setFilename(filename);
agent.processFile(filename);
if (!filename.endsWith(".class"))
continue;
try {
ClassFile cf = this.project.getClassFile(filename);
ic.setCf(cf);
agent.processClass(ic, cf);
ConstantPool cp = cf.getPool();
for (int i=0; i < cp.size(); i++) {
ConstantPoolInfo cpi = cp.get(i);
if (cpi != null) {
agent.processConstantPoolInfo(ic, cpi);
}
}
List<Interface> interfaces = cf.getInterfaces();
for (Interface interface0 : interfaces) {
agent.processInterface(ic, interface0.getName());
}
List<Field> fields = cf.getFields();
for (Field field : fields) {
ic.setField(field);
agent.processField(ic, field);
}
List<Method> methods = cf.getMethods();
for (Method method : methods) {
ic.setMethod(method);
agent.processMethod(ic, method);
CodeAttribute ca = method.getAttributes().getCode();
ic.setCodeAttribute(ca);
if (ca != null) {
processAttributes(ic, ca.getAttributes(), agent);
}
// method variables
LocalVariableTableAttribute lvt = null;
if (ca != null) {
lvt = ca.getAttributes().getLocalVariableTable();
}
if (lvt != null) {
List<LocalVariable> lvs = lvt.getLocalVariables();
for (LocalVariable lv : lvs) {
agent.processLocalVariable(ic, lv);
}
}
// method code
Code code = null;
if (ca != null)
code = ca.getCode();
if (code != null) {
DecompilationContext dc = code
.createDecompilationContext();
ic.setDc(dc);
dc.setPosition(0);
List<Instruction> instructions = code.getInstructions();
for (Instruction instruction : instructions) {
agent.processInstruction(ic, instruction);
dc.incrementPosition(instruction);
}
}
processAttributes(ic, method.getAttributes(), agent);
}
processAttributes(ic, cf.getAttributes(), agent);
agent.postProcessFile(ic);
} catch (Exception ex) {
ex.printStackTrace();
agent.processException(ex);