Search in sources :

Example 1 with HotSwapper

use of javassist.util.HotSwapper in project yyl_example by Relucent.

the class JdwpTest method main.

public static void main(String[] args) throws IOException, IllegalConnectorArgumentsException, CannotCompileException, NotFoundException {
    ClassPool pool = ClassPool.getDefault();
    CtClass cc = pool.makeClass("yyl.test.TestClass");
    CtField cf = new CtField(pool.get("java.lang.String"), "name", cc);
    cc.addField(cf);
    HotSwapper hs = new HotSwapper(1234);
    hs.reload(cc.getName(), cc.toBytecode());
    cc.toClass();
}
Also used : HotSwapper(javassist.util.HotSwapper) CtClass(javassist.CtClass) CtField(javassist.CtField) ClassPool(javassist.ClassPool)

Aggregations

ClassPool (javassist.ClassPool)1 CtClass (javassist.CtClass)1 CtField (javassist.CtField)1 HotSwapper (javassist.util.HotSwapper)1