Beispiel #1
0
  /** 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();
    }
  }
Beispiel #2
0
  /** 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);
    }
  }
Beispiel #3
0
 /** Constructor. */
 MethodVisitor(MethodGen m, ClassVisitor c) {
   mg = m;
   cv = c;
   cp = mg.getConstantPool();
   cm = cv.getMetrics();
 }