Re: Constructor modification using BCEL

"Vanesa Montagna" <[email protected]> Wed, 23 Aug 2006 10:09:44 -0300
Newsgroups gmane.comp.jakarta.bcel.user
Message-ID <[email protected]>
Me gustaria ayudarte pero no entiendo que necesitas, no manejo muy bien el
ingles, nesecitas modificar el constructor de una clase ????

Saludos

Vanesa


2006/8/23, prashant pandit <[email protected]>:
>
> Hi,
>
> I need help.Autually i want to incert some code to the constructor using
> BCEL.
>
> Eg:Orignal class
> public class HashMap extends AbstractMap
>    implements Map, Cloneable, Serializable
> {
> public HashMap(int i, float f)
>    {
>        entrySet = null;
>        keySet = null;
>        values = null;
>        if(i < 0)
>            throw new IllegalArgumentException("Illegal initial capacity: "
> + i);
>        if(i > 0x40000000)
>            i = 0x40000000;
>        if(f <= 0.0F || Float.isNaN(f))
>            throw new IllegalArgumentException("Illegal load factor: " +
> f);
>        int j;
>        for(j = 1; j < i; j <<= 1);
>        loadFactor = f;
>        threshold = (int)((float)j * f);
>        table = new Entry[j];
>        init();
>    }
> }
>
> After modification using  BCEL
> public class HashMap extends AbstractMap
>    implements Map, Cloneable, Serializable
> {
> public HashMap(int i, float f)
>    {
>        entrySet = null;
>        keySet = null;
>        values = null;
>        if(i < 0)
>            throw new IllegalArgumentException("Illegal initial capacity: "
> + i);
>        if(i > 0x40000000)
>            i = 0x40000000;
>        if(f <= 0.0F || Float.isNaN(f))
>            throw new IllegalArgumentException("Illegal load factor: " +
> f);
>        int j;
>        for(j = 1; j < i; j <<= 1);
>        loadFactor = f;
>        threshold = (int)((float)j * f);
>        table = new Entry[j];
>        init();
> abc.getSomeMethod(this,obj1);// added during constructor transforming
>    }
> }
>
> Please help me out.
>
> regards,
> Prashant
>
>
> ---------------------------------
> Want to be your own boss? Learn how on  Yahoo! Small Business.
>