MethodGen.removeLocalVariables() or some similar api will fix you right up.

On 1/23/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Hi,
> I'm trying very simply to encapsulate a method MethodName by renaming
> original method, and create a new one calling the original;
> Very briefly:
>
> MethodGen mgen = new MethodGen( method, name, poolgen);
> cgen.removeMethod(method);
> String oname = mgen.getName()+"_O";
> mgen.setName( oname);
> cgen.addMethod( methgen.getMethod());
>
> Then I create the new method (nothing but call to original one);
>
>
> Unfortunatly Verifier pass2 is in error because local variable table of my
> renamed method has been changed from:
> ....
> LocalVariable(start_pc=33, length=54, index=8:..............
> LocalVariable(start_pc= 89, length = 16, index=8.......
> ....
> to
>
> LocalVariable(start_pc= 89, length = 18, index=8.......
> LocalVariable(start_pc=33, length=56, index=8:..............
>
> giving the error At bytecode offset '89' a local variable has 2 different
> names: 'e' and 'draft'
>
> I don't understand what could happen, please any help would be very
> welcome !
> Thank you
>
> Cordialement / Best regards
>

Reply via email to