summaryrefslogtreecommitdiffstats
path: root/sample
diff options
context:
space:
mode:
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2004-04-16 15:12:45 +0000
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2004-04-16 15:12:45 +0000
commita5ddd6104e99fa22a5b1c36f5e3e585400b6e4c7 (patch)
tree8ae21fb63c94b9e58874377a5da414310f807a3c /sample
parentf480c5d9122f26f32fa89f44ea7d606fd3df8557 (diff)
downloadjavassist-a5ddd6104e99fa22a5b1c36f5e3e585400b6e4c7.tar.gz
javassist-a5ddd6104e99fa22a5b1c36f5e3e585400b6e4c7.zip
fixed bugs so that sample programs can run.
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@86 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
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);
}