0 Replies Latest reply on Sep 29, 2003 5:59 AM by kenken64

    javassist.CannotCompileException: [source error] no such fie

    kenken64

      need advice on this :-

      /**
      *
      * @param clas
      * @param mname
      * @throws NotFoundException
      * @throws CannotCompileException
      */
      private void addTiming(CtClass clas, String mname)
      throws NotFoundException, CannotCompileException {

      // get the method information (throws exception if method with
      // given name is not declared directly by this class, returns
      // arbitrary choice if more than one with the given name)
      CtMethod mold = clas.getDeclaredMethod(mname);
      mold.insertBefore("\nlong start = System.currentTimeMillis();\n");
      mold.insertAfter("log.info(\"Call to method " + mname +
      " took \" +\n (System.currentTimeMillis()-start) + " +
      "\" ms.\");\n", true);
      log.debug(mold.getSignature());
      }