Bug 119751 - ajc gives message of weaving, but did not actually weaved
Summary: ajc gives message of weaving, but did not actually weaved
Status: RESOLVED INVALID
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.2.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-07 17:12 EST by Michelle Xue CLA
Modified: 2006-05-10 11:00 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michelle Xue CLA 2005-12-07 17:12:51 EST
I try to run ajc on hibernate3.jar with option "-injars", "-outjars" programatically.  And I check IMessage, it says something advised by something, so it shows that it's weaving, but it didn't weave anything into the jar.  I also check IMessage.isAbort()||IMessage.isFailed(), it's false.  However, IMessage.isError() is true, and the message is "cannot resolve ...".  I know sometimes there is resolution problem, but I think it should still weave, otherwise, it shouldn't output message that some class is already advised by some pointuct.
Comment 1 Andrew Clement CLA 2005-12-08 03:54:10 EST
What happens if you *don't* use -outjar ?  do you find that you get *some* classes out, i.e. the ones that did successfully weave?  If there is an error during weaving we don't produce an outjar if you use that option (I believe) - why would you want a half finished jar?

Cannot resolve <type> messages come out when the compiler needs to know something in order to determine whether to advise something, if an incomplete set of types is supplied, the weaver cannot do its job correctly.
Comment 2 Michelle Xue CLA 2005-12-08 12:40:55 EST
You mean if I don't use the option "-outjar", instead, I use option "-d", it will output the some classes that are successfully weaved?

But is it a bug when "-outjar" output something, and the message says some code are being advised, but it's not actually weaved? User would think the jar is being weaved on the things that ajc says it did.  I think ajc should output the jars that have the classes that are weaved successfully and the classes that are not weaved because of resolution problem.

When ajc has some resolution problems, it just does not advice on things that it cannot resolve, which is fine, because it still does advice correctly on the things it can resolve.  From my experience using aspectJ, the things it cannot resolve are the things I don't care.  A use case would be I am using a third party jar, I want to weave something to it.  There will definitely be resolution problem with third party library, however, I can see the ajc message and verify what's being advised, and decide if I am happy with it or not, and usually I am happy with the result even though ajc cannot resolve everything.
Comment 3 Wes Isberg CLA 2006-05-10 11:00:07 EDT
If the compile/weave fails with an error, then the user should not expect anything from the output since the process was halted.  The messages about types being woven are produced as the process proceeds (esp. for debugging purposes), but they mean the types were affected but not necessarily output.  Ideally, no classes would be produced either, but that's a different bug.  We should perhaps document this.
stalebug