summaryrefslogtreecommitdiffstats
path: root/sample
diff options
context:
space:
mode:
Diffstat (limited to 'sample')
-rw-r--r--sample/evolve/Evolution.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/sample/evolve/Evolution.java b/sample/evolve/Evolution.java
index ad6d1281..110e9332 100644
--- a/sample/evolve/Evolution.java
+++ b/sample/evolve/Evolution.java
@@ -43,22 +43,23 @@ public class Evolution implements Translator {
trapMethod = _pool.getMethod("sample.evolve.Sample", "make");
}
- public void onWrite(ClassPool _pool, CtClass clazz)
+ public void onLoad(ClassPool _pool, String classname)
throws NotFoundException, CannotCompileException
{
- onWriteUpdatable(clazz.getName());
+ onLoadUpdatable(classname);
/*
* Replaces all the occurrences of the new operator with a call
* to _makeInstance().
*/
+ CtClass clazz = _pool.get(classname);
CtClass absClass = updatableClass;
CodeConverter converter = new CodeConverter();
converter.replaceNew(absClass, absClass, handlerMethod);
clazz.instrument(converter);
}
- private void onWriteUpdatable(String classname)
+ private void onLoadUpdatable(String classname)
throws NotFoundException, CannotCompileException
{
// if the class is a concrete class,
@@ -80,7 +81,6 @@ public class Evolution implements Translator {
throw new NotFoundException(classname, e);
}
-
CtClass clazz = pool.getAndRename(orgname, classname);
makeConcreteClass(clazz, updatableClass, version);
}