/** Start the method's visit. */ public void start() { if (!mg.isAbstract() && !mg.isNative()) { for (InstructionHandle ih = mg.getInstructionList().getStart(); ih != null; ih = ih.getNext()) { Instruction i = ih.getInstruction(); if (!visitInstruction(i)) i.accept(this); } updateExceptionHandlers(); } }
/** Visit the method's exception handlers. */ private void updateExceptionHandlers() { CodeExceptionGen[] handlers = mg.getExceptionHandlers(); /* Measuring decision: couple exceptions */ for (int i = 0; i < handlers.length; i++) { Type t = handlers[i].getCatchType(); if (t != null) cv.registerCoupling(t); } }
/** Constructor. */ MethodVisitor(MethodGen m, ClassVisitor c) { mg = m; cv = c; cp = mg.getConstantPool(); cm = cv.getMetrics(); }