[jboss-user] [Javassist user questions] - What is the best way to a add parameters to a method?

jonasb do-not-reply at jboss.com
Sat Nov 18 16:51:05 EST 2006


Hello.

I'm using javassist 3.1, and I want to add parameters to an existing method.

I haven't found anything in the API that supports that, so I've tried to create a new method with the new parameters, and copy the method body over from the old method to the new (by copying over the CodeAttribute).
But when I try to instrument the new method using ExprEditor.edit(NewExpr e) (I want to add a code line after a "new" statement), the "$args" identifier references the NewExpr parameters rather than the method parameters.
This makes me think that the copying ov the method body wasn't done correctly.

Does anyone have a clue?


Thanks / Jonas

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3987107#3987107

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3987107



More information about the jboss-user mailing list