diff options
author | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2004-04-14 15:49:55 +0000 |
---|---|---|
committer | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2004-04-14 15:49:55 +0000 |
commit | 3f73777f2cdf408d47bd85417611635235bdd7ed (patch) | |
tree | c0d6156cae1ca72e8ec2f3c36b8b83bcaae30916 /sample/evolve | |
parent | 2d7afcd04b007ef3322b132d82f3f32889414232 (diff) | |
download | javassist-3f73777f2cdf408d47bd85417611635235bdd7ed.tar.gz javassist-3f73777f2cdf408d47bd85417611635235bdd7ed.zip |
modified the ClassPool framework.
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@84 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'sample/evolve')
-rw-r--r-- | sample/evolve/DemoLoader.java | 3 | ||||
-rw-r--r-- | sample/evolve/Evolution.java | 5 |
2 files changed, 3 insertions, 5 deletions
diff --git a/sample/evolve/DemoLoader.java b/sample/evolve/DemoLoader.java index 1d8c33f9..f1474a1f 100644 --- a/sample/evolve/DemoLoader.java +++ b/sample/evolve/DemoLoader.java @@ -31,9 +31,8 @@ public class DemoLoader { public static void main(String[] args) throws Throwable { Evolution translator = new Evolution(); ClassPool cp = ClassPool.getDefault(); - cp.addTranslator(translator); Loader cl = new Loader(); - cl.setClassPool(cp); + cl.addTranslator(cp, translator); translator.makeUpdatable("sample.evolve.WebPage"); cl.run("sample.evolve.DemoServer", args); diff --git a/sample/evolve/Evolution.java b/sample/evolve/Evolution.java index 810f1986..ad6d1281 100644 --- a/sample/evolve/Evolution.java +++ b/sample/evolve/Evolution.java @@ -43,16 +43,15 @@ public class Evolution implements Translator { trapMethod = _pool.getMethod("sample.evolve.Sample", "make");
}
- public void onWrite(ClassPool _pool, String classname)
+ public void onWrite(ClassPool _pool, CtClass clazz)
throws NotFoundException, CannotCompileException
{
- onWriteUpdatable(classname);
+ onWriteUpdatable(clazz.getName());
/*
* 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);
|