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
Yes, the parameter type should be changed as
well.
I ran a test code for confirmation, but it worked.
Can you write a simple test code and send it to
me?