7 Replies Latest reply on Oct 21, 2004 5:51 AM by chiba

    How to write new operator in function body ?

    skyman

      Hi,all,
      i hava a problem about writing new operator in Javassist.
      Here as follows :
      When :
      CtMethod type= CtNewMethod
      .make(
      "public Type getNewType() { return new Type(); }",clas);
      clas.addMethod(type);
      Then i recieve:
      javassist.CannotCompileException: [source error] fatal
      at javassist.CtNewMethod.make(CtNewMethod.java:78)
      at javassist.CtNewMethod.make(CtNewMethod.java:44)

      I think problem is in writing new operator.