1 Reply Latest reply on Oct 22, 2003 4:20 AM by Shigeru Chiba

    Changing name of class

    nfsantos Newbie


      I'm having problems changing the name of a class. I have a package with several classes, which contains class A and class B, where class B is something like:

      class B {
      A field;

      public class B(A field) {
      this.field = field;
      ...
      }
      ....
      }

      I'm trying to change the name of class A to C. I call replaceClassName("A", "C") on all classes in the package, including A and B. After this I get something like:

      class B {
      C field;

      public class B(A field) {
      this.field = field;
      ...
      }
      ....
      }

      Notice that the field type was correctly changed, but the parameter in the constructor was not changed at all.

      Is this according to design? Am I doing something wrong? Or is this some bug in Javassist?

      I would appreciate any help.
      Nuno