You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Test.java 369B

1234567891011
  1. import javassist.*;
  2. public class Test {
  3. public static void main(String[] args) throws Exception {
  4. ClassPool cp = ClassPool.getDefault();
  5. CtClass cc = cp.get("test5.DefaultMethod");
  6. CtMethod m = CtNewMethod.make("public int run(){ return test5.DefaultMethodIntf.super.foo(); }", cc);
  7. cc.addMethod(m);
  8. cc.writeFile();
  9. }
  10. }