[jboss-user] [Javassist user questions] - Re: Duplicate a method

chiba do-not-reply at jboss.com
Thu Feb 21 08:38:10 EST 2008

Your way is dangerous.  Suppose the following method:

int foo(int i) {
  int j = 3;
  return j + i;

At the bytecode level, the variable i would be register 1 and j would be register 2.

If you add a parameter k, you must change the bytecode
of the method body so that the variable j will be register
3 because k will be register 2.

Current Javassist does not provide direct support for
adding a new parameter. :-<

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

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

More information about the jboss-user mailing list