| java.lang.Object sample.evolve.Evolution
Evolution | public class Evolution implements Translator(Code) | | Evolution provides a set of methods for instrumenting bytecodes.
For class evolution, updatable class A is renamed to B. Then an abstract
class named A is produced as the super class of B. If the original class A
has a public method m(), then the abstract class A has an abstract method
m().
abstract class A abstract m() _makeInstance() | class A --------> class B m()
m()
Also, all the other classes are translated so that "new A(i)" in the methods
is replaced with "_makeInstance(i)". This makes it possible to change the
behavior of the instantiation of the class A.
|
latestVersionField | final public static String latestVersionField(Code) | | |
versionManagerMethod | final public static String versionManagerMethod(Code) | | |
makeConcreteClass | protected void makeConcreteClass(CtClass clazz, CtClass abstractClass, int version) throws CannotCompileException, NotFoundException(Code) | | Modifies the given class file so that it is a subclass of the abstract
class produced by makeAbstractClass().
Note: the naming convention must be consistent with
VersionManager.update().
|
|
|