Bug 104075 - LTW Includes Should be Or'ed ... with Patch
Summary: LTW Includes Should be Or'ed ... with Patch
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.5.0 M3   Edit
Assignee: Alexandre Vasseur CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-15 14:57 EDT by Ron Bodkin CLA
Modified: 2012-04-03 15:53 EDT (History)
0 users

See Also:


Attachments
patch to accept includes if none specified or if any match (1.17 KB, patch)
2005-07-15 14:57 EDT, Ron Bodkin CLA
aclement: iplog+
Details | Diff
this version only weaves if there's an include for this weaving container (1.52 KB, patch)
2005-07-15 16:15 EDT, Ron Bodkin CLA
aclement: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ron Bodkin CLA 2005-07-15 14:57:07 EDT
The aj5 developer handbook shows an example that implies that a file should 
match if ANY weaver includes match, not if all of them do. The current code in 
CVS HEAD matches only if all of them match. I think the behavior described in 
the handbook is strongly preferable to requiring all includes to match.

To test this try adding <include within="nowhere"/> into any aop.xml, e.g.,
    <weaver options="-proceedOnError">
        <include within="*..*"/>
        <include within="x"/>
    </weaver>

I have attached a patch to ClassLoaderWeavingAdaptor that fixes this issue.
Comment 1 Ron Bodkin CLA 2005-07-15 14:57:57 EDT
Created attachment 24859 [details]
patch to accept includes if none specified or if any match
Comment 2 Ron Bodkin CLA 2005-07-15 15:33:15 EDT
One additional thought: I think the default case for no includes should be to 
NOT weave. That way if you are loading classes into a classloader environment 
with no definitions (no aop.xml file), it doesn't impose the hit of weaving.

For example, I have an instance of Tomcat with one small Web App in it, which 
has an aop.xml file associated with it. But my Tomcat & system classloader do 
not. With the current rule that no include includes something, (and my first 
patch) start up times for Tomcat with LTW are about three times as long (11 
seconds versus 4.5 seconds) as they are when you only weave into a classloader 
when there are includes. 

An even better approach for this would be allowing no includes to include 
everything but not accepting any classes if there's no aop.xml for this 
classloader (nor a system-wide AJ5 def file). At a minimum, it would be good to 
restore optimized support for the "weave everything" case.

Anyhow, here's another patch that allows includes if any match AND that refuses 
to include anything if no includes exist. 
Comment 3 Ron Bodkin CLA 2005-07-15 16:15:54 EDT
Created attachment 24864 [details]
this version only weaves if there's an include for this weaving container

Significantly speeds up loading when many classes are not being woven (e.g.,
weaving into a Web app but not a container).
Comment 4 Alexandre Vasseur CLA 2005-07-18 05:24:26 EDT
1/ OR the <include ..>
Can we all vote (Andy / Adrian / Jonas).
ie should we AND or OR the <include> in aop.xml ?
I am fine with both. I think we should OR them as Ron suggest (it is like a
list, if someone needs an AND, he can use it in one type pattern)

2/ have <include> mandatory for LTW
Ron suggest that <include within="*"> be mandatory for LTW
the reason is to speed up things.
I don't agree on that one - this makes it cumbersome (and even contradictory
with 1/ if ones want to refine the "*"...). LTW sure needs to be optimized, but
thru other means.
Comment 5 Alexandre Vasseur CLA 2005-07-26 03:47:58 EDT
include is OR (was a bug, not a spec issue)

by default no include means weave ALL and we won't change that

committing in some minutes
remind to close with M3
Comment 6 Alexandre Vasseur CLA 2005-09-27 09:27:07 EDT
was M3 remind
Comment 7 Alexandre Vasseur CLA 2005-09-27 09:28:38 EDT
was M3 remind