/** * analysis and data structure per method * * @param method */ private void flowMethod(final MethodNode method) { final InsnList instructions = method.instructions; ControlFlowGraphDataStructure controlFlow = new ControlFlowGraphDataStructure(instructions); for (int idx = 0; idx < instructions.size(); ++idx) { final AbstractInsnNode instruction = instructions.get(idx); controlFlow.appendInstruction(instruction, idx); } controlFlow.dottyPrint(); }
/* (non-Javadoc) * @see ch.usi.inf.gustarim.apt.analysis.SpecificAnalyzer#analyzeMethod(org.objectweb.asm.tree.MethodNode) */ @Override protected Collection<Problem> analyzeMethod(final MethodNode methodNode) { final LinkedList<Problem> problems = new LinkedList<Problem>(); final InsnList instructions = methodNode.instructions; for (int i = 0; i < instructions.size(); i++) { final AbstractInsnNode insnNode = instructions.get(i); if (insnNode.getOpcode() == Opcodes.PUTSTATIC) { final FieldInsnNode field = (FieldInsnNode) insnNode; final String fieldName = field.name; if (!isFinal(fieldName)) { final Problem problem = new Problem(insnNode); problems.add(problem); } } } return problems; }