Bug 76224 - Option to list weaved components
Summary: Option to list weaved components
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-13 20:29 EDT by Gerard Toonstra CLA
Modified: 2005-03-23 08:48 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gerard Toonstra CLA 2004-10-13 20:29:57 EDT
Hi there,

I'm very new to AspectJ. I am considering to use it for security purposes in an 
EJB environment. In my environment, I do compile my code separately from the 
aspects, so that I can always refer to a clean build without aspects. My 
standard code always compiles with javac. The aspects are woven in later using 
aijc. That is because only customers who need the extra security aspects should 
have them woven in. ( since it's overhead ).

I've been looking for a feature where the compiler could output a list of 
classes/methods that had aspects woven into them. That could allow people to 
see easily what classes were touched by the compiler and serves as good 
verification for the build ( is the only other way to know to test that the 
aspect is really in place? ). Diffing against a known file within a build run 
may then log possible errors ( if method attributes/accesses change, etc. ). In 
my case, the actual benefit is that I can use the list to develop my own list 
of access descriptors. That way I may use the fully qualified classname and the 
methodname to add them into my security database. Using the "Signature" class I 
can then easily verify access to that method through other means.

Anyway, I do hope you consider the idea. Thanks for developing such a great 
tool & functionality. I found AspectJ to be the easiest usable around with the 
best documentation for newcomers!

Kind regards,

Gerard
Comment 1 Andrew Clement CLA 2004-10-14 03:50:04 EDT
Does the '-showWeaveInfo' option meet your requirements?  (which has only been
recently added to AspectJ).  If passed on the command line, for example in
building this demo project tjp:

ajc -showWeaveInfo Demo.java GetInfo.java

results in:

Type 'tjp.Demo' (Demo.java:19) advised by around advice from 'tjp.GetInfo'
(GetInfo.java:26) [with runtime test]

Type 'tjp.Demo' (Demo.java:29) advised by around advice from 'tjp.GetInfo'
(GetInfo.java:26) [with runtime test]

Type 'tjp.Demo' (Demo.java:33) advised by around advice from 'tjp.GetInfo'
(GetInfo.java:26) [with runtime test]


---
This option can be also be supplied in the UI (AJDT) in the project properties
AspectJ page.  Or in an imminent dev build of aspectj you can supply it in an
ANT iajc call.

The one piece of information you might be missing is the method name affected -
if you really need it, I could add that to the weaving information produced?
Comment 2 Gerard Toonstra CLA 2004-10-14 11:30:43 EDT
Hi there,

Thanks for that. It would be sufficient at the moment. I don't think my version 
supports it yet ( 1.2 ), but I'll look at it some time later. At the moment I 
am struggling to get Eclipse working efficiently again after downloading AJDT.  
( 100% CPU consumption, infinite loop of some kind, etc. ), for which I might 
file another bug report soon as I get more info what might cause it.

If the method names could be added *easily* than that would be a very good 
addition ( as long as method overloads are distinguishable ). I haven't yet 
been able to run it with the extra info, but does the name of the class include 
the package as well? 

Thanks for the quick reply,

Gerard
Comment 3 Adrian Colyer CLA 2005-03-23 08:48:14 EST
Closing out bug as per last comment from Gerard.