The thing is that I want the new method to look the same as the original code, 
for that I want to copy the original code.

The problem is that when I use the:
newMethod.setBody(method, null); to copy the original body I need to add the 
following code to fix the MaxLocals:
        CodeAttribute code = newMethod.getMethodInfo().getCodeAttribute();
        code.setMaxLocals(code.getMaxLocals() + 1);

Isn't there a better way?

Guy

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4128207
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to