0 Replies Latest reply on Mar 30, 2009 10:26 AM by Laurent Michenaud

    attempted  duplicate class definition for name:

    Laurent Michenaud Newbie

      Hi,

      I would like to know it is possible to modify
      a class that has been already loaded.

      My test case :

      MyClass myClass = new MyClass();
      ClassPool pool = ClassPool.getDefault();
      CtClass cc = pool.get("MyClass");
      //make some changes
      cc.toClass();


      It faults with :
      Caused by: java.lang.LinkageError: loader (instance of sun/misc/Launcher$AppClassLoader): attempted duplicate class definition for name: "MyClass"