Réf. : Re: LocalVariableTable changed on rename !
[email protected] Tue, 24 Jan 2006 17:28:23 +0100
| Newsgroups | gmane.comp.jakarta.bcel.user |
|---|---|
| Message-ID | <OFFDA5BD68.2673ADD0-ONC1257100.005A671E-C1257100.005A8BEB@sddc.fr> |
Hi Andrew, Thank you for your suggestion, it runs now ! Honnestly, I don't really understand why... but it runs ! Thank you for help Cordialement / Best regards Andrew Huntwork <[email protected]> Envoyé par : [email protected] 23/01/2006 17:25 Veuillez répondre à "BCEL Users List" Pour : BCEL Users List <[email protected]> cc : Objet : Re: LocalVariableTable changed on rename ! 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 >