Re: Search for code and inserting code into a Java bytestream

<[email protected]>
Newsgroups gmane.comp.jakarta.bcel.devel
Message-ID <20020622123800.UGES27460.mailoutvl21@[192.168.139.30]>
Hi,

what you suggest is a typical application of BCEL.
Take a look at the helloify example.

Cheers
  markus

> 
> Von: Huw Evans <[email protected]>
> Datum: 2002/06/20 Do PM 04:24:16 GMT+02:00
> An: [email protected]
> Betreff: Search for code and inserting code into a Java bytestream
> 
> 
> Hello,  I am new to BCEL and have a question about searching for code in a 
> bytestream and adding code once something has been found.
> 
> I would like to search for instances of new for a given type, for example:
> 
>   T t = new T();
> 
> and substitute the following:
> 
>   T t = (T) Utility.create(T.class); // simple case
> 
> In the end I would like to be able to handle all cases, e.g., T() takes 
> arguments to the constructor, and so will need to be able to pass them to 
> create.
> 
> However, at the moment, I am finding it difficult to know where to start with 
> BCEL to find the point where I should start the bytecode manipulation.
> 
> If anyone could point me in the right direction, that would be appreciated.
> 
> Thanks
> 
> Huw Evans
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[email protected]>
> For additional commands, e-mail: <mailto:[email protected]>
> 
> 
--
berlin.de - meine stadt im netz. Jetzt eigene eMail-adresse @berlin.de sichern!
http://webmail.berlin.de

++++++++++++++++++++++++++++++++++++++++++++++++
7 CITIES SUMMER AUCTION

Reisen Sie mit uns durch das Land der grenzenlosen Merkwürdigkeiten. Sieben Städte, zwölf Mitbringsel und noch mehr Erlebnisse. Jeden Montag und Donnerstag eine neue Episode und eine neue Auktion: http://www.BerlinOnline.de/auktion

Präsentiert von BerlinOnline und Lucky Strike Originals
++++++++++++++++++++++++++++++++++++++++++++++++
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.