예제 #1
0
  public void testPrune() throws Exception {
    CtClass cc = sloader.get("test2.Prune");
    cc.stopPruning(false);
    System.out.println(cc);
    cc.addField(new CtField(CtClass.intType, "f", cc));
    cc.toBytecode();
    try {
      cc.defrost();
      fail("can call defrost()");
    } catch (RuntimeException e) {
      assertTrue(e.getMessage().indexOf("prune") >= 0);
    }

    System.out.println(cc);
  }