diff options
author | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2003-10-10 06:15:50 +0000 |
---|---|---|
committer | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2003-10-10 06:15:50 +0000 |
commit | 2799b5c40f6b336ef8bc1b44295a4996dfb2e723 (patch) | |
tree | 134bac41e8509ba795c66494c38069785b73c87b /src/main/javassist/compiler/Javac.java | |
parent | ff4f2c43c1fbba039e4c905a56f5706ed7cc4724 (diff) | |
download | javassist-2799b5c40f6b336ef8bc1b44295a4996dfb2e723.tar.gz javassist-2799b5c40f6b336ef8bc1b44295a4996dfb2e723.zip |
made javassist.expr.MethodCall#replace correctly work
with super's method calls.
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@53 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src/main/javassist/compiler/Javac.java')
-rw-r--r-- | src/main/javassist/compiler/Javac.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/main/javassist/compiler/Javac.java b/src/main/javassist/compiler/Javac.java index e0bf3428..44c3ff11 100644 --- a/src/main/javassist/compiler/Javac.java +++ b/src/main/javassist/compiler/Javac.java @@ -384,6 +384,39 @@ public class Javac { } /** + * Prepares to use $proceed() representing a private/super's method. + * If the return type of $proceed() is void, null is pushed on the + * stack. This method is for methods invoked by INVOKESPECIAL. + * + * @param target an expression specifying the target object. + * if null, "this" is the target. + * @param classname the class name declaring the method. + * @param methodname the method name. + * @param descriptor the method descriptor. + */ + public void recordSpecialProceed(String target, String classname, + String methodname, String descriptor) + throws CompileError + { + Parser p = new Parser(new Lex(target)); + final ASTree texpr = p.parseExpression(stable); + final String cname = classname; + final String method = methodname; + final String desc = descriptor; + + ProceedHandler h = new ProceedHandler() { + public void doit(JvstCodeGen gen, Bytecode b, ASTList args) + throws CompileError + { + gen.compileInvokeSpecial(texpr, + cname, method, desc, args); + } + }; + + gen.setProceedHandler(h, proceedName); + } + + /** * Prepares to use $proceed(). */ public void recordProceed(ProceedHandler h) { |