code: public void replace(ClassNode type) {
          int size = stack.size();
          try {
              if (size==0) throw new ArrayIndexOutOfBoundsException("size==0");
          } catch (ArrayIndexOutOfBoundsException ai) {
              System.err.println("index problem in "+controller.getSourceUnit().getName());
              throw ai;
          }
          stack.set(size-1, type);
      }
docs: replace top level element with new element of given type