You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bcel-user@jakarta.apache.org by Jean Morissette <je...@videotron.ca> on 2004/08/01 22:26:21 UTC

Analysis of methods

Hi all,
I need to analyse a class (dynamically during classloading or runtime, 
or statically with .java or .class) to identify, for all methods of this 
class, if a method read or update a class field.  How to achieve that? 
Is there some projects that already achieve that?  What are my options?
Thanks for your help
Jean


---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-user-help@jakarta.apache.org


Re: Analysis of methods

Posted by Laurent Martelli <la...@aopsys.com>.
>>>>> "Jean" == Jean Morissette <je...@videotron.ca> writes:

  Jean> Hi all, I need to analyse a class (dynamically during
  Jean> classloading or runtime, or statically with .java or .class)
  Jean> to identify, for all methods of this class, if a method read
  Jean> or update a class field.  How to achieve that? Is there some
  Jean> projects that already achieve that?  What are my options?

I've done this as part of the JAC project: http://jac.objectweb.org/

You may have a look at the fillRTTI method of WrappeeTranslator_BCEL
(see
http://cvs.forge.objectweb.org/cgi-bin/viewcvs.cgi/jac/jac/src/org/objectweb/jac/core/translators/WrappeeTranslator_BCEL.java)

Regards,
Laurent

-- 
Laurent Martelli
laurent@aopsys.com                                Java Aspect Components
http://www.aopsys.com/                          http://jac.objectweb.org


---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-user-help@jakarta.apache.org


Re: Analysis of methods

Posted by Mark Breuer <m...@rkbreuer.de>.
Hi,

I am working on something which does need the same feature. I did'nt succeed 
yet, but it seems as if one has to seek for getfield or putfield commands. 
That's how they are called by Class2HTML.

Regards,

Mark

On Sunday 01 August 2004 22:26, Jean Morissette wrote:
> Hi all,
> I need to analyse a class (dynamically during classloading or runtime,
> or statically with .java or .class) to identify, for all methods of this
> class, if a method read or update a class field.  How to achieve that?
> Is there some projects that already achieve that?  What are my options?
> Thanks for your help
> Jean
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: bcel-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-user-help@jakarta.apache.org


Re: Analysis of methods

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Jean Morissette wrote:
> I need to analyse a class (dynamically during classloading or runtime, 
> or statically with .java or .class) to identify, for all methods of this 
> class, if a method read or update a class field.  How to achieve that? 
> Is there some projects that already achieve that?  What are my options?

The last three links on
  http://cvs.apache.org/~pietsch/
point to a Java file which implements a BCEL 5.0 based analyzer and
associated files. The analyzer tries to determine whether fields
and methods are only accessed by the class itself (allows private
access), subclasses (protected) or other classes, in order to
determine if the declared access class is to broad.
Maybe you can pick something from this. The BCEL 5.1 examples
have similar, possibly simpler code.

J.Pietschmann

---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-user-help@jakarta.apache.org