<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:old.nabble.com,2006:forum-2216</id>
	<title>Nabble - AspectJ</title>
	<updated>2009-12-05T14:33:55Z</updated>
	<link rel="self" type="application/atom+xml" href="http://old.nabble.com/AspectJ-f2216.xml" />
	<link rel="alternate" type="text/html" href="http://old.nabble.com/AspectJ-f2216.html" />
	<subtitle type="html">AspectJ is a seamless aspect-oriented extension to the Java programming language that enables clean modularization of crosscutting concerns, such as error checking and handling, synchronization, context-sensitive behavior, performance optimizations, monitoring and logging, debugging support, and multi-object protocols. AspectJ home is &lt;a href=&quot;http://www.eclipse.org/aspectj/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.</subtitle>
	
<entry>
	<id>tag:old.nabble.com,2006:post-26660094</id>
	<title>Are you loadtime weaving? What do your include/exclude patterns look like?</title>
	<published>2009-12-05T14:33:55Z</published>
	<updated>2009-12-05T14:33:55Z</updated>
	<author>
		<name>Andy Clement</name>
	</author>
	<content type="html">At the moment AspectJ optimizes for only a couple of include/exclude
&lt;br&gt;patterns - I'd like to optimize some more and am collecting input on
&lt;br&gt;what patterns people are using?
&lt;br&gt;&lt;br&gt;Here is an example aop.xml file
&lt;br&gt;&lt;br&gt;&amp;lt;aspectj&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;lt;aspects&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;lt;aspect name=&amp;quot;Logging&amp;quot;/&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;lt;/aspects&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;lt;weaver options=&amp;quot;-verbose&amp;quot;&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;include within=&amp;quot;javax..*&amp;quot;/&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;include within=&amp;quot;org.aspectj.*&amp;quot;/&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;include within=&amp;quot;@NoWeave *&amp;quot;/&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;exclude within=&amp;quot;bar.*&amp;quot;/&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;lt;/weaver&amp;gt;
&lt;br&gt;&amp;lt;/aspectj&amp;gt;
&lt;br&gt;&lt;br&gt;I'm interested in the kind of thing you might be specifying as within
&lt;br&gt;patterns in the weaver include/exclude settings.
&lt;br&gt;&lt;br&gt;AspectJ currently optimizes for com.foo.* and com.foo..* style
&lt;br&gt;patterns *only*. &amp;nbsp;Are you:
&lt;br&gt;- using annotations?
&lt;br&gt;- using compound patterns with AND/OR/NOT?
&lt;br&gt;- doing something funky?
&lt;br&gt;&lt;br&gt;I guess I'm also interested in how many you have - just a couple? 10? 50?
&lt;br&gt;&lt;br&gt;Let me know and if there look like some very popular patterns that
&lt;br&gt;seem worth trying to speed up, I'll try and do so for 1.6.7
&lt;br&gt;&lt;br&gt;cheers,
&lt;br&gt;Andy
&lt;br&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26660094&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Are-you-loadtime-weaving--What-do-your-include-exclude-patterns-look-like--tp26660094p26660094.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26643346</id>
	<title>Re: jenia - capture method</title>
	<published>2009-12-04T06:31:16Z</published>
	<updated>2009-12-04T06:31:16Z</updated>
	<author>
		<name>Simone Gianni-2</name>
	</author>
	<content type="html">Hi Jenia,
&lt;br&gt;the method itself can be accessed using the AspectJ reflection API :
&lt;br&gt;&lt;br&gt;pointcut anymethod() : call(* * *.*(..));
&lt;br&gt;&lt;br&gt;before() : anymethod() {
&lt;br&gt;&amp;nbsp; &amp;nbsp; MethodSignature sig = 
&lt;br&gt;(MethodSignature)thisJoinPointStaticPart.getSignature();
&lt;br&gt;&amp;nbsp; &amp;nbsp; Method m = sig.getMethod();
&lt;br&gt;&amp;nbsp; &amp;nbsp; // Use m as you want to
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;Hope this helps,
&lt;br&gt;Simone
&lt;br&gt;&lt;br&gt;ivlev jenia wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I want to capture the method for which the joinpoint is executed.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; pointcut anymethod(method m):call(* * *.*(..))&amp;&amp;target(m)
&lt;br&gt;&amp;gt; But this doesnt work ofcourse.
&lt;br&gt;&amp;gt; So my question is: how can I capture the method?
&lt;br&gt;&amp;gt; Thank you for your kind concern.
&lt;br&gt;&amp;gt; Jenia
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ------------------------------------------------------------------------
&lt;br&gt;&amp;gt; The new Internet Explorer® 8 - Faster, safer, easier. Optimized for 
&lt;br&gt;&amp;gt; Yahoo! *Get it Now for Free!* 
&lt;br&gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://downloads.yahoo.com/ca/internetexplorer/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://downloads.yahoo.com/ca/internetexplorer/&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; ------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; aspectj-users mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26643346&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Simone Gianni &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CEO Semeru s.r.l. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Apache Committer
&lt;br&gt;&lt;a href=&quot;http://www.simonegianni.it/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.simonegianni.it/&lt;/a&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26643346&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/jenia---capture-method-tp26637065p26643346.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26637065</id>
	<title>jenia - capture method</title>
	<published>2009-12-03T18:36:50Z</published>
	<updated>2009-12-03T18:36:50Z</updated>
	<author>
		<name>jenia.i</name>
	</author>
	<content type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;div style=&quot;font-family:times new roman,new york,times,serif;font-size:12pt&quot;&gt;&lt;div&gt;I want to capture the method for which the joinpoint is executed.&lt;br&gt;&lt;br&gt;pointcut anymethod(method m):call(* * *.*(..))&amp;amp;&amp;amp;target(m)&lt;br&gt;But this doesnt work ofcourse.&lt;br&gt;So my question is: how can I capture the method?&lt;br&gt;Thank you for your kind concern.&lt;br&gt;Jenia&lt;br&gt;&lt;/div&gt;
&lt;!-- cg7.c2.mail.re1.yahoo.com compressed/chunked Thu Dec  3 18:28:22 PST 2009 --&gt;
&lt;/div&gt;&lt;br&gt;



      &lt;hr size=1&gt;The new Internet Explorer® 8 - Faster, safer, easier.  Optimized for Yahoo! &lt;a href=&quot;http://downloads.yahoo.com/ca/internetexplorer/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;&lt;b&gt;Get it Now for Free!&lt;/b&gt;&lt;/a&gt;&lt;/body&gt;&lt;/html&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26637065&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/jenia---capture-method-tp26637065p26637065.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26634100</id>
	<title>Re: Generated AjcClosure classes</title>
	<published>2009-12-03T14:07:40Z</published>
	<updated>2009-12-03T14:07:40Z</updated>
	<author>
		<name>Andrica Silviu</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;&lt;br&gt;thanks for the code. Half an hour after sending you the mail, and reading more code, I came up with the same solution, basically, which means I was right :).
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Silviu
&lt;br&gt;On Dec 3, 2009, at 3:44 PM, Simone Gianni wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi Silviu,
&lt;br&gt;&amp;gt; in Magma I'm using the following :
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; public class AspectJClassTransformer extends ClassLoader implements 
&lt;br&gt;&amp;gt; ClassTransformer, WeavingClassLoader {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;// Various method of a classloader
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;// ....
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;// Implements GeneratedClassHandler.acceptClass
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;public void acceptClass(String name, byte[] bytes) {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.out.println(&amp;quot;AspectJ pushed &amp;quot; + name);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;// ....
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; On system out, i see :
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; AspectJ weaving org.apache.magma.settings.SettingsHolder
&lt;br&gt;&amp;gt; AspectJ pushed org.apache.magma.settings.SettingsHolder$AjcClosure1
&lt;br&gt;&amp;gt; AspectJ pushed org.apache.magma.settings.SettingsHolder$AjcClosure3
&lt;br&gt;&amp;gt; AspectJ pushed org.apache.magma.settings.SettingsHolder$AjcClosure5
&lt;br&gt;&amp;gt; AspectJ pushed org.apache.magma.settings.SettingsHolder$AjcClosure7
&lt;br&gt;&amp;gt; AspectJ pushed org.apache.magma.settings.SettingsHolder$AjcClosure9
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; So, in a class loader system, the accept method receives closures. I 
&lt;br&gt;&amp;gt; don't do anything special with them (except defining them in my current 
&lt;br&gt;&amp;gt; classloader). As i said before, I don't know if in an agent the same 
&lt;br&gt;&amp;gt; rules apply.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Simone
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Andrica Silviu wrote:
&lt;br&gt;&amp;gt;&amp;gt; Ciao Simone,
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; could you give me a clue on how to catch the newly created closures?
&lt;br&gt;&amp;gt;&amp;gt; I was playing with Aj and its source code, but it seems that no matter what I try I cannot get it to work. The &amp;quot;accept&amp;quot; method I use only catches the original classes, never their closures.
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; Thanks a lot,
&lt;br&gt;&amp;gt;&amp;gt; Silviu
&lt;br&gt;&amp;gt;&amp;gt; On Dec 2, 2009, at 9:54 PM, Simone Gianni wrote:
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Andy Clement wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; You know, I'm on the verge of creating such a thing in AspectJ
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; itself... I would be interested to here about your approach and how
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; you know when to invalidate the cache, and what are you using as the
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; cache key (some combination of the class itself hashed or something,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; plus the combination of aspects defined at the time, hashed or
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; something?)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Hi Andy and Silviu,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I'm very happy you're planning such an improvement!
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I also tried to cache LTW classes, but did not find a way to invalidate 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; the right classes : when an aspect was somehow added, removed or 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; modified, I invalidated the entire cache and started from scratch, even 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; if probably only a few classes need reweaving. If a single comma was 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; added in a string in a single ITD, despite being a single byte 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; modification in a single class file, I had no option that reweaving 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; everything.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I tried to use AspectJ matching system to know which aspects applied to 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; a given class, so that I could invalidate only classes affected by a 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; changed aspect. I can't remember how much I managed to do this, but even 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; if I managed to, I could not know if a changed aspect only modified it's 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; advice implementation or also it's &amp;quot;matching part&amp;quot;, that is point cuts.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; If however it was possible to know whether an aspect changed its point 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; cuts or only its advice implementation (which happens most of the time, 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; especially when ITDs are used), it could be possible to invalidate only 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; classes that were matched by that aspect, and invalidate the full cache 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; only when the point cuts are changed.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Applying the existing matching system is not a valid solution, cause 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; matching is the slowest part of the weaving process, and having to use 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; it to decide whether to invalidate a class or not makes the cache slower 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; than a full reweave.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; So, I think, the cache should save, as a state, not only the hashes of 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; defined aspects, but hashes of the point cuts of defined aspects. If 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; those are not changed (implicitly, no aspect has been added or removed), 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; then the model is still valid, and only classes affected by the modified 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; aspects needs to be reweaved to apply modified advice implementation.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; If AspectJ did this itself then the only user configuration would be a
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; place to keep these woven classes so that they can be retrieved later.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Do you have any specific requirements for the cache in your scenario?
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; (or does anyone else reading this have requirements on a cache like
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; this?)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; This would be great and enough for my needs. Later probably a listener 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; on the cache could be useful, to integrate it in the case of a chain of 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; transforming classloaders like when there is AspectJ + JPA or similar 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; situations.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Simone
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; -- 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Simone Gianni &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CEO Semeru s.r.l. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Apache Committer
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://www.simonegianni.it/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.simonegianni.it/&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; aspectj-users mailing list
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26634100&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt;&amp;gt; aspectj-users mailing list
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26634100&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; -- 
&lt;br&gt;&amp;gt; Simone Gianni &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CEO Semeru s.r.l. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Apache Committer
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.simonegianni.it/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.simonegianni.it/&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; aspectj-users mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26634100&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;/div&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26634100&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Generated-AjcClosure-classes-tp26607890p26634100.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26634020</id>
	<title>Re: Memory consumption problems</title>
	<published>2009-12-03T14:03:15Z</published>
	<updated>2009-12-03T14:03:15Z</updated>
	<author>
		<name>Andy Clement</name>
	</author>
	<content type="html">Hi Tim,
&lt;br&gt;&lt;br&gt;I'll grab those files when I can (rapidshare isn't playing ball right
&lt;br&gt;now). &amp;nbsp;1.6.7 dumps are what I need, too much has changed since 1.6.2
&lt;br&gt;so they wouldn't be as much help.
&lt;br&gt;&lt;br&gt;&amp;gt; I did, and the heap size even increased compared to a version of 1.6.6.
&lt;br&gt;&amp;gt; The Full GC issues we're having right now are with version 1.6.2.
&lt;br&gt;&lt;br&gt;The changes for 1.6.7 may increase some temporary memory usage but all
&lt;br&gt;the newly cached 'stuff' is only reachable via weak references and so
&lt;br&gt;collectable whenever the system needs the memory. &amp;nbsp;At least that is
&lt;br&gt;how I see it all behaving in my test setup (tomcat plus SpringTravel
&lt;br&gt;web application - the spring aspect library is in the mix too).
&lt;br&gt;&lt;br&gt;&amp;gt; What are ITD's?
&lt;br&gt;&lt;br&gt;Intertype declarations, sometimes called static crosscutting (where
&lt;br&gt;advice/pointcuts are dynamic crosscutting). &amp;nbsp;For example:
&lt;br&gt;&lt;br&gt;aspect X {
&lt;br&gt;&amp;nbsp; int Foo.x &amp;nbsp;// create a new field in Foo called 'x'
&lt;br&gt;&amp;nbsp; int Foo.m() { return 42; } // create a new method in Foo returning an int
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;&amp;gt; For one module we're just using @Configurable and Spring aspects on domain
&lt;br&gt;&amp;gt; classes.
&lt;br&gt;&amp;gt; For another module we have aspects for logging and accounting and stuff.
&lt;br&gt;&amp;gt; We can see the symptoms when we just deploy the module with @Configurable
&lt;br&gt;&amp;gt; already.
&lt;br&gt;&amp;gt; It just gets worse when other modules are deployed (because this just means
&lt;br&gt;&amp;gt; more classes to be contained in the World map I think)
&lt;br&gt;&lt;br&gt;Certainly as more gets woven, more will make it into the world, but it
&lt;br&gt;should all be garbage collectable. &amp;nbsp;It can depend how your VM treats
&lt;br&gt;references - I see a lot of variation. &amp;nbsp;In my testing I attach a
&lt;br&gt;jconsole/yourkit and keep battering 'Run GC' until I finally see them
&lt;br&gt;all going, but that can take up to a minute or 30/40 GCs (stupid
&lt;br&gt;thing). &amp;nbsp;However, if you say the heap is showing them anchored from
&lt;br&gt;the root then something else must be up. I'll take a look.
&lt;br&gt;&lt;br&gt;Did you think you did or did not want to weave the JSPs? I'm still
&lt;br&gt;toying with adding the necessary options to prevent weavers for
&lt;br&gt;certain types of classloader.
&lt;br&gt;&lt;br&gt;Andy
&lt;br&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26634020&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Memory-consumption-problems-tp18649090p26634020.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26632116</id>
	<title>Re: AspectJ and code coverage?</title>
	<published>2009-12-03T11:54:05Z</published>
	<updated>2009-12-03T11:54:05Z</updated>
	<author>
		<name>Wim Deblauwe</name>
	</author>
	<content type="html">I will be most grateful Simone! Enjoy your holiday :)&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;2009/12/3 Simone Gianni &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26632116&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;simoneg@...&lt;/a&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
Hi Wim,&lt;br&gt;
I didn&amp;#39;t forget about you, I have &amp;quot;Add an example pom.xml for AspectJ + Cobertura on aj wiki&amp;quot; on my todo list, but found no time yet to do it .. hopefully I&amp;#39;ll manage to find time on Monday cause it&amp;#39;s holiday here in Italy.&lt;br&gt;

&lt;br&gt;
Simone&lt;br&gt;
&lt;br&gt;
Wim Deblauwe wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;&lt;div class=&quot;im&quot;&gt;
Would it be possible to provide a sample project with pom.xml on how to do it? Maybe this can be added to some wiki if there is one of aspectj or you can add it to the mavenuser wiki?&lt;br&gt;
&lt;br&gt;&lt;/div&gt;
2009/11/30 Simone Gianni &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26632116&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;simoneg@...&lt;/a&gt; &amp;lt;mailto:&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26632116&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;simoneg@...&lt;/a&gt;&amp;gt;&amp;gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;
&lt;br&gt;
&lt;br&gt;
    Hi Wim,&lt;br&gt;
    I&amp;#39;m using Maven2 + AspectJ + Cobertura successfully, but there are&lt;br&gt;
    a few caveats.&lt;br&gt;
&lt;br&gt;
    I&amp;#39;m currently weaving first and then instrumenting with cobertura.&lt;br&gt;
    If I remember correctly, I&amp;#39;m cobertura-instrumenting the entire&lt;br&gt;
    jar. I could do this cause in our setup coverage reports are&lt;br&gt;
    executed in a separate step, when generating the project site.&lt;br&gt;
    Since AspectJ inlines a few calls inside methods using &amp;quot;line 1&amp;quot; of&lt;br&gt;
    the target class file, or the first line of the method, you&amp;#39;ll see&lt;br&gt;
    cobertura reporting a lot of hits on this lines, even if they does&lt;br&gt;
    not contain any apparently useful code. This may confuse who is&lt;br&gt;
    used to cobertura reports and not aware of AspectJ internals, but&lt;br&gt;
    can be interpreted as useful informations cause you may understand&lt;br&gt;
    how many instructions are executed because of AspectJ aspect lookup.&lt;br&gt;
&lt;br&gt;
    I also set up a &amp;quot;load time cobertura instrumentation&amp;quot;, that goes&lt;br&gt;
    in pair with load time weaving, but in that case if an entire&lt;br&gt;
    class does not get loaded, cobertura knows nothing about it, which&lt;br&gt;
    alters the global coverage measurements, so I dropped it.&lt;br&gt;
&lt;br&gt;
    If you have a specific error, I can try to investigate it.&lt;br&gt;
&lt;br&gt;
    Simone&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
    Wim Deblauwe wrote:&lt;br&gt;
&lt;br&gt;
        Hi,&lt;br&gt;
&lt;br&gt;
        is there anybody who is using AspectJ with a code coverage&lt;br&gt;
        tool. We are using Cobertura and Maven2, but that does not&lt;br&gt;
        work when you start to add an aspect to your code and you need&lt;br&gt;
        to use the ajc compiler. I just checked with Atlassian and&lt;br&gt;
        Clover cannot seem to manage it according to them. Anybody&lt;br&gt;
        knows a workaround? I don&amp;#39;t want to have code coverage on the&lt;br&gt;
        aspect, I just don&amp;#39;t want to loose the coverage on my regular&lt;br&gt;
        java classes.&lt;br&gt;
&lt;br&gt;
        regards,&lt;br&gt;
&lt;br&gt;
        Wim&lt;br&gt;
        ------------------------------------------------------------------------&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
        _______________________________________________&lt;br&gt;
        aspectj-users mailing list&lt;br&gt;&lt;/div&gt;&lt;/div&gt;
        &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26632116&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt; &amp;lt;mailto:&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26632116&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;&amp;gt;&lt;div class=&quot;im&quot;&gt;&lt;br&gt;

        &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;
         &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
    --     Simone Gianni            CEO Semeru s.r.l.           Apache Committer&lt;br&gt;
    &lt;a href=&quot;http://www.simonegianni.it/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://www.simonegianni.it/&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
    _______________________________________________&lt;br&gt;
    aspectj-users mailing list&lt;br&gt;&lt;/div&gt;
    &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26632116&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt; &amp;lt;mailto:&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26632116&amp;i=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;&amp;gt;&lt;div class=&quot;im&quot;&gt;&lt;br&gt;
    &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
------------------------------------------------------------------------&lt;br&gt;
&lt;br&gt;
_______________________________________________&lt;br&gt;
aspectj-users mailing list&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26632116&amp;i=7&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;
  &lt;br&gt;
&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;
&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
Simone Gianni            CEO Semeru s.r.l.           Apache Committer&lt;br&gt;
&lt;a href=&quot;http://www.simonegianni.it/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://www.simonegianni.it/&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
_______________________________________________&lt;br&gt;
aspectj-users mailing list&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26632116&amp;i=8&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26632116&amp;i=9&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/AspectJ-and-code-coverage--tp26551154p26632116.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26627160</id>
	<title>Re: AspectJ and code coverage?</title>
	<published>2009-12-03T06:49:52Z</published>
	<updated>2009-12-03T06:49:52Z</updated>
	<author>
		<name>Simone Gianni-2</name>
	</author>
	<content type="html">Hi Wim,
&lt;br&gt;I didn't forget about you, I have &amp;quot;Add an example pom.xml for AspectJ + 
&lt;br&gt;Cobertura on aj wiki&amp;quot; on my todo list, but found no time yet to do it .. 
&lt;br&gt;hopefully I'll manage to find time on Monday cause it's holiday here in 
&lt;br&gt;Italy.
&lt;br&gt;&lt;br&gt;Simone
&lt;br&gt;&lt;br&gt;Wim Deblauwe wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Would it be possible to provide a sample project with pom.xml on how 
&lt;br&gt;&amp;gt; to do it? Maybe this can be added to some wiki if there is one of 
&lt;br&gt;&amp;gt; aspectj or you can add it to the mavenuser wiki?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 2009/11/30 Simone Gianni &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26627160&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;simoneg@...&lt;/a&gt; &amp;lt;mailto:&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26627160&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;simoneg@...&lt;/a&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; Hi Wim,
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; I'm using Maven2 + AspectJ + Cobertura successfully, but there are
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; a few caveats.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; I'm currently weaving first and then instrumenting with cobertura.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; If I remember correctly, I'm cobertura-instrumenting the entire
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; jar. I could do this cause in our setup coverage reports are
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; executed in a separate step, when generating the project site.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; Since AspectJ inlines a few calls inside methods using &amp;quot;line 1&amp;quot; of
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; the target class file, or the first line of the method, you'll see
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; cobertura reporting a lot of hits on this lines, even if they does
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; not contain any apparently useful code. This may confuse who is
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; used to cobertura reports and not aware of AspectJ internals, but
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; can be interpreted as useful informations cause you may understand
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; how many instructions are executed because of AspectJ aspect lookup.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; I also set up a &amp;quot;load time cobertura instrumentation&amp;quot;, that goes
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; in pair with load time weaving, but in that case if an entire
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; class does not get loaded, cobertura knows nothing about it, which
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; alters the global coverage measurements, so I dropped it.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; If you have a specific error, I can try to investigate it.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; Simone
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; Wim Deblauwe wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Hi,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; is there anybody who is using AspectJ with a code coverage
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tool. We are using Cobertura and Maven2, but that does not
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; work when you start to add an aspect to your code and you need
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; to use the ajc compiler. I just checked with Atlassian and
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Clover cannot seem to manage it according to them. Anybody
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; knows a workaround? I don't want to have code coverage on the
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; aspect, I just don't want to loose the coverage on my regular
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; java classes.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; regards,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Wim
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _______________________________________________
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; aspectj-users mailing list
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26627160&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt; &amp;lt;mailto:&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26627160&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; -- 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; Simone Gianni &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CEO Semeru s.r.l. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Apache Committer
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.simonegianni.it/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.simonegianni.it/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; _______________________________________________
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; aspectj-users mailing list
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26627160&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt; &amp;lt;mailto:&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26627160&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; aspectj-users mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26627160&amp;i=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Simone Gianni &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CEO Semeru s.r.l. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Apache Committer
&lt;br&gt;&lt;a href=&quot;http://www.simonegianni.it/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.simonegianni.it/&lt;/a&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26627160&amp;i=7&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/AspectJ-and-code-coverage--tp26551154p26627160.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26627081</id>
	<title>Re: Generated AjcClosure classes</title>
	<published>2009-12-03T06:44:59Z</published>
	<updated>2009-12-03T06:44:59Z</updated>
	<author>
		<name>Simone Gianni-2</name>
	</author>
	<content type="html">Hi Silviu,
&lt;br&gt;in Magma I'm using the following :
&lt;br&gt;&lt;br&gt;public class AspectJClassTransformer extends ClassLoader implements 
&lt;br&gt;ClassTransformer, WeavingClassLoader {
&lt;br&gt;&amp;nbsp; &amp;nbsp; // Various method of a classloader
&lt;br&gt;&amp;nbsp; &amp;nbsp; // ....
&lt;br&gt;&amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; // Implements GeneratedClassHandler.acceptClass
&lt;br&gt;&amp;nbsp; &amp;nbsp; public void acceptClass(String name, byte[] bytes) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&amp;quot;AspectJ pushed &amp;quot; + name);
&lt;br&gt;&amp;nbsp; &amp;nbsp; }
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; // ....
&lt;br&gt;&amp;nbsp; &amp;nbsp;
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;On system out, i see :
&lt;br&gt;&lt;br&gt;AspectJ weaving org.apache.magma.settings.SettingsHolder
&lt;br&gt;AspectJ pushed org.apache.magma.settings.SettingsHolder$AjcClosure1
&lt;br&gt;AspectJ pushed org.apache.magma.settings.SettingsHolder$AjcClosure3
&lt;br&gt;AspectJ pushed org.apache.magma.settings.SettingsHolder$AjcClosure5
&lt;br&gt;AspectJ pushed org.apache.magma.settings.SettingsHolder$AjcClosure7
&lt;br&gt;AspectJ pushed org.apache.magma.settings.SettingsHolder$AjcClosure9
&lt;br&gt;&lt;br&gt;So, in a class loader system, the accept method receives closures. I 
&lt;br&gt;don't do anything special with them (except defining them in my current 
&lt;br&gt;classloader). As i said before, I don't know if in an agent the same 
&lt;br&gt;rules apply.
&lt;br&gt;&lt;br&gt;Simone
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Andrica Silviu wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Ciao Simone,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; could you give me a clue on how to catch the newly created closures?
&lt;br&gt;&amp;gt; I was playing with Aj and its source code, but it seems that no matter what I try I cannot get it to work. The &amp;quot;accept&amp;quot; method I use only catches the original classes, never their closures.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks a lot,
&lt;br&gt;&amp;gt; Silviu
&lt;br&gt;&amp;gt; On Dec 2, 2009, at 9:54 PM, Simone Gianni wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; Andy Clement wrote:
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; You know, I'm on the verge of creating such a thing in AspectJ
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; itself... I would be interested to here about your approach and how
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; you know when to invalidate the cache, and what are you using as the
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; cache key (some combination of the class itself hashed or something,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; plus the combination of aspects defined at the time, hashed or
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; something?)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; Hi Andy and Silviu,
&lt;br&gt;&amp;gt;&amp;gt; I'm very happy you're planning such an improvement!
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I also tried to cache LTW classes, but did not find a way to invalidate 
&lt;br&gt;&amp;gt;&amp;gt; the right classes : when an aspect was somehow added, removed or 
&lt;br&gt;&amp;gt;&amp;gt; modified, I invalidated the entire cache and started from scratch, even 
&lt;br&gt;&amp;gt;&amp;gt; if probably only a few classes need reweaving. If a single comma was 
&lt;br&gt;&amp;gt;&amp;gt; added in a string in a single ITD, despite being a single byte 
&lt;br&gt;&amp;gt;&amp;gt; modification in a single class file, I had no option that reweaving 
&lt;br&gt;&amp;gt;&amp;gt; everything.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I tried to use AspectJ matching system to know which aspects applied to 
&lt;br&gt;&amp;gt;&amp;gt; a given class, so that I could invalidate only classes affected by a 
&lt;br&gt;&amp;gt;&amp;gt; changed aspect. I can't remember how much I managed to do this, but even 
&lt;br&gt;&amp;gt;&amp;gt; if I managed to, I could not know if a changed aspect only modified it's 
&lt;br&gt;&amp;gt;&amp;gt; advice implementation or also it's &amp;quot;matching part&amp;quot;, that is point cuts.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; If however it was possible to know whether an aspect changed its point 
&lt;br&gt;&amp;gt;&amp;gt; cuts or only its advice implementation (which happens most of the time, 
&lt;br&gt;&amp;gt;&amp;gt; especially when ITDs are used), it could be possible to invalidate only 
&lt;br&gt;&amp;gt;&amp;gt; classes that were matched by that aspect, and invalidate the full cache 
&lt;br&gt;&amp;gt;&amp;gt; only when the point cuts are changed.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Applying the existing matching system is not a valid solution, cause 
&lt;br&gt;&amp;gt;&amp;gt; matching is the slowest part of the weaving process, and having to use 
&lt;br&gt;&amp;gt;&amp;gt; it to decide whether to invalidate a class or not makes the cache slower 
&lt;br&gt;&amp;gt;&amp;gt; than a full reweave.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; So, I think, the cache should save, as a state, not only the hashes of 
&lt;br&gt;&amp;gt;&amp;gt; defined aspects, but hashes of the point cuts of defined aspects. If 
&lt;br&gt;&amp;gt;&amp;gt; those are not changed (implicitly, no aspect has been added or removed), 
&lt;br&gt;&amp;gt;&amp;gt; then the model is still valid, and only classes affected by the modified 
&lt;br&gt;&amp;gt;&amp;gt; aspects needs to be reweaved to apply modified advice implementation.
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; If AspectJ did this itself then the only user configuration would be a
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; place to keep these woven classes so that they can be retrieved later.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Do you have any specific requirements for the cache in your scenario?
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; (or does anyone else reading this have requirements on a cache like
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; this?)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; This would be great and enough for my needs. Later probably a listener 
&lt;br&gt;&amp;gt;&amp;gt; on the cache could be useful, to integrate it in the case of a chain of 
&lt;br&gt;&amp;gt;&amp;gt; transforming classloaders like when there is AspectJ + JPA or similar 
&lt;br&gt;&amp;gt;&amp;gt; situations.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Simone
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; -- 
&lt;br&gt;&amp;gt;&amp;gt; Simone Gianni &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CEO Semeru s.r.l. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Apache Committer
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://www.simonegianni.it/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.simonegianni.it/&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt;&amp;gt; aspectj-users mailing list
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26627081&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; aspectj-users mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26627081&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Simone Gianni &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CEO Semeru s.r.l. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Apache Committer
&lt;br&gt;&lt;a href=&quot;http://www.simonegianni.it/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.simonegianni.it/&lt;/a&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26627081&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Generated-AjcClosure-classes-tp26607890p26627081.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26623594</id>
	<title>Re: Memory consumption problems</title>
	<published>2009-12-03T02:26:09Z</published>
	<updated>2009-12-03T02:26:09Z</updated>
	<author>
		<name>Tim Schraepen</name>
	</author>
	<content type="html">We 
&lt;br&gt;&lt;blockquote class=&quot;quote light-black dark-border-color&quot;&gt;&lt;div class=&quot;quote light-border-color&quot;&gt;
&lt;div class=&quot;quote-author&quot; style=&quot;font-weight: bold;&quot;&gt;Andy Clement wrote:&lt;/div&gt;
&lt;div class=&quot;quote-message&quot;&gt;&amp;gt; Analyzing the heapdumps so far has also pointed out a lot of AspectJ classes
&lt;br&gt;&amp;gt; taking up a LOT of memory.
&lt;br&gt;&amp;gt; There are even BcelObjectTypes referring to compiled jsp's.
&lt;br&gt;&lt;br&gt;In a heap dump it is important to look at those types anchored via
&lt;br&gt;hard references from root and not just look at the heap as a whole and
&lt;br&gt;look how many BcelObjectTypes there are, since many may be weakly
&lt;br&gt;referenced - are all the BcelObjectTypes anchored from root?
&lt;/div&gt;
&lt;/div&gt;&lt;/blockquote&gt;
I'll try and gmail you the heap dump we took with jmap.
&lt;br&gt;The way we &amp;quot;analyzed&amp;quot; it with &lt;a href=&quot;http://www.eclipse.org/mat/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;MAT&lt;/a&gt;, is we got references to BcelObjectTypes, and then showed path to gc root excluding weak/phantom references.
&lt;br&gt;I'm very new to all this stuff, so chances are I'm wrong about my Full GC theory :)
&lt;br&gt;&lt;br&gt;&lt;blockquote class=&quot;quote light-black dark-border-color&quot;&gt;&lt;div class=&quot;quote light-border-color&quot;&gt;
&lt;div class=&quot;quote-author&quot; style=&quot;font-weight: bold;&quot;&gt;Andy Clement wrote:&lt;/div&gt;
&lt;div class=&quot;quote-message shrinkable-quote&quot;&gt;&amp;gt;
&lt;br&gt;&amp;gt; I have been suspecting aop.xml merging for this behaviour, but sort of ruled
&lt;br&gt;&amp;gt; it out by getting rid of aop.xml in spring-agents.jar (which is found in the
&lt;br&gt;&amp;gt; web-inf/lib of one of our modules deployed on the appserver, along with a
&lt;br&gt;&amp;gt; sub-module jar that contains _our_ aop.xml with the correct inclusions and
&lt;br&gt;&amp;gt; exclusions).
&lt;br&gt;&amp;gt; My theory is the map just keeps growing along with how many classes are
&lt;br&gt;&amp;gt; loaded, and then the memory just isn't enough for loading in everything and
&lt;br&gt;&amp;gt; crashes.
&lt;br&gt;I see. &amp;nbsp;The spring aop.xml does define some sophisticated aspects that
&lt;br&gt;may well be getting into the mix here.
&lt;br&gt;&lt;br&gt;&amp;gt; I had found your blog post about the performance gain in 1.6.7 and was
&lt;br&gt;&amp;gt; hopeful, but it didn't solve our problem (loading classes that should be
&lt;br&gt;&amp;gt; excluded).
&lt;br&gt;&lt;br&gt;So you tried running on a very recent 1.6.7 dev build? &amp;nbsp;If you want
&lt;br&gt;to, I am more than willingly to work with you on this issue - if you
&lt;br&gt;are running with a very recent AspectJ dev build and were able to
&lt;br&gt;share dumps with me, I'll sort it out. &amp;nbsp;Either email them to me or
&lt;br&gt;zip/attach them to that bug report. &amp;nbsp;yourkit is my preferred format,
&lt;br&gt;but I can deal with pretty much anything. &amp;nbsp;It would be interesting to
&lt;br&gt;know if you are using a lot of ITDs, or simply advice? Since that
&lt;br&gt;makes a difference on what gets held onto in a World.
&lt;/div&gt;
&lt;/div&gt;&lt;/blockquote&gt;
I did, and the heap size even increased compared to a version of 1.6.6.
&lt;br&gt;The Full GC issues we're having right now are with version 1.6.2.
&lt;br&gt;&lt;br&gt;What are ITD's?
&lt;br&gt;&lt;br&gt;For one module we're just using @Configurable and Spring aspects on domain classes.
&lt;br&gt;For another module we have aspects for logging and accounting and stuff.
&lt;br&gt;We can see the symptoms when we just deploy the module with @Configurable already.
&lt;br&gt;It just gets worse when other modules are deployed (because this just means more classes to be contained in the World map I think)
&lt;br&gt;&lt;br&gt;&lt;blockquote class=&quot;quote light-black dark-border-color&quot;&gt;&lt;div class=&quot;quote light-border-color&quot;&gt;
&lt;div class=&quot;quote-author&quot; style=&quot;font-weight: bold;&quot;&gt;Andy Clement wrote:&lt;/div&gt;
&lt;div class=&quot;quote-message shrinkable-quote&quot;&gt;&amp;gt; Do you think maybe the placement of the aop.xml, and/or the placement of
&lt;br&gt;&amp;gt; aspectjweaver.jar may be the cause?
&lt;br&gt;&lt;br&gt;It could be the aop.xml merges causing you a headache, or it could
&lt;br&gt;simply be the inability to say &amp;quot;I DONT WANT A DAMN WEAVER FOR THOSE
&lt;br&gt;JSP CLASSLOADERS&amp;quot; :) An ability to filter which classloaders you want
&lt;br&gt;a weaver for has been talked about before but there is currently no
&lt;br&gt;mechanism. &amp;nbsp;Do you believe you want to weave the result of JSP
&lt;br&gt;compilation? &amp;nbsp;I think there can be a ton of jsp classloaders in a
&lt;br&gt;system, coming and going regularly. &amp;nbsp;However, although a lot of memory
&lt;br&gt;may be getting used, I don't understand why you are eventually running
&lt;br&gt;out since care has been taken that once loaders go then weavers
&lt;br&gt;attached to them also vanish. &amp;nbsp;AspectJ shouldn't really be able to
&lt;br&gt;cause PermGen issues by itself as it doesn't create and manage
&lt;br&gt;classloaders itself, however *if* there is a bug and it is anchoring a
&lt;br&gt;classloader that the system has already discarded, that could lead to
&lt;br&gt;a permgen problem. &amp;nbsp;In your heap dump, take a look for classloader
&lt;br&gt;instances and whether any are being hard referenced through AspectJ.
&lt;br&gt;&lt;br&gt;&amp;gt; I feel like I've tried everything, so today I was converting all our modules
&lt;br&gt;&amp;gt; to compile time weaving. Which impacts our development process and increases
&lt;br&gt;&amp;gt; build-time and what not. But it works, and just loads the strictly necessary
&lt;br&gt;&amp;gt; woven classes.
&lt;br&gt;&lt;br&gt;Latest aspectj has really improved some build times due to improved
&lt;br&gt;matching algorithms. &amp;nbsp;I heard AJDT build time was down from 55 seconds
&lt;br&gt;to 38 seconds - both of which are low, but that saving should scale up
&lt;br&gt;to any size system that is doing a decent amount of weaving.
&lt;br&gt;&lt;br&gt;&amp;gt; I also feel like I'm kind of hi-jacking this thread. Whoopsie.
&lt;br&gt;&lt;br&gt;No problem - we can continue this discussion on the mailing list, in
&lt;br&gt;bugzilla or on email. &amp;nbsp;up to you :)
&lt;br&gt;&lt;br&gt;cheers,
&lt;br&gt;Andy
&lt;br&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;aspectj-users@eclipse.org
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Memory-consumption-problems-tp18649090p26623594.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26620538</id>
	<title>Re: priviledged aspect</title>
	<published>2009-12-02T19:37:08Z</published>
	<updated>2009-12-02T19:37:08Z</updated>
	<author>
		<name>Ramnivas Laddad</name>
	</author>
	<content type="html">This is really a Java reflection API question. Check &lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/lang/reflect/AccessibleObject.html#setAccessible(boolean)&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://java.sun.com/javase/6/docs/api/java/lang/reflect/AccessibleObject.html#setAccessible(boolean)&lt;/a&gt; to access non-public members. Also, if you go that route, you don&amp;#39;t need your aspect to be marked at privileged.&lt;div&gt;

&lt;br&gt;&lt;/div&gt;&lt;div&gt;-Ramnivas&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Wed, Dec 2, 2009 at 6:40 PM, ivlev jenia &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26620538&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jenia2009@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;

&lt;div&gt;&lt;div style=&quot;font-family:times new roman,new york,times,serif;font-size:12pt&quot;&gt;&lt;div&gt;Hello.&lt;br&gt;From a privileged AspectJ class I want to access the private fields of an object; lets call this object x.&lt;br&gt;To do this I would do x.fieldname.&lt;br&gt;

Now I have fieldname stored in a String, lets call it y.&lt;br&gt;So how can I do the equivalent of x.y ?&lt;br&gt;Also I tried to go x.getClass().getField(y). This works fine for public fields, I need to do it for private fields.&lt;br&gt;

&lt;br&gt;Thank you for your kind concner.&lt;br&gt;Jenia Ivlev&lt;br&gt;&lt;/div&gt;&lt;div class=&quot;hm&quot;&gt;

&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;hm&quot;&gt;&lt;br&gt;



      &lt;hr size=&quot;1&quot;&gt;The new Internet Explorer® 8 - Faster, safer, easier.  Optimized for Yahoo! &lt;a href=&quot;http://downloads.yahoo.com/ca/internetexplorer/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&lt;b&gt;Get it Now for Free!&lt;/b&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;_______________________________________________&lt;br&gt;


aspectj-users mailing list&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26620538&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26620538&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/priviledged-aspect-tp26620157p26620538.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26620157</id>
	<title>priviledged aspect</title>
	<published>2009-12-02T18:40:36Z</published>
	<updated>2009-12-02T18:40:36Z</updated>
	<author>
		<name>jenia.i</name>
	</author>
	<content type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;div style=&quot;font-family:times new roman,new york,times,serif;font-size:12pt&quot;&gt;&lt;div&gt;Hello.&lt;br&gt;From a privileged AspectJ class I want to access the private fields of an object; lets call this object x.&lt;br&gt;To do this I would do x.fieldname.&lt;br&gt;Now I have fieldname stored in a String, lets call it y.&lt;br&gt;So how can I do the equivalent of x.y ?&lt;br&gt;Also I tried to go x.getClass().getField(y). This works fine for public fields, I need to do it for private fields.&lt;br&gt;&lt;br&gt;Thank you for your kind concner.&lt;br&gt;Jenia Ivlev&lt;br&gt;&lt;/div&gt;
&lt;!-- cg4.c2.mail.re1.yahoo.com compressed/chunked Wed Dec  2 18:35:30 PST 2009 --&gt;
&lt;/div&gt;&lt;br&gt;



      &lt;hr size=1&gt;The new Internet Explorer® 8 - Faster, safer, easier.  Optimized for Yahoo! &lt;a href=&quot;http://downloads.yahoo.com/ca/internetexplorer/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;&lt;b&gt;Get it Now for Free!&lt;/b&gt;&lt;/a&gt;&lt;/body&gt;&lt;/html&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26620157&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/priviledged-aspect-tp26620157p26620157.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26618331</id>
	<title>Re: Generated AjcClosure classes</title>
	<published>2009-12-02T15:15:27Z</published>
	<updated>2009-12-02T15:15:27Z</updated>
	<author>
		<name>William Louth</name>
	</author>
	<content type="html">I would like to point out that in a production environment detecting 
&lt;br&gt;complex changes across runs is not necessarily a big requirement once 
&lt;br&gt;one can invalidate the cache easily during deployment (not 
&lt;br&gt;hot-deployment because that is not a managed production environment in 
&lt;br&gt;anyone book). The purpose of the cache should be to improve the start-up 
&lt;br&gt;time - this is paramount. One can easily relax some checks as the 
&lt;br&gt;assumption is that nothing has changed outside a change request (&amp; work 
&lt;br&gt;order) which would have lead to the cache been invalidated (deleted from 
&lt;br&gt;the file system) by operations. That said one does need to still handle 
&lt;br&gt;the case of a class being loaded across different classloaders so a key 
&lt;br&gt;on the class name or bytecode along is insufficient. JXInsight actually 
&lt;br&gt;matches a class loaded by different classloaders if the class image is 
&lt;br&gt;the same and the digest generated for a classloader hierarchy (based 
&lt;br&gt;static contexts) is also the same.
&lt;br&gt;&lt;br&gt;Andy is doing some great work lately on speeding things up so maybe the 
&lt;br&gt;benefits of a cache will diminish over time to some degree.
&lt;br&gt;&lt;br&gt;One thing which I do like about our approach is that we can front the 
&lt;br&gt;weaver with a configuration-based class filter which allows us to deploy 
&lt;br&gt;generic (pointcuts) aspects libraries and then refine the visibility 
&lt;br&gt;externally without needing to package/edit an aop.xml file or change a 
&lt;br&gt;aspect class.
&lt;br&gt;&lt;br&gt;Kind regards,
&lt;br&gt;&lt;br&gt;William
&lt;br&gt;&lt;br&gt;On 12/2/09 7:43 PM, William Louth (JINSPIRED.COM) wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi Andy,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; You are correct a key based just on the class bytecode is whole-fully 
&lt;br&gt;&amp;gt; insufficient at least in the enterprise space because of classloaders 
&lt;br&gt;&amp;gt; each of which can have different aspect 
&lt;br&gt;&amp;gt; dependencies/libraries/configurations. JXInsight's enhanced AspectJ 
&lt;br&gt;&amp;gt; weaver uses cache based on composite-key digests generated for 
&lt;br&gt;&amp;gt; classloaders &amp; classes that factors in such additional context 
&lt;br&gt;&amp;gt; information. We also enhanced the load-time weaver with other 
&lt;br&gt;&amp;gt; capabilities including class filtering, class differencing, 
&lt;br&gt;&amp;gt; diagnostics, profiling,.... We have had this capability for more than 
&lt;br&gt;&amp;gt; 1 1/2 years.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Kind regards,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; William
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26618331&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Generated-AjcClosure-classes-tp26607890p26618331.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26618019</id>
	<title>Re: Generated AjcClosure classes</title>
	<published>2009-12-02T14:52:13Z</published>
	<updated>2009-12-02T14:52:13Z</updated>
	<author>
		<name>Andrica Silviu</name>
	</author>
	<content type="html">Ciao Simone,
&lt;br&gt;&lt;br&gt;could you give me a clue on how to catch the newly created closures?
&lt;br&gt;I was playing with Aj and its source code, but it seems that no matter what I try I cannot get it to work. The &amp;quot;accept&amp;quot; method I use only catches the original classes, never their closures.
&lt;br&gt;&lt;br&gt;Thanks a lot,
&lt;br&gt;Silviu
&lt;br&gt;On Dec 2, 2009, at 9:54 PM, Simone Gianni wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Andy Clement wrote:
&lt;br&gt;&amp;gt;&amp;gt; You know, I'm on the verge of creating such a thing in AspectJ
&lt;br&gt;&amp;gt;&amp;gt; itself... I would be interested to here about your approach and how
&lt;br&gt;&amp;gt;&amp;gt; you know when to invalidate the cache, and what are you using as the
&lt;br&gt;&amp;gt;&amp;gt; cache key (some combination of the class itself hashed or something,
&lt;br&gt;&amp;gt;&amp;gt; plus the combination of aspects defined at the time, hashed or
&lt;br&gt;&amp;gt;&amp;gt; something?)
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt; Hi Andy and Silviu,
&lt;br&gt;&amp;gt; I'm very happy you're planning such an improvement!
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I also tried to cache LTW classes, but did not find a way to invalidate 
&lt;br&gt;&amp;gt; the right classes : when an aspect was somehow added, removed or 
&lt;br&gt;&amp;gt; modified, I invalidated the entire cache and started from scratch, even 
&lt;br&gt;&amp;gt; if probably only a few classes need reweaving. If a single comma was 
&lt;br&gt;&amp;gt; added in a string in a single ITD, despite being a single byte 
&lt;br&gt;&amp;gt; modification in a single class file, I had no option that reweaving 
&lt;br&gt;&amp;gt; everything.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I tried to use AspectJ matching system to know which aspects applied to 
&lt;br&gt;&amp;gt; a given class, so that I could invalidate only classes affected by a 
&lt;br&gt;&amp;gt; changed aspect. I can't remember how much I managed to do this, but even 
&lt;br&gt;&amp;gt; if I managed to, I could not know if a changed aspect only modified it's 
&lt;br&gt;&amp;gt; advice implementation or also it's &amp;quot;matching part&amp;quot;, that is point cuts.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; If however it was possible to know whether an aspect changed its point 
&lt;br&gt;&amp;gt; cuts or only its advice implementation (which happens most of the time, 
&lt;br&gt;&amp;gt; especially when ITDs are used), it could be possible to invalidate only 
&lt;br&gt;&amp;gt; classes that were matched by that aspect, and invalidate the full cache 
&lt;br&gt;&amp;gt; only when the point cuts are changed.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Applying the existing matching system is not a valid solution, cause 
&lt;br&gt;&amp;gt; matching is the slowest part of the weaving process, and having to use 
&lt;br&gt;&amp;gt; it to decide whether to invalidate a class or not makes the cache slower 
&lt;br&gt;&amp;gt; than a full reweave.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; So, I think, the cache should save, as a state, not only the hashes of 
&lt;br&gt;&amp;gt; defined aspects, but hashes of the point cuts of defined aspects. If 
&lt;br&gt;&amp;gt; those are not changed (implicitly, no aspect has been added or removed), 
&lt;br&gt;&amp;gt; then the model is still valid, and only classes affected by the modified 
&lt;br&gt;&amp;gt; aspects needs to be reweaved to apply modified advice implementation.
&lt;br&gt;&amp;gt;&amp;gt; If AspectJ did this itself then the only user configuration would be a
&lt;br&gt;&amp;gt;&amp;gt; place to keep these woven classes so that they can be retrieved later.
&lt;br&gt;&amp;gt;&amp;gt; Do you have any specific requirements for the cache in your scenario?
&lt;br&gt;&amp;gt;&amp;gt; (or does anyone else reading this have requirements on a cache like
&lt;br&gt;&amp;gt;&amp;gt; this?)
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt; This would be great and enough for my needs. Later probably a listener 
&lt;br&gt;&amp;gt; on the cache could be useful, to integrate it in the case of a chain of 
&lt;br&gt;&amp;gt; transforming classloaders like when there is AspectJ + JPA or similar 
&lt;br&gt;&amp;gt; situations.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Simone
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; -- 
&lt;br&gt;&amp;gt; Simone Gianni &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CEO Semeru s.r.l. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Apache Committer
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.simonegianni.it/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.simonegianni.it/&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; aspectj-users mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26618019&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;/div&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26618019&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Generated-AjcClosure-classes-tp26607890p26618019.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26616281</id>
	<title>Re: Generated AjcClosure classes</title>
	<published>2009-12-02T12:54:36Z</published>
	<updated>2009-12-02T12:54:36Z</updated>
	<author>
		<name>Simone Gianni-2</name>
	</author>
	<content type="html">Andy Clement wrote:
&lt;br&gt;&amp;gt; You know, I'm on the verge of creating such a thing in AspectJ
&lt;br&gt;&amp;gt; itself... I would be interested to here about your approach and how
&lt;br&gt;&amp;gt; you know when to invalidate the cache, and what are you using as the
&lt;br&gt;&amp;gt; cache key (some combination of the class itself hashed or something,
&lt;br&gt;&amp;gt; plus the combination of aspects defined at the time, hashed or
&lt;br&gt;&amp;gt; something?)
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;Hi Andy and Silviu,
&lt;br&gt;I'm very happy you're planning such an improvement!
&lt;br&gt;&lt;br&gt;I also tried to cache LTW classes, but did not find a way to invalidate 
&lt;br&gt;the right classes : when an aspect was somehow added, removed or 
&lt;br&gt;modified, I invalidated the entire cache and started from scratch, even 
&lt;br&gt;if probably only a few classes need reweaving. If a single comma was 
&lt;br&gt;added in a string in a single ITD, despite being a single byte 
&lt;br&gt;modification in a single class file, I had no option that reweaving 
&lt;br&gt;everything.
&lt;br&gt;&lt;br&gt;I tried to use AspectJ matching system to know which aspects applied to 
&lt;br&gt;a given class, so that I could invalidate only classes affected by a 
&lt;br&gt;changed aspect. I can't remember how much I managed to do this, but even 
&lt;br&gt;if I managed to, I could not know if a changed aspect only modified it's 
&lt;br&gt;advice implementation or also it's &amp;quot;matching part&amp;quot;, that is point cuts.
&lt;br&gt;&lt;br&gt;If however it was possible to know whether an aspect changed its point 
&lt;br&gt;cuts or only its advice implementation (which happens most of the time, 
&lt;br&gt;especially when ITDs are used), it could be possible to invalidate only 
&lt;br&gt;classes that were matched by that aspect, and invalidate the full cache 
&lt;br&gt;only when the point cuts are changed.
&lt;br&gt;&lt;br&gt;Applying the existing matching system is not a valid solution, cause 
&lt;br&gt;matching is the slowest part of the weaving process, and having to use 
&lt;br&gt;it to decide whether to invalidate a class or not makes the cache slower 
&lt;br&gt;than a full reweave.
&lt;br&gt;&lt;br&gt;So, I think, the cache should save, as a state, not only the hashes of 
&lt;br&gt;defined aspects, but hashes of the point cuts of defined aspects. If 
&lt;br&gt;those are not changed (implicitly, no aspect has been added or removed), 
&lt;br&gt;then the model is still valid, and only classes affected by the modified 
&lt;br&gt;aspects needs to be reweaved to apply modified advice implementation.
&lt;br&gt;&amp;gt; If AspectJ did this itself then the only user configuration would be a
&lt;br&gt;&amp;gt; place to keep these woven classes so that they can be retrieved later.
&lt;br&gt;&amp;gt; &amp;nbsp;Do you have any specific requirements for the cache in your scenario?
&lt;br&gt;&amp;gt; (or does anyone else reading this have requirements on a cache like
&lt;br&gt;&amp;gt; this?)
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;This would be great and enough for my needs. Later probably a listener 
&lt;br&gt;on the cache could be useful, to integrate it in the case of a chain of 
&lt;br&gt;transforming classloaders like when there is AspectJ + JPA or similar 
&lt;br&gt;situations.
&lt;br&gt;&lt;br&gt;Simone
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Simone Gianni &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CEO Semeru s.r.l. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Apache Committer
&lt;br&gt;&lt;a href=&quot;http://www.simonegianni.it/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.simonegianni.it/&lt;/a&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26616281&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Generated-AjcClosure-classes-tp26607890p26616281.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26614362</id>
	<title>Re: Generated AjcClosure classes</title>
	<published>2009-12-02T10:58:20Z</published>
	<updated>2009-12-02T10:58:20Z</updated>
	<author>
		<name>Andy Clement</name>
	</author>
	<content type="html">&amp;gt;&amp;gt; As I say, raise an enhancement request to discuss this.
&lt;br&gt;&amp;gt; How do I do that?
&lt;br&gt;&lt;br&gt;Enhancement requests go here with bugs:
&lt;br&gt;&lt;a href=&quot;https://bugs.eclipse.org/bugs/enter_bug.cgi?product=AspectJ&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://bugs.eclipse.org/bugs/enter_bug.cgi?product=AspectJ&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26614362&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Generated-AjcClosure-classes-tp26607890p26614362.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26614345</id>
	<title>Re: Generated AjcClosure classes</title>
	<published>2009-12-02T10:57:01Z</published>
	<updated>2009-12-02T10:57:01Z</updated>
	<author>
		<name>Andy Clement</name>
	</author>
	<content type="html">Hi William,
&lt;br&gt;&lt;br&gt;I knew you had a caching system in JXInsight, I've just not had much
&lt;br&gt;time to explore current strategies and think about solutions to this
&lt;br&gt;problem as including a cache out of the box has only recently become
&lt;br&gt;something I'm thinking of doing. &amp;nbsp;Equinox Aspects also has one for an
&lt;br&gt;OSGi environment.
&lt;br&gt;&lt;br&gt;Andy
&lt;br&gt;&lt;br&gt;2009/12/2 William Louth (JINSPIRED.COM) &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26614345&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;william.louth@...&lt;/a&gt;&amp;gt;:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi Andy,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; You are correct a key based just on the class bytecode is whole-fully
&lt;br&gt;&amp;gt; insufficient at least in the enterprise space because of classloaders each
&lt;br&gt;&amp;gt; of which can have different aspect dependencies/libraries/configurations.
&lt;br&gt;&amp;gt; JXInsight's enhanced AspectJ weaver uses cache based on composite-key
&lt;br&gt;&amp;gt; digests generated for classloaders &amp; classes that factors in such additional
&lt;br&gt;&amp;gt; context information. We also enhanced the load-time weaver with other
&lt;br&gt;&amp;gt; capabilities including class filtering, class differencing, diagnostics,
&lt;br&gt;&amp;gt; profiling,.... We have had this capability for more than 1 1/2 years.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Kind regards,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; William
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; aspectj-users mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26614345&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;/div&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26614345&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Generated-AjcClosure-classes-tp26607890p26614345.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26614265</id>
	<title>Re: Memory consumption problems</title>
	<published>2009-12-02T10:51:46Z</published>
	<updated>2009-12-02T10:51:46Z</updated>
	<author>
		<name>Andy Clement</name>
	</author>
	<content type="html">Hi Tim,
&lt;br&gt;&lt;br&gt;I didn't realise you were actually having real issues right now. &amp;nbsp;So
&lt;br&gt;let's see what we can do about it. &amp;nbsp;I've raised
&lt;br&gt;&lt;a href=&quot;https://bugs.eclipse.org/bugs/show_bug.cgi?id=296734&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://bugs.eclipse.org/bugs/show_bug.cgi?id=296734&lt;/a&gt;&amp;nbsp;to track this
&lt;br&gt;problem.
&lt;br&gt;&lt;br&gt;&amp;gt; We're running on a SunApp, and we include the aspectJWeaver.jar as a JVM
&lt;br&gt;&amp;gt; argument, so as to have the agent for LTW. But what I think is happening, is
&lt;br&gt;&amp;gt; that because we include it as a JVM argument, the adaptor (I think?) is
&lt;br&gt;&amp;gt; loading _all_ classes loaded by the classloader in which AspectJWeaver.jar
&lt;br&gt;&amp;gt; is loaded into, get loaded.
&lt;br&gt;&lt;br&gt;The weaver agent has an option to 'see' all the classes loaded by the
&lt;br&gt;loader it is attached too. &amp;nbsp;And running with -javaagent, nearly all
&lt;br&gt;classloader instances in the system will get a weaver, except for
&lt;br&gt;instances of:
&lt;br&gt;&lt;br&gt;sun.reflect.DelegatingClassLoader
&lt;br&gt;&lt;br&gt;(we don't want to instrument things that loads).
&lt;br&gt;&lt;br&gt;includes/excludes are respected according to the set of aop.xml files
&lt;br&gt;that can be 'seen' from the classloader in question. &amp;nbsp;If running with
&lt;br&gt;debug the weaver instance will tell you which aop.xmls it has seen.
&lt;br&gt;&lt;br&gt;&amp;gt; And since our aop.xml file with inclusions and exclusions is only in a child
&lt;br&gt;&amp;gt; classloader (en EJB or Web), the filtering isn't going on.
&lt;br&gt;&amp;gt; When we look at the GC graph, it keeps adding and removing about 600mb of
&lt;br&gt;&amp;gt; memory every minute or so.
&lt;br&gt;&amp;gt; And eventually leads to FullGC's and PermGen crash.
&lt;br&gt;&lt;br&gt;That seems a lot...but regardless of how much it is, after the weave
&lt;br&gt;of any particular type a whole ton of it should be orphaned for
&lt;br&gt;potential GC (held onto via weak references).
&lt;br&gt;&lt;br&gt;&amp;gt; Analyzing the heapdumps so far has also pointed out a lot of AspectJ classes
&lt;br&gt;&amp;gt; taking up a LOT of memory.
&lt;br&gt;&amp;gt; There are even BcelObjectTypes referring to compiled jsp's.
&lt;br&gt;&lt;br&gt;In a heap dump it is important to look at those types anchored via
&lt;br&gt;hard references from root and not just look at the heap as a whole and
&lt;br&gt;look how many BcelObjectTypes there are, since many may be weakly
&lt;br&gt;referenced - are all the BcelObjectTypes anchored from root?
&lt;br&gt;&lt;br&gt;&amp;gt; My theory is the map just keeps growing along with how many classes are
&lt;br&gt;&amp;gt; loaded, and then the memory just isn't enough for loading in everything and
&lt;br&gt;&amp;gt; crashes.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I have been suspecting aop.xml merging for this behaviour, but sort of ruled
&lt;br&gt;&amp;gt; it out by getting rid of aop.xml in spring-agents.jar (which is found in the
&lt;br&gt;&amp;gt; web-inf/lib of one of our modules deployed on the appserver, along with a
&lt;br&gt;&amp;gt; sub-module jar that contains _our_ aop.xml with the correct inclusions and
&lt;br&gt;&amp;gt; exclusions).
&lt;br&gt;&lt;br&gt;I see. &amp;nbsp;The spring aop.xml does define some sophisticated aspects that
&lt;br&gt;may well be getting into the mix here.
&lt;br&gt;&lt;br&gt;&amp;gt; Documentation I was able to dig up anywhere on the internet was helpful, but
&lt;br&gt;&amp;gt; I still feel like a total idiot about AspectJ.
&lt;br&gt;&lt;br&gt;Me too sometimes :) &amp;nbsp;I didn't write the original LTW stuff so am not a
&lt;br&gt;100% expert on it (yet).
&lt;br&gt;&lt;br&gt;&amp;gt; I had found your blog post about the performance gain in 1.6.7 and was
&lt;br&gt;&amp;gt; hopeful, but it didn't solve our problem (loading classes that should be
&lt;br&gt;&amp;gt; excluded).
&lt;br&gt;&lt;br&gt;So you tried running on a very recent 1.6.7 dev build? &amp;nbsp;If you want
&lt;br&gt;to, I am more than willingly to work with you on this issue - if you
&lt;br&gt;are running with a very recent AspectJ dev build and were able to
&lt;br&gt;share dumps with me, I'll sort it out. &amp;nbsp;Either email them to me or
&lt;br&gt;zip/attach them to that bug report. &amp;nbsp;yourkit is my preferred format,
&lt;br&gt;but I can deal with pretty much anything. &amp;nbsp;It would be interesting to
&lt;br&gt;know if you are using a lot of ITDs, or simply advice? Since that
&lt;br&gt;makes a difference on what gets held onto in a World.
&lt;br&gt;&lt;br&gt;&amp;gt; Do you think maybe the placement of the aop.xml, and/or the placement of
&lt;br&gt;&amp;gt; aspectjweaver.jar may be the cause?
&lt;br&gt;&lt;br&gt;It could be the aop.xml merges causing you a headache, or it could
&lt;br&gt;simply be the inability to say &amp;quot;I DONT WANT A DAMN WEAVER FOR THOSE
&lt;br&gt;JSP CLASSLOADERS&amp;quot; :) An ability to filter which classloaders you want
&lt;br&gt;a weaver for has been talked about before but there is currently no
&lt;br&gt;mechanism. &amp;nbsp;Do you believe you want to weave the result of JSP
&lt;br&gt;compilation? &amp;nbsp;I think there can be a ton of jsp classloaders in a
&lt;br&gt;system, coming and going regularly. &amp;nbsp;However, although a lot of memory
&lt;br&gt;may be getting used, I don't understand why you are eventually running
&lt;br&gt;out since care has been taken that once loaders go then weavers
&lt;br&gt;attached to them also vanish. &amp;nbsp;AspectJ shouldn't really be able to
&lt;br&gt;cause PermGen issues by itself as it doesn't create and manage
&lt;br&gt;classloaders itself, however *if* there is a bug and it is anchoring a
&lt;br&gt;classloader that the system has already discarded, that could lead to
&lt;br&gt;a permgen problem. &amp;nbsp;In your heap dump, take a look for classloader
&lt;br&gt;instances and whether any are being hard referenced through AspectJ.
&lt;br&gt;&lt;br&gt;&amp;gt; I feel like I've tried everything, so today I was converting all our modules
&lt;br&gt;&amp;gt; to compile time weaving. Which impacts our development process and increases
&lt;br&gt;&amp;gt; build-time and what not. But it works, and just loads the strictly necessary
&lt;br&gt;&amp;gt; woven classes.
&lt;br&gt;&lt;br&gt;Latest aspectj has really improved some build times due to improved
&lt;br&gt;matching algorithms. &amp;nbsp;I heard AJDT build time was down from 55 seconds
&lt;br&gt;to 38 seconds - both of which are low, but that saving should scale up
&lt;br&gt;to any size system that is doing a decent amount of weaving.
&lt;br&gt;&lt;br&gt;&amp;gt; I also feel like I'm kind of hi-jacking this thread. Whoopsie.
&lt;br&gt;&lt;br&gt;No problem - we can continue this discussion on the mailing list, in
&lt;br&gt;bugzilla or on email. &amp;nbsp;up to you :)
&lt;br&gt;&lt;br&gt;cheers,
&lt;br&gt;Andy
&lt;br&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26614265&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Memory-consumption-problems-tp18649090p26614265.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26614147</id>
	<title>Re: Generated AjcClosure classes</title>
	<published>2009-12-02T10:43:56Z</published>
	<updated>2009-12-02T10:43:56Z</updated>
	<author>
		<name>William Louth</name>
	</author>
	<content type="html">Hi Andy,
&lt;br&gt;&lt;br&gt;You are correct a key based just on the class bytecode is whole-fully 
&lt;br&gt;insufficient at least in the enterprise space because of classloaders 
&lt;br&gt;each of which can have different aspect 
&lt;br&gt;dependencies/libraries/configurations. JXInsight's enhanced AspectJ 
&lt;br&gt;weaver uses cache based on composite-key digests generated for 
&lt;br&gt;classloaders &amp; classes that factors in such additional context 
&lt;br&gt;information. We also enhanced the load-time weaver with other 
&lt;br&gt;capabilities including class filtering, class differencing, diagnostics, 
&lt;br&gt;profiling,.... We have had this capability for more than 1 1/2 years.
&lt;br&gt;&lt;br&gt;Kind regards,
&lt;br&gt;&lt;br&gt;William
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26614147&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Generated-AjcClosure-classes-tp26607890p26614147.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26613867</id>
	<title>Re: Generated AjcClosure classes</title>
	<published>2009-12-02T10:24:45Z</published>
	<updated>2009-12-02T10:24:45Z</updated>
	<author>
		<name>Andrica Silviu</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;On Dec 2, 2009, at 7:10 PM, Andy Clement wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hey,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; Great to hear this. Or not :) because I'm currently writing a paper about these things.
&lt;br&gt;&amp;gt;&amp;gt; As a cache key I use a hash of the bytecode of the unaltered class. After I compute the hash, I weave aspects to the class and save the weaved class into the cache.
&lt;br&gt;&amp;gt;&amp;gt; On subsequent program executions, I recompute the hash and retrieve the weaved version. When the list of aspects I instrument classes with changes, I invalidate the cache.
&lt;br&gt;&amp;gt;&amp;gt; Thus, after changing the list of aspects, on subsequent runs, a new cache is rebuilt.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Ok, let me throw something out there and you can tell me if you have
&lt;br&gt;&amp;gt; considered this case, as it seems the big problem :) &amp;nbsp;The hash of
&lt;br&gt;&amp;gt; aspects and the class to be woven is not actually sufficient. &amp;nbsp;Suppose
&lt;br&gt;&amp;gt; I have this:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; aspect X {
&lt;br&gt;&amp;gt; &amp;nbsp;before(): execution(* Foo.*(..)) {}
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; class A extends B {
&lt;br&gt;&amp;gt; &amp;nbsp;public void m() {}
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; class B { }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; class Foo {
&lt;br&gt;&amp;gt; &amp;nbsp;public void m() {}
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; on first building/weaving that system, type A will not be woven. &amp;nbsp;You
&lt;br&gt;&amp;gt; will cache it according to hash#A and {X}
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Suppose I then change B:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; class B extends Foo {
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Now you reload the system. &amp;nbsp;A hasn't changed, neither has X, but A
&lt;br&gt;&amp;gt; would now be woven because B changed - so if you use the cached entry,
&lt;br&gt;&amp;gt; you will get the wrong result.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I am thinking that hashing of the bytecode for 'A' isn't sufficient
&lt;br&gt;&amp;gt; for the key, and perhaps it is more a hash of A 'plus dependencies
&lt;br&gt;&amp;gt; that affect decisions made during weaving'. &amp;nbsp;That latter information
&lt;br&gt;&amp;gt; is something the weaver can know, and if included in the cachekey in
&lt;br&gt;&amp;gt; some way, we can know that a change to B also means the cache value
&lt;br&gt;&amp;gt; for A is out of date. &amp;nbsp;Do you have another solution to this problem?
&lt;br&gt;&amp;gt; This is why I was thinking about AspectJ doing its own caching,
&lt;br&gt;&amp;gt; because it can know all these things.
&lt;/div&gt;Thanks for pointing this out. That is a problem. Currently, I was not thinking of systems that can change their code. Having this mentioned, I believe there is a non-aspect, albeit more inefficient way: when a class is loaded, Java will also load its superclass, interfaces, etc. Now, if those changed, I think it's safe to invalidate the current class as well and have it (re)weaved. Even if these super classes are already loaded, my analysis looks at all the classes the current class interacts with and I can manage to find that they changed as well. However, this solution incurs the overhead of reweaving classes that do not have to be modified.
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; One thing I'm considering is having caches for each sequence of applied aspects so as to not start from scratch if there is a common sub sequence between what I already cached and the new list of aspects.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Yes, that is common with a profiling aspect where it is off, then you
&lt;br&gt;&amp;gt; turn it on, then you turn it off again.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; There currently isn't a way for you to get at them I don't think - but
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; there have been other requests to access them, or at least be made
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; aware of them. &amp;nbsp;This wasn't for a caching purpose but merely to avoid
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; clashes in the case where an attempt is made to define the same class
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; twice (&lt;a href=&quot;https://bugs.eclipse.org/bugs/show_bug.cgi?id=287426&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://bugs.eclipse.org/bugs/show_bug.cgi?id=287426&lt;/a&gt;).
&lt;br&gt;&amp;gt;&amp;gt; So what happens with the $AjcClosure classes? Isn't there a way I can get their bytecode? WeavingAdaptor has a method called &amp;quot;accept&amp;quot; that sounds to do just that. Also, the WeavingAdaptor constructor takes in a &amp;quot;GeneratedClassHandler&amp;quot;. Is there a way I can get a hold of that handler from within &amp;quot;Aj&amp;quot;?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; If you override functionality at a lower level, yes you can be plugged
&lt;br&gt;&amp;gt; into the process (GeneratedClassHandler), but I thought you were
&lt;br&gt;&amp;gt; running ltw as a standalone agent and then plugging your agent in
&lt;br&gt;&amp;gt; separately - are you not doing that? Are you having your agent work
&lt;br&gt;&amp;gt; with the LTW agent?
&lt;/div&gt;I have an agent in which I use Aj as a secondary agent. This architecture gives the option of easily implementing the cache verification without having to modify Aj.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; As I say, raise an enhancement request to discuss this.
&lt;br&gt;How do I do that?
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Silviu
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Andy
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; aspectj-users mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26613867&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26613867&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Generated-AjcClosure-classes-tp26607890p26613867.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26613755</id>
	<title>Re: Generated AjcClosure classes</title>
	<published>2009-12-02T10:18:10Z</published>
	<updated>2009-12-02T10:18:10Z</updated>
	<author>
		<name>Simone Gianni-2</name>
	</author>
	<content type="html">Hi Silviu,
&lt;br&gt;the accept method gives you classes generated by AspectJ, I don't use it 
&lt;br&gt;from an agent but from a classloader, and I can see closures being 
&lt;br&gt;pushed using that method.
&lt;br&gt;&lt;br&gt;I don't know if it is accessible from an agent however.
&lt;br&gt;&lt;br&gt;Simone
&lt;br&gt;&lt;br&gt;Andrica Silviu wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Dec 2, 2009, at 6:11 PM, Andy Clement wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; Hi Silviu,
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I am using Aj to perform runtime weaving. Afterwards, I'm saving the weaved
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; class into a cache so as to avoid the instrumentation on subsequent runs.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; You know, I'm on the verge of creating such a thing in AspectJ
&lt;br&gt;&amp;gt;&amp;gt; itself... I would be interested to here about your approach and how
&lt;br&gt;&amp;gt;&amp;gt; you know when to invalidate the cache, and what are you using as the
&lt;br&gt;&amp;gt;&amp;gt; cache key (some combination of the class itself hashed or something,
&lt;br&gt;&amp;gt;&amp;gt; plus the combination of aspects defined at the time, hashed or
&lt;br&gt;&amp;gt;&amp;gt; something?)
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt; Great to hear this. Or not :) because I'm currently writing a paper about these things.
&lt;br&gt;&amp;gt; As a cache key I use a hash of the bytecode of the unaltered class. After I compute the hash, I weave aspects to the class and save the weaved class into the cache.
&lt;br&gt;&amp;gt; On subsequent program executions, I recompute the hash and retrieve the weaved version. When the list of aspects I instrument classes with changes, I invalidate the cache.
&lt;br&gt;&amp;gt; Thus, after changing the list of aspects, on subsequent runs, a new cache is rebuilt. One thing I'm considering is having caches for each sequence of applied aspects so as to not start from scratch if there is a common sub sequence between what I already cached and the new list of aspects.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; If AspectJ did this itself then the only user configuration would be a
&lt;br&gt;&amp;gt;&amp;gt; place to keep these woven classes so that they can be retrieved later.
&lt;br&gt;&amp;gt;&amp;gt; Do you have any specific requirements for the cache in your scenario?
&lt;br&gt;&amp;gt;&amp;gt; (or does anyone else reading this have requirements on a cache like
&lt;br&gt;&amp;gt;&amp;gt; this?)
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt; Well, I would like to be able to retrieve them. Nothing more. A predefined place would be best.
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Now, my problem is that I use around advices that create additional
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Class$AjcClosure.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Is there any way I can get handle of those classes? I must mention I am
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; using a java agent that would normally be called whenever a new class is
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; loaded, but it appears that the Closure classes somehow escape this.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; There currently isn't a way for you to get at them I don't think - but
&lt;br&gt;&amp;gt;&amp;gt; there have been other requests to access them, or at least be made
&lt;br&gt;&amp;gt;&amp;gt; aware of them. &amp;nbsp;This wasn't for a caching purpose but merely to avoid
&lt;br&gt;&amp;gt;&amp;gt; clashes in the case where an attempt is made to define the same class
&lt;br&gt;&amp;gt;&amp;gt; twice (&lt;a href=&quot;https://bugs.eclipse.org/bugs/show_bug.cgi?id=287426&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://bugs.eclipse.org/bugs/show_bug.cgi?id=287426&lt;/a&gt;).
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt; So what happens with the $AjcClosure classes? Isn't there a way I can get their bytecode? WeavingAdaptor has a method called &amp;quot;accept&amp;quot; that sounds to do just that. Also, the WeavingAdaptor constructor takes in a &amp;quot;GeneratedClassHandler&amp;quot;. Is there a way I can get a hold of that handler from within &amp;quot;Aj&amp;quot;?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks a lot!
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Silviu
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; Raise an enhancement request and I'll see what I can do.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Andy
&lt;br&gt;&amp;gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt;&amp;gt; aspectj-users mailing list
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26613755&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; aspectj-users mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26613755&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Simone Gianni &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CEO Semeru s.r.l. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Apache Committer
&lt;br&gt;&lt;a href=&quot;http://www.simonegianni.it/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.simonegianni.it/&lt;/a&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26613755&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Generated-AjcClosure-classes-tp26607890p26613755.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26613619</id>
	<title>Re: Generated AjcClosure classes</title>
	<published>2009-12-02T10:10:35Z</published>
	<updated>2009-12-02T10:10:35Z</updated>
	<author>
		<name>Andy Clement</name>
	</author>
	<content type="html">Hey,
&lt;br&gt;&lt;br&gt;&amp;gt; Great to hear this. Or not :) because I'm currently writing a paper about these things.
&lt;br&gt;&amp;gt; As a cache key I use a hash of the bytecode of the unaltered class. After I compute the hash, I weave aspects to the class and save the weaved class into the cache.
&lt;br&gt;&amp;gt; On subsequent program executions, I recompute the hash and retrieve the weaved version. When the list of aspects I instrument classes with changes, I invalidate the cache.
&lt;br&gt;&amp;gt; Thus, after changing the list of aspects, on subsequent runs, a new cache is rebuilt.
&lt;br&gt;&lt;br&gt;Ok, let me throw something out there and you can tell me if you have
&lt;br&gt;considered this case, as it seems the big problem :) &amp;nbsp;The hash of
&lt;br&gt;aspects and the class to be woven is not actually sufficient. &amp;nbsp;Suppose
&lt;br&gt;I have this:
&lt;br&gt;&lt;br&gt;aspect X {
&lt;br&gt;&amp;nbsp; before(): execution(* Foo.*(..)) {}
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;class A extends B {
&lt;br&gt;&amp;nbsp; public void m() {}
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;class B { }
&lt;br&gt;&lt;br&gt;class Foo {
&lt;br&gt;&amp;nbsp; public void m() {}
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;on first building/weaving that system, type A will not be woven. &amp;nbsp;You
&lt;br&gt;will cache it according to hash#A and {X}
&lt;br&gt;&lt;br&gt;Suppose I then change B:
&lt;br&gt;&lt;br&gt;class B extends Foo {
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;Now you reload the system. &amp;nbsp;A hasn't changed, neither has X, but A
&lt;br&gt;would now be woven because B changed - so if you use the cached entry,
&lt;br&gt;you will get the wrong result.
&lt;br&gt;&lt;br&gt;I am thinking that hashing of the bytecode for 'A' isn't sufficient
&lt;br&gt;for the key, and perhaps it is more a hash of A 'plus dependencies
&lt;br&gt;that affect decisions made during weaving'. &amp;nbsp;That latter information
&lt;br&gt;is something the weaver can know, and if included in the cachekey in
&lt;br&gt;some way, we can know that a change to B also means the cache value
&lt;br&gt;for A is out of date. &amp;nbsp;Do you have another solution to this problem?
&lt;br&gt;This is why I was thinking about AspectJ doing its own caching,
&lt;br&gt;because it can know all these things.
&lt;br&gt;&lt;br&gt;&amp;gt; One thing I'm considering is having caches for each sequence of applied aspects so as to not start from scratch if there is a common sub sequence between what I already cached and the new list of aspects.
&lt;br&gt;&lt;br&gt;Yes, that is common with a profiling aspect where it is off, then you
&lt;br&gt;turn it on, then you turn it off again.
&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; There currently isn't a way for you to get at them I don't think - but
&lt;br&gt;&amp;gt;&amp;gt; there have been other requests to access them, or at least be made
&lt;br&gt;&amp;gt;&amp;gt; aware of them.  This wasn't for a caching purpose but merely to avoid
&lt;br&gt;&amp;gt;&amp;gt; clashes in the case where an attempt is made to define the same class
&lt;br&gt;&amp;gt;&amp;gt; twice (&lt;a href=&quot;https://bugs.eclipse.org/bugs/show_bug.cgi?id=287426&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://bugs.eclipse.org/bugs/show_bug.cgi?id=287426&lt;/a&gt;).
&lt;br&gt;&amp;gt; So what happens with the $AjcClosure classes? Isn't there a way I can get their bytecode? WeavingAdaptor has a method called &amp;quot;accept&amp;quot; that sounds to do just that. Also, the WeavingAdaptor constructor takes in a &amp;quot;GeneratedClassHandler&amp;quot;. Is there a way I can get a hold of that handler from within &amp;quot;Aj&amp;quot;?
&lt;br&gt;&lt;br&gt;If you override functionality at a lower level, yes you can be plugged
&lt;br&gt;into the process (GeneratedClassHandler), but I thought you were
&lt;br&gt;running ltw as a standalone agent and then plugging your agent in
&lt;br&gt;separately - are you not doing that? Are you having your agent work
&lt;br&gt;with the LTW agent?
&lt;br&gt;&lt;br&gt;As I say, raise an enhancement request to discuss this.
&lt;br&gt;&lt;br&gt;Andy
&lt;br&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26613619&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Generated-AjcClosure-classes-tp26607890p26613619.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26613501</id>
	<title>Re: Memory consumption problems</title>
	<published>2009-12-02T10:03:45Z</published>
	<updated>2009-12-02T10:03:45Z</updated>
	<author>
		<name>Tim Schraepen</name>
	</author>
	<content type="html">Hey Andy
&lt;br&gt;&lt;br&gt;Thanks for the quick reply.
&lt;br&gt;We're seeing classes being loaded into the World that shouldn't.
&lt;br&gt;I've been toying around with all sorts of regexp patterns, but nothing seemed to work.
&lt;br&gt;&lt;br&gt;We're running on a SunApp, and we include the aspectJWeaver.jar as a JVM argument, so as to have the agent for LTW. But what I think is happening, is that because we include it as a JVM argument, the adaptor (I think?) is loading _all_ classes loaded by the classloader in which AspectJWeaver.jar is loaded into, get loaded.
&lt;br&gt;And since our aop.xml file with inclusions and exclusions is only in a child classloader (en EJB or Web), the filtering isn't going on.
&lt;br&gt;When we look at the GC graph, it keeps adding and removing about 600mb of memory every minute or so.
&lt;br&gt;And eventually leads to FullGC's and PermGen crash.
&lt;br&gt;Analyzing the heapdumps so far has also pointed out a lot of AspectJ classes taking up a LOT of memory.
&lt;br&gt;There are even BcelObjectTypes referring to compiled jsp's.
&lt;br&gt;My theory is the map just keeps growing along with how many classes are loaded, and then the memory just isn't enough for loading in everything and crashes.
&lt;br&gt;&lt;br&gt;I have been suspecting aop.xml merging for this behaviour, but sort of ruled it out by getting rid of aop.xml in spring-agents.jar (which is found in the web-inf/lib of one of our modules deployed on the appserver, along with a sub-module jar that contains _our_ aop.xml with the correct inclusions and exclusions).
&lt;br&gt;&lt;br&gt;Documentation I was able to dig up anywhere on the internet was helpful, but I still feel like a total idiot about AspectJ.
&lt;br&gt;&lt;br&gt;I had found your blog post about the performance gain in 1.6.7 and was hopeful, but it didn't solve our problem (loading classes that should be excluded).
&lt;br&gt;&lt;br&gt;Do you think maybe the placement of the aop.xml, and/or the placement of aspectjweaver.jar may be the cause?
&lt;br&gt;I tried adding an aop.xml with restrictions in the actual aspectJWeaver.jar that is included as a jvm argument too, but that didn't seem to work either.
&lt;br&gt;&lt;br&gt;I feel like I've tried everything, so today I was converting all our modules to compile time weaving. Which impacts our development process and increases build-time and what not. But it works, and just loads the strictly necessary woven classes.
&lt;br&gt;&lt;br&gt;I also feel like I'm kind of hi-jacking this thread. Whoopsie.
&lt;br&gt;&lt;br&gt;&lt;blockquote class=&quot;quote light-black dark-border-color&quot;&gt;&lt;div class=&quot;quote light-border-color&quot;&gt;
&lt;div class=&quot;quote-author&quot; style=&quot;font-weight: bold;&quot;&gt;Andy Clement wrote:&lt;/div&gt;
&lt;div class=&quot;quote-message shrinkable-quote&quot;&gt;Hi Tim,
&lt;br&gt;&lt;br&gt;Yes, the inclusions/exclusions define what gets pulled into the world
&lt;br&gt;map for weaving, but they (and related weaver state for them) do still
&lt;br&gt;consume a bunch of space. &amp;nbsp;Any types pulled in during analysis of the
&lt;br&gt;types for weaving is temporarily in the world but discarded later (or
&lt;br&gt;rather orphaned later, for GC). &amp;nbsp;Things are improved in AspectJ 1.6.7.
&lt;br&gt;&amp;nbsp;In 1.6.7, after a weave we more aggressively chuck away (orphan)
&lt;br&gt;types that were not affected by ITDs. &amp;nbsp;Basically trying to discard
&lt;br&gt;anything which can easily/cheaply be discovered again later. &amp;nbsp;If the
&lt;br&gt;world is still too large then having a hook so we can be told we are
&lt;br&gt;no longer needed (a shutdown type call) may be the 'final solution'.
&lt;br&gt;&lt;br&gt;More details on the strategy that is now turned on by default are in
&lt;br&gt;this article:
&lt;br&gt;&lt;a href=&quot;http://andrewclement.blogspot.com/2009/04/aspectj-load-time-weaving-and-memory.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://andrewclement.blogspot.com/2009/04/aspectj-load-time-weaving-and-memory.html&lt;/a&gt;&lt;br&gt;In the article it is called type demotion and had to be switched on
&lt;br&gt;prior to 1.6.7, but in 1.6.7 it is the default behaviour.
&lt;br&gt;&lt;br&gt;cheers,
&lt;br&gt;Andy
&lt;br&gt;&lt;br&gt;2009/12/2 Tim Schraepen &amp;lt;sch3lp@gmail.com&amp;gt;:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Why don't you just use the inclusion and exclusion rules in the aop.xml files
&lt;br&gt;&amp;gt; to decide which classes actually get loaded into the World map?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Andy Clement wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Given that doing the right thing with freeing memory is non trivial, I was
&lt;br&gt;&amp;gt;&amp;gt; thinking just now about an interim measure.  A user callable API where you
&lt;br&gt;&amp;gt;&amp;gt; could indicate to the AspectJ infrastructure that you *knew* the
&lt;br&gt;&amp;gt;&amp;gt; classloader
&lt;br&gt;&amp;gt;&amp;gt; had finished loading everything you wanted it to.  Upon making the API
&lt;br&gt;&amp;gt;&amp;gt; call
&lt;br&gt;&amp;gt;&amp;gt; we would immediately discard the whole weaver *but* keep a note of the
&lt;br&gt;&amp;gt;&amp;gt; classloader so that any future attempts to load classes that would have
&lt;br&gt;&amp;gt;&amp;gt; been
&lt;br&gt;&amp;gt;&amp;gt; woven will receive suitable warning/error messages.  I'll take any
&lt;br&gt;&amp;gt;&amp;gt; comments
&lt;br&gt;&amp;gt;&amp;gt; anyone has on doing something like that... I'm not sure how easy it is for
&lt;br&gt;&amp;gt;&amp;gt; you to determine when you know everything has been loaded..
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Cheers
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; View this message in context: &lt;a href=&quot;http://old.nabble.com/Memory-consumption-problems-tp18649090p26607167.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://old.nabble.com/Memory-consumption-problems-tp18649090p26607167.html&lt;/a&gt;&lt;br&gt;&amp;gt; Sent from the AspectJ - users mailing list archive at Nabble.com.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; aspectj-users mailing list
&lt;br&gt;&amp;gt; aspectj-users@eclipse.org
&lt;br&gt;&amp;gt; &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;aspectj-users@eclipse.org
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Memory-consumption-problems-tp18649090p26613501.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26613244</id>
	<title>Re: Generated AjcClosure classes</title>
	<published>2009-12-02T09:48:29Z</published>
	<updated>2009-12-02T09:48:29Z</updated>
	<author>
		<name>Andrica Silviu</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;&lt;br&gt;On Dec 2, 2009, at 6:11 PM, Andy Clement wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi Silviu,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; I am using Aj to perform runtime weaving. Afterwards, I'm saving the weaved
&lt;br&gt;&amp;gt;&amp;gt; class into a cache so as to avoid the instrumentation on subsequent runs.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; You know, I'm on the verge of creating such a thing in AspectJ
&lt;br&gt;&amp;gt; itself... I would be interested to here about your approach and how
&lt;br&gt;&amp;gt; you know when to invalidate the cache, and what are you using as the
&lt;br&gt;&amp;gt; cache key (some combination of the class itself hashed or something,
&lt;br&gt;&amp;gt; plus the combination of aspects defined at the time, hashed or
&lt;br&gt;&amp;gt; something?)
&lt;/div&gt;Great to hear this. Or not :) because I'm currently writing a paper about these things.
&lt;br&gt;As a cache key I use a hash of the bytecode of the unaltered class. After I compute the hash, I weave aspects to the class and save the weaved class into the cache.
&lt;br&gt;On subsequent program executions, I recompute the hash and retrieve the weaved version. When the list of aspects I instrument classes with changes, I invalidate the cache.
&lt;br&gt;Thus, after changing the list of aspects, on subsequent runs, a new cache is rebuilt. One thing I'm considering is having caches for each sequence of applied aspects so as to not start from scratch if there is a common sub sequence between what I already cached and the new list of aspects.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; If AspectJ did this itself then the only user configuration would be a
&lt;br&gt;&amp;gt; place to keep these woven classes so that they can be retrieved later.
&lt;br&gt;&amp;gt; Do you have any specific requirements for the cache in your scenario?
&lt;br&gt;&amp;gt; (or does anyone else reading this have requirements on a cache like
&lt;br&gt;&amp;gt; this?)
&lt;br&gt;Well, I would like to be able to retrieve them. Nothing more. A predefined place would be best.
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; Now, my problem is that I use around advices that create additional
&lt;br&gt;&amp;gt;&amp;gt; Class$AjcClosure.
&lt;br&gt;&amp;gt;&amp;gt; Is there any way I can get handle of those classes? I must mention I am
&lt;br&gt;&amp;gt;&amp;gt; using a java agent that would normally be called whenever a new class is
&lt;br&gt;&amp;gt;&amp;gt; loaded, but it appears that the Closure classes somehow escape this.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; There currently isn't a way for you to get at them I don't think - but
&lt;br&gt;&amp;gt; there have been other requests to access them, or at least be made
&lt;br&gt;&amp;gt; aware of them. &amp;nbsp;This wasn't for a caching purpose but merely to avoid
&lt;br&gt;&amp;gt; clashes in the case where an attempt is made to define the same class
&lt;br&gt;&amp;gt; twice (&lt;a href=&quot;https://bugs.eclipse.org/bugs/show_bug.cgi?id=287426&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://bugs.eclipse.org/bugs/show_bug.cgi?id=287426&lt;/a&gt;).
&lt;/div&gt;So what happens with the $AjcClosure classes? Isn't there a way I can get their bytecode? WeavingAdaptor has a method called &amp;quot;accept&amp;quot; that sounds to do just that. Also, the WeavingAdaptor constructor takes in a &amp;quot;GeneratedClassHandler&amp;quot;. Is there a way I can get a hold of that handler from within &amp;quot;Aj&amp;quot;?
&lt;br&gt;&lt;br&gt;Thanks a lot!
&lt;br&gt;&lt;br&gt;Silviu
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Raise an enhancement request and I'll see what I can do.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Andy
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; aspectj-users mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26613244&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26613244&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Generated-AjcClosure-classes-tp26607890p26613244.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26613138</id>
	<title>Re: Memory consumption problems</title>
	<published>2009-12-02T09:43:45Z</published>
	<updated>2009-12-02T09:43:45Z</updated>
	<author>
		<name>Andy Clement</name>
	</author>
	<content type="html">Hi Tim,
&lt;br&gt;&lt;br&gt;Yes, the inclusions/exclusions define what gets pulled into the world
&lt;br&gt;map for weaving, but they (and related weaver state for them) do still
&lt;br&gt;consume a bunch of space. &amp;nbsp;Any types pulled in during analysis of the
&lt;br&gt;types for weaving is temporarily in the world but discarded later (or
&lt;br&gt;rather orphaned later, for GC). &amp;nbsp;Things are improved in AspectJ 1.6.7.
&lt;br&gt;&amp;nbsp;In 1.6.7, after a weave we more aggressively chuck away (orphan)
&lt;br&gt;types that were not affected by ITDs. &amp;nbsp;Basically trying to discard
&lt;br&gt;anything which can easily/cheaply be discovered again later. &amp;nbsp;If the
&lt;br&gt;world is still too large then having a hook so we can be told we are
&lt;br&gt;no longer needed (a shutdown type call) may be the 'final solution'.
&lt;br&gt;&lt;br&gt;More details on the strategy that is now turned on by default are in
&lt;br&gt;this article:
&lt;br&gt;&lt;a href=&quot;http://andrewclement.blogspot.com/2009/04/aspectj-load-time-weaving-and-memory.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://andrewclement.blogspot.com/2009/04/aspectj-load-time-weaving-and-memory.html&lt;/a&gt;&lt;br&gt;In the article it is called type demotion and had to be switched on
&lt;br&gt;prior to 1.6.7, but in 1.6.7 it is the default behaviour.
&lt;br&gt;&lt;br&gt;cheers,
&lt;br&gt;Andy
&lt;br&gt;&lt;br&gt;2009/12/2 Tim Schraepen &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26613138&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sch3lp@...&lt;/a&gt;&amp;gt;:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Why don't you just use the inclusion and exclusion rules in the aop.xml files
&lt;br&gt;&amp;gt; to decide which classes actually get loaded into the World map?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Andy Clement wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Given that doing the right thing with freeing memory is non trivial, I was
&lt;br&gt;&amp;gt;&amp;gt; thinking just now about an interim measure.  A user callable API where you
&lt;br&gt;&amp;gt;&amp;gt; could indicate to the AspectJ infrastructure that you *knew* the
&lt;br&gt;&amp;gt;&amp;gt; classloader
&lt;br&gt;&amp;gt;&amp;gt; had finished loading everything you wanted it to.  Upon making the API
&lt;br&gt;&amp;gt;&amp;gt; call
&lt;br&gt;&amp;gt;&amp;gt; we would immediately discard the whole weaver *but* keep a note of the
&lt;br&gt;&amp;gt;&amp;gt; classloader so that any future attempts to load classes that would have
&lt;br&gt;&amp;gt;&amp;gt; been
&lt;br&gt;&amp;gt;&amp;gt; woven will receive suitable warning/error messages.  I'll take any
&lt;br&gt;&amp;gt;&amp;gt; comments
&lt;br&gt;&amp;gt;&amp;gt; anyone has on doing something like that... I'm not sure how easy it is for
&lt;br&gt;&amp;gt;&amp;gt; you to determine when you know everything has been loaded..
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Cheers
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; View this message in context: &lt;a href=&quot;http://old.nabble.com/Memory-consumption-problems-tp18649090p26607167.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://old.nabble.com/Memory-consumption-problems-tp18649090p26607167.html&lt;/a&gt;&lt;br&gt;&amp;gt; Sent from the AspectJ - users mailing list archive at Nabble.com.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; aspectj-users mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26613138&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;/div&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26613138&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Memory-consumption-problems-tp18649090p26613138.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26612615</id>
	<title>Re: Generated AjcClosure classes</title>
	<published>2009-12-02T09:11:49Z</published>
	<updated>2009-12-02T09:11:49Z</updated>
	<author>
		<name>Andy Clement</name>
	</author>
	<content type="html">Hi Silviu,
&lt;br&gt;&lt;br&gt;&amp;gt; I am using Aj to perform runtime weaving. Afterwards, I'm saving the weaved
&lt;br&gt;&amp;gt; class into a cache so as to avoid the instrumentation on subsequent runs.
&lt;br&gt;&lt;br&gt;You know, I'm on the verge of creating such a thing in AspectJ
&lt;br&gt;itself... I would be interested to here about your approach and how
&lt;br&gt;you know when to invalidate the cache, and what are you using as the
&lt;br&gt;cache key (some combination of the class itself hashed or something,
&lt;br&gt;plus the combination of aspects defined at the time, hashed or
&lt;br&gt;something?)
&lt;br&gt;&lt;br&gt;If AspectJ did this itself then the only user configuration would be a
&lt;br&gt;place to keep these woven classes so that they can be retrieved later.
&lt;br&gt;&amp;nbsp;Do you have any specific requirements for the cache in your scenario?
&lt;br&gt;(or does anyone else reading this have requirements on a cache like
&lt;br&gt;this?)
&lt;br&gt;&lt;br&gt;&amp;gt; Now, my problem is that I use around advices that create additional
&lt;br&gt;&amp;gt; Class$AjcClosure.
&lt;br&gt;&amp;gt; Is there any way I can get handle of those classes? I must mention I am
&lt;br&gt;&amp;gt; using a java agent that would normally be called whenever a new class is
&lt;br&gt;&amp;gt; loaded, but it appears that the Closure classes somehow escape this.
&lt;br&gt;&lt;br&gt;There currently isn't a way for you to get at them I don't think - but
&lt;br&gt;there have been other requests to access them, or at least be made
&lt;br&gt;aware of them. &amp;nbsp;This wasn't for a caching purpose but merely to avoid
&lt;br&gt;clashes in the case where an attempt is made to define the same class
&lt;br&gt;twice (&lt;a href=&quot;https://bugs.eclipse.org/bugs/show_bug.cgi?id=287426&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://bugs.eclipse.org/bugs/show_bug.cgi?id=287426&lt;/a&gt;).
&lt;br&gt;&lt;br&gt;Raise an enhancement request and I'll see what I can do.
&lt;br&gt;&lt;br&gt;Andy
&lt;br&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26612615&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Generated-AjcClosure-classes-tp26607890p26612615.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26607890</id>
	<title>Generated AjcClosure classes</title>
	<published>2009-12-02T04:10:54Z</published>
	<updated>2009-12-02T04:10:54Z</updated>
	<author>
		<name>Andrica Silviu</name>
	</author>
	<content type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;Hello,&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I am using Aj to perform runtime weaving. Afterwards, I'm saving the weaved class into a cache so as to avoid the instrumentation on subsequent runs.&lt;/div&gt;&lt;div&gt;Now, my problem is that I use &lt;i&gt;around&lt;/i&gt;&amp;nbsp;advices that create additional Class$AjcClosure.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Is there any way I can get handle of those classes? I must mention I am using a java agent that would normally be called whenever a new class is loaded, but it appears that the Closure classes somehow escape this.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Thanks a lot,&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;Silviu&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607890&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Generated-AjcClosure-classes-tp26607890p26607890.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26607167</id>
	<title>Re: Memory consumption problems</title>
	<published>2009-12-02T03:07:40Z</published>
	<updated>2009-12-02T03:07:40Z</updated>
	<author>
		<name>Tim Schraepen</name>
	</author>
	<content type="html">Why don't you just use the inclusion and exclusion rules in the aop.xml files to decide which classes actually get loaded into the World map?
&lt;br&gt;&lt;br&gt;&lt;blockquote class=&quot;quote light-black dark-border-color&quot;&gt;&lt;div class=&quot;quote light-border-color&quot;&gt;
&lt;div class=&quot;quote-author&quot; style=&quot;font-weight: bold;&quot;&gt;Andy Clement wrote:&lt;/div&gt;
&lt;div class=&quot;quote-message shrinkable-quote&quot;&gt;Given that doing the right thing with freeing memory is non trivial, I was
&lt;br&gt;thinking just now about an interim measure. &amp;nbsp;A user callable API where you
&lt;br&gt;could indicate to the AspectJ infrastructure that you *knew* the classloader
&lt;br&gt;had finished loading everything you wanted it to. &amp;nbsp;Upon making the API call
&lt;br&gt;we would immediately discard the whole weaver *but* keep a note of the
&lt;br&gt;classloader so that any future attempts to load classes that would have been
&lt;br&gt;woven will receive suitable warning/error messages. &amp;nbsp;I'll take any comments
&lt;br&gt;anyone has on doing something like that... I'm not sure how easy it is for
&lt;br&gt;you to determine when you know everything has been loaded..
&lt;br&gt;&lt;br&gt;Cheers
&lt;/div&gt;
&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Memory-consumption-problems-tp18649090p26607167.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26581918</id>
	<title>Re: Performance Issues when exposing context from  Annotations</title>
	<published>2009-11-30T13:09:39Z</published>
	<updated>2009-11-30T13:09:39Z</updated>
	<author>
		<name>Andy Clement</name>
	</author>
	<content type="html">Both changes are now in (bug fix and new syntax support). &amp;nbsp;And
&lt;br&gt;although annotation binding is now fast, annotation value binding (for
&lt;br&gt;strings) is even faster in this scenario.
&lt;br&gt;&lt;br&gt;A simple benchmark, distilled from the original. &amp;nbsp;CaseThree below is
&lt;br&gt;the new syntax for directly binding annotation value strings
&lt;br&gt;---
&lt;br&gt;import org.aspectj.lang.*;
&lt;br&gt;import org.aspectj.lang.reflect.*;
&lt;br&gt;import java.lang.annotation.*;
&lt;br&gt;&lt;br&gt;@Retention(RetentionPolicy.RUNTIME)
&lt;br&gt;@interface Marker {
&lt;br&gt;&amp;nbsp; &amp;nbsp;String message();
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;public class Perf {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; public static void main(String []argv) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; run(true);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; run(false);
&lt;br&gt;&amp;nbsp; }
&lt;br&gt;&lt;br&gt;&amp;nbsp; public static void run(boolean warmup) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; long stime = System.currentTimeMillis();
&lt;br&gt;&amp;nbsp; &amp;nbsp; for (int i=0;i&amp;lt;1000000;i++) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;runOne();
&lt;br&gt;&amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;nbsp; &amp;nbsp; long etime = System.currentTimeMillis();
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; long manual = (etime-stime);
&lt;br&gt;&amp;nbsp; &amp;nbsp; stime = System.currentTimeMillis();
&lt;br&gt;&amp;nbsp; &amp;nbsp; for (int i=0;i&amp;lt;1000000;i++) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;runTwo();
&lt;br&gt;&amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;nbsp; &amp;nbsp; etime = System.currentTimeMillis();
&lt;br&gt;&amp;nbsp; &amp;nbsp; long woven = (etime-stime);
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; stime = System.currentTimeMillis();
&lt;br&gt;&amp;nbsp; &amp;nbsp; for (int i=0;i&amp;lt;1000000;i++) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;runThree();
&lt;br&gt;&amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;nbsp; &amp;nbsp; etime = System.currentTimeMillis();
&lt;br&gt;&amp;nbsp; &amp;nbsp; long optimal = (etime-stime);
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; if (!warmup) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; 	System.out.println(&amp;quot;Manually fetching annotation with
&lt;br&gt;getAnnotation(): &amp;quot;+manual+&amp;quot;ms&amp;quot;);
&lt;br&gt;&amp;nbsp; &amp;nbsp; 	System.out.println(&amp;quot;Binding annotation with @annotation(Marker):
&lt;br&gt;&amp;quot;+woven+&amp;quot;ms&amp;quot;);
&lt;br&gt;&amp;nbsp; &amp;nbsp; 	System.out.println(&amp;quot;Binding annotation value with
&lt;br&gt;@annotation(Marker(message)): &amp;quot;+optimal+&amp;quot;ms&amp;quot;);
&lt;br&gt;&amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;nbsp; &amp;nbsp; if (woven&amp;gt;manual) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; 	throw new RuntimeException(&amp;quot;woven = &amp;quot;+woven+&amp;quot; manual = &amp;quot;+manual);
&lt;br&gt;&amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;nbsp; &amp;nbsp; if (optimal&amp;gt;woven) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; 	throw new RuntimeException(&amp;quot;optimal = &amp;quot;+optimal+&amp;quot; woven = &amp;quot;+woven);
&lt;br&gt;&amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;nbsp; }
&lt;br&gt;&lt;br&gt;&amp;nbsp; @Marker(message=&amp;quot;string&amp;quot;)
&lt;br&gt;&amp;nbsp; public static void runOne() {
&lt;br&gt;&amp;nbsp; }
&lt;br&gt;&lt;br&gt;&amp;nbsp; @Marker(message=&amp;quot;string&amp;quot;)
&lt;br&gt;&amp;nbsp; public static void runTwo() {
&lt;br&gt;&amp;nbsp; }
&lt;br&gt;&lt;br&gt;&amp;nbsp; @Marker(message=&amp;quot;string&amp;quot;)
&lt;br&gt;&amp;nbsp; public static void runThree() {
&lt;br&gt;&amp;nbsp; }
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;aspect X {
&lt;br&gt;&amp;nbsp; &amp;nbsp;public static int a,b,c;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;// CaseOne: annotation fetching is done in the advice:
&lt;br&gt;&amp;nbsp; &amp;nbsp;pointcut adviceRetrievesAnnotation(): execution(@Marker * runOne(..));
&lt;br&gt;&amp;nbsp; &amp;nbsp;before(): adviceRetrievesAnnotation() {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Marker marker = (Marker) ((MethodSignature)
&lt;br&gt;thisJoinPointStaticPart.getSignature()).getMethod().getAnnotation(Marker.class);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;String s = marker.message();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;a+=s.length();
&lt;br&gt;&amp;nbsp; &amp;nbsp;}
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;// CaseTwo: annotation binding is done in the pointcut, advice
&lt;br&gt;retrieves message
&lt;br&gt;&amp;nbsp; &amp;nbsp;pointcut pointcutBindsAnnotation(Marker l): execution(@Marker *
&lt;br&gt;runTwo(..)) &amp;&amp; @annotation(l);
&lt;br&gt;&amp;nbsp; &amp;nbsp;before(Marker l): pointcutBindsAnnotation(l) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;String s = l.message();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;b+=s.length();
&lt;br&gt;&amp;nbsp; &amp;nbsp;}
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;// CaseThree: annotation binding directly targets the message value
&lt;br&gt;in the annotation
&lt;br&gt;&amp;nbsp; &amp;nbsp;pointcut pointcutBindsAnnotationValue(String msg):
&lt;br&gt;execution(@Marker * runThree(..)) &amp;&amp; @annotation(Marker(msg));
&lt;br&gt;&amp;nbsp; &amp;nbsp;before(String s): pointcutBindsAnnotationValue(s) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;c+=s.length();
&lt;br&gt;&amp;nbsp; &amp;nbsp;}
&lt;br&gt;}
&lt;br&gt;---
&lt;br&gt;Running it:
&lt;br&gt;Manually fetching annotation with getAnnotation(): 645ms
&lt;br&gt;Binding annotation with @annotation(Marker): 445ms
&lt;br&gt;Binding annotation value with @annotation(Marker(message)): 3ms
&lt;br&gt;&lt;br&gt;I must say I've never seen a logging system that specifies the message
&lt;br&gt;to log in the annotation, since normally the method signature is used
&lt;br&gt;as an indication of where the system currently is. &amp;nbsp;There is nothing
&lt;br&gt;wrong with doing that but it goes a little way to explain the missing
&lt;br&gt;optimization as it has never come up before. &amp;nbsp;The logging aspects I've
&lt;br&gt;seen before merely used the annotation as a marker, sometimes
&lt;br&gt;expressing trace levels in it:
&lt;br&gt;&lt;br&gt;@Trace(TraveLevel.DEBUG)
&lt;br&gt;&lt;br&gt;and that kind of case which uses enums was optimized for (for matching
&lt;br&gt;and binding).
&lt;br&gt;&lt;br&gt;If you come up with other scenarios, feel free to raise bugs for them!
&lt;br&gt;&lt;br&gt;cheers,
&lt;br&gt;Andy
&lt;br&gt;&lt;br&gt;&lt;br&gt;2009/11/30 Andy Clement &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26581918&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;andrew.clement@...&lt;/a&gt;&amp;gt;:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Yes, that is rather sub-optimal isn't it :)  I'll look at the bug in a
&lt;br&gt;&amp;gt; bit.  Irrespective of that bug, the most absolute optimal way to
&lt;br&gt;&amp;gt; express these pointcuts would probably be this:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; public pointcut loggedMethod() : execution(@Log * *(..));
&lt;br&gt;&amp;gt; public pointcut log(String logMessage): loggedMethod() &amp;&amp;
&lt;br&gt;&amp;gt; @annotation(Log(logMessage));
&lt;br&gt;&amp;gt; public pointcut log2(): loggedMethod() &amp;&amp; !cflowbelow(loggedMethod());
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; In the middle one you can see I am binding the string property of the
&lt;br&gt;&amp;gt; annotation directly.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; *unfortunately* that binding form isn't supported today (for strings)
&lt;br&gt;&amp;gt; - it is only allowed for annotation values that are enums (see
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://andrewclement.blogspot.com/2009/02/aspectj-optimized-annotation-value.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://andrewclement.blogspot.com/2009/02/aspectj-optimized-annotation-value.html&lt;/a&gt;&lt;br&gt;&amp;gt; ).  I might try to add support for strings whilst looking at the other
&lt;br&gt;&amp;gt; issue.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Andy
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 2009/11/30 Simone Gianni &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26581918&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;simoneg@...&lt;/a&gt;&amp;gt;:
&lt;br&gt;&amp;gt;&amp;gt; Hi Oliver,
&lt;br&gt;&amp;gt;&amp;gt; yes, you are writing to the right mailing list.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; 3 seconds against 49 is quite shocking, but I can confirm getting 4 seconds
&lt;br&gt;&amp;gt;&amp;gt; against 22 on my machine, which is wrong anyway. I'm using AspectJ 1.6.6,
&lt;br&gt;&amp;gt;&amp;gt; compile time weaving, inside Eclipse with AJDT.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I also tried rewriting your pointcuts a bit :
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; public pointcut loggedMethod() : execution(@Log * *(..));
&lt;br&gt;&amp;gt;&amp;gt; public pointcut log(Log log): loggedMethod() &amp;&amp; @annotation(log);  public
&lt;br&gt;&amp;gt;&amp;gt; pointcut log2(): loggedMethod() &amp;&amp; !cflowbelow(loggedMethod());
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; this makes log and log2 two completely different pointcut &amp;quot;hierarchies&amp;quot;,
&lt;br&gt;&amp;gt;&amp;gt; making it easier to test them out one by one.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Also, cflowbelow(log(Log)) could cause a second context extraction (very
&lt;br&gt;&amp;gt;&amp;gt; useful for the wormhole pattern), that could make things go slower.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; However, it did not change the results, still getting 3/4 seconds against
&lt;br&gt;&amp;gt;&amp;gt; 22/23.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I removed the cflowbelow part completely, just to test only the context
&lt;br&gt;&amp;gt;&amp;gt; extraction part :
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;   public pointcut loggedMethod() : execution(@Log * *(..));
&lt;br&gt;&amp;gt;&amp;gt;   public pointcut log(Log log): loggedMethod() &amp;&amp; @annotation(log);
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Dynamic annotation :
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;       before(): loggedMethod() {
&lt;br&gt;&amp;gt;&amp;gt;           Log log = (Log) ((MethodSignature)
&lt;br&gt;&amp;gt;&amp;gt; thisJoinPointStaticPart.getSignature()).getMethod().getAnnotation(Log.class);
&lt;br&gt;&amp;gt;&amp;gt;                     log.message();
&lt;br&gt;&amp;gt;&amp;gt;       }
&lt;br&gt;&amp;gt;&amp;gt;       after() returning: loggedMethod() {
&lt;br&gt;&amp;gt;&amp;gt;           Log log = (Log) ((MethodSignature)
&lt;br&gt;&amp;gt;&amp;gt; thisJoinPointStaticPart.getSignature()).getMethod().getAnnotation(Log.class);
&lt;br&gt;&amp;gt;&amp;gt;                     log.message();
&lt;br&gt;&amp;gt;&amp;gt;       }
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Annotation as parameter :
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;       before(Log log): log(log) {
&lt;br&gt;&amp;gt;&amp;gt;           log.message();
&lt;br&gt;&amp;gt;&amp;gt;       }
&lt;br&gt;&amp;gt;&amp;gt;       after(Log log) returning: log(log) {
&lt;br&gt;&amp;gt;&amp;gt;           log.message();
&lt;br&gt;&amp;gt;&amp;gt;       }
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; And yes, the first one takes 2/3 seconds, the second one 22/23 seconds.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Raising the number of cycles from 1 milion to 10 milion still results in 20
&lt;br&gt;&amp;gt;&amp;gt; seconds agains 200 seconds, so a 1:10 ratio anyway.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I checked that both matched correctly, obtained the same number of calls to
&lt;br&gt;&amp;gt;&amp;gt; advice, checked that &amp;quot;log&amp;quot; was there and no other optimization was taking
&lt;br&gt;&amp;gt;&amp;gt; place (also sent to output log.message()).
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Using javap on SampleProgram I can see that AspectJ weaves these
&lt;br&gt;&amp;gt;&amp;gt; isntructions :
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;  49:  ldc     #1; //class tests/SampleProgram
&lt;br&gt;&amp;gt;&amp;gt;  51:  ldc     #92; //String calc
&lt;br&gt;&amp;gt;&amp;gt;  53:  iconst_0
&lt;br&gt;&amp;gt;&amp;gt;  54:  anewarray       #74; //class java/lang/Class
&lt;br&gt;&amp;gt;&amp;gt;  57:  invokevirtual   #78; //Method
&lt;br&gt;&amp;gt;&amp;gt; java/lang/Class.getDeclaredMethod:(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
&lt;br&gt;&amp;gt;&amp;gt;  60:  ldc     #71; //class tests/Log
&lt;br&gt;&amp;gt;&amp;gt;  62:  invokevirtual   #84; //Method
&lt;br&gt;&amp;gt;&amp;gt; java/lang/reflect/Method.getAnnotation:(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;
&lt;br&gt;&amp;gt;&amp;gt;  65:  checkcast       #71; //class tests/Log
&lt;br&gt;&amp;gt;&amp;gt;  68:  invokevirtual   #91; //Method
&lt;br&gt;&amp;gt;&amp;gt; tests/Intercept.ajc$afterReturning$tests_Intercept$2$74fc38c9:(Ltests/Log;)V
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Which, in plain java, are :
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Log l =
&lt;br&gt;&amp;gt;&amp;gt; SampleProgram.class.getDeclaredMethod(&amp;quot;calc&amp;quot;).getAnnotation(Log.class);
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; If I change
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Log log = (Log) ((MethodSignature)
&lt;br&gt;&amp;gt;&amp;gt; thisJoinPointStaticPart.getSignature()).getMethod().getAnnotation(Log.class);
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; To
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Log log =
&lt;br&gt;&amp;gt;&amp;gt; SampleProgram.class.getDeclaredMethod(&amp;quot;calc&amp;quot;).getAnnotation(Log.class);
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I obtain 23/24 seconds also with dynamic annotation lookup.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; So the problem is the suboptimal way used by AspectJ when weaving
&lt;br&gt;&amp;gt;&amp;gt; @annotation(log).
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I raised the bug &lt;a href=&quot;https://bugs.eclipse.org/bugs/show_bug.cgi?id=296484&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://bugs.eclipse.org/bugs/show_bug.cgi?id=296484&lt;/a&gt;&amp;nbsp;, and
&lt;br&gt;&amp;gt;&amp;gt; given you credit for the discovery.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Simone
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Oliver Hoff wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; At first: If I am posting on the wrong list, I am sorry for that. I didnt
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; got used to mailing lists so far. (yeah computer science young generation
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; loves fancy Web2.0 communication tools)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I recently started to play around with AspectJ and tried an aspect based
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; generic logging example, where &amp;quot;log context configuration&amp;quot; (when and what
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; should be logged) is specified within annotations. While I had no problems
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; to get the example running, I have done some performance testing. While its
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; definitly possible that I have messed with some &amp;quot;opimization guideline&amp;quot;,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; maybe you will find the following test case interesting.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Log Annotation:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; import java.lang.annotation.Retention;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; import java.lang.annotation.RetentionPolicy;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; @Retention(RetentionPolicy.RUNTIME)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; public @interface Log {
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;    String message() default &amp;quot;&amp;quot;;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; }
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Test program:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; public class SampleProgram {
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;    public static void main(String[] args) {
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;        System.out.println(System.getProperties());
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;        run();
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;    }
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;    @Log(message=&amp;quot;Outer&amp;quot;)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;    public static void run() {
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;        for(int i = 0; i &amp;lt; 1000000; i++) calc();
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;    }      @Log(message=&amp;quot;Inner&amp;quot;)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;    public static void calc() {
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;        for(int i = 0; i &amp;lt; 10; i++) Math.exp(i);
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;    }
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; }
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Testaspect 1:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; import org.aspectj.lang.reflect.MethodSignature;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; public aspect Logging {
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;        public pointcut log(): execution(* *(..)) &amp;&amp; @annotation(Log);
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;  public pointcut log2(): log() &amp;&amp; !cflowbelow(log());
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;    before(): log() {
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;        Log log = (Log) ((MethodSignature)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; thisJoinPointStaticPart.getSignature()).getMethod().getAnnotation(Log.class);
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;        log.message();
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;    }      before(): log2() {
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;        System.out.println(&amp;quot;[&amp;quot; + System.currentTimeMillis() + &amp;quot;] [S &amp;quot; +
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; thisJoinPointStaticPart.getSignature().getName() + &amp;quot;]&amp;quot;);
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;    }      after() returning: log() {
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;        Log log = (Log) ((MethodSignature)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; thisJoinPointStaticPart.getSignature()).getMethod().getAnnotation(Log.class);
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;        log.message();
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;    }      after() returning: log2() {
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;        System.out.println(&amp;quot;[&amp;quot; + System.currentTimeMillis() + &amp;quot;] [F &amp;quot; +
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; thisJoinPointStaticPart.getSignature().getName() + &amp;quot;]&amp;quot;);
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;    }
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; }
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Testaspect 2:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; public aspect Logging2 {
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;          public pointcut log(Log log): execution(* *(..)) &amp;&amp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; @annotation(log);      public pointcut log2(): log(Log) &amp;&amp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; !cflowbelow(log(Log));
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;    before(Log log): log(log) {
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;        log.message();
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;    }      before(): log2() {
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;        System.out.println(&amp;quot;[&amp;quot; + System.currentTimeMillis() + &amp;quot;] [S &amp;quot; +
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; thisJoinPointStaticPart.getSignature().getName() + &amp;quot;]&amp;quot;);
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;    }      after(Log log) returning: log(log) {
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;        log.message();
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;    }      after() returning: log2() {
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;        System.out.println(&amp;quot;[&amp;quot; + System.currentTimeMillis() + &amp;quot;] [F &amp;quot; +
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; thisJoinPointStaticPart.getSignature().getName() + &amp;quot;]&amp;quot;);
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;    }
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; }
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Testcase 1 output: (3 seconds execution time) (JIT on)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; {
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; java.runtime.name=Java(TM) SE Runtime Environment,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; java.runtime.version=1.6.0_07-b06,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; java.vm.version=10.0-b23,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; java.vm.vendor=Sun Microsystems Inc.,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; java.vm.name=Java HotSpot(TM) Client VM,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; java.vm.specification.version=1.0,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; java.class.version=50.0,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; java.version=1.6.0_07,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; java.specification.version=1.6,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; sun.arch.data.model=32,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; ... and more ...
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; }
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; [1259542706359] [S run]
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; [1259542709390] [F run]
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Testcase 2 output: (49 seconds execution time) (JIT on)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; { ... same as above ... }
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; [1259542981187] [S run]
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; [1259543029781] [F run]
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Testcase without aspects: round about 2 seconds
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; As far as I have noticed the second example is the &amp;quot;right&amp;quot; way to access
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;  the information of an annotation, but it is more expensive than the first
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; dynamic access.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I hope that helps somehow and again if this is wrong place or information
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; provided is useless, I am sorry for wasting your time.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Mit freundlichen Grüßen (Sincerely)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Oliver Hoff
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; aspectj-dev mailing list
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26581918&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-dev@...&lt;/a&gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-dev&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; --
&lt;br&gt;&amp;gt;&amp;gt; Simone Gianni            CEO Semeru s.r.l.           Apache Committer
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://www.simonegianni.it/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.simonegianni.it/&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt;&amp;gt; aspectj-dev mailing list
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26581918&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-dev@...&lt;/a&gt;
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-dev&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;_______________________________________________
&lt;br&gt;aspectj-dev mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26581918&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-dev&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---dev-f2218.html&quot; embed=&quot;fixTarget[2218]&quot; target=&quot;_top&quot; &gt;AspectJ - dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Performance-Issues-when-exposing-context-from-Annotations-tp26568331p26581918.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26581358</id>
	<title>Re: AspectJ in a netbeans RCP project</title>
	<published>2009-11-30T12:31:28Z</published>
	<updated>2009-11-30T12:31:28Z</updated>
	<author>
		<name>Andrew Eisenberg</name>
	</author>
	<content type="html">Hi Dirk,
&lt;br&gt;&lt;br&gt;I don't know anything about NetBeans RCP, but if there is any
&lt;br&gt;similarity to Eclipse RCP, then it is not simple to get aspects
&lt;br&gt;working across modules. &amp;nbsp;For Eclipse RCP (since it is built on top of
&lt;br&gt;OSGi), we need to use Equinox Aspects so that the AspectJ weaver can
&lt;br&gt;weave across OSGi bundles (ie- modules).
&lt;br&gt;&lt;br&gt;In other words, there is a difference between using aspects within a
&lt;br&gt;single module and using them across modules. &amp;nbsp;When not working across
&lt;br&gt;modules, the standard aspectj compiler can be used, but when weaving
&lt;br&gt;across modules, something more is required.
&lt;br&gt;&lt;br&gt;Wish I could be more help here...
&lt;br&gt;&lt;br&gt;--a
&lt;br&gt;&lt;br&gt;On Mon, Nov 30, 2009 at 11:47 AM, Dirk Walter &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26581358&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Dirk.Walter@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I have been following the instructions at
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://xentient.com/journal/2009/6/16/using-aspectj-with-netbeans.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xentient.com/journal/2009/6/16/using-aspectj-with-netbeans.html&lt;/a&gt;&lt;br&gt;&amp;gt; to get AspectJ working with my Netbeans RCP based application.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I only want to use one relatively simple aspect to test if stuff is
&lt;br&gt;&amp;gt; happening inside the EDT, because I know much of the code isn't. Hence I
&lt;br&gt;&amp;gt; am using the aspect code described at the bottom of this article,
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://weblogs.java.net/blog/alexfromsun/archive/2006/02/debugging_swing.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://weblogs.java.net/blog/alexfromsun/archive/2006/02/debugging_swing.html&lt;/a&gt;&amp;nbsp;to find all the areas where the gui is being accessed outside the EDT.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; However I seem to have problems using it across modules, does anyone
&lt;br&gt;&amp;gt; have any advice on how to use AspectJ with the netbeans RCP so that the
&lt;br&gt;&amp;gt; pointcuts apply to all modules? Since it is only being used for
&lt;br&gt;&amp;gt; debugging I would ideally like it to be easy to add or remove.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I am using the AspectJ pulgin by Ramos
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=4015&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=4015&lt;/a&gt;&amp;nbsp;and netbeans 6.5 if that helps.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; aspectj-users mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26581358&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;/div&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26581358&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/AspectJ-in-a-netbeans-RCP-project-tp26580727p26581358.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26580727</id>
	<title>AspectJ in a netbeans RCP project</title>
	<published>2009-11-30T11:47:06Z</published>
	<updated>2009-11-30T11:47:06Z</updated>
	<author>
		<name>Dirk Walter</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;&lt;br&gt;I have been following the instructions at
&lt;br&gt;&lt;a href=&quot;http://xentient.com/journal/2009/6/16/using-aspectj-with-netbeans.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xentient.com/journal/2009/6/16/using-aspectj-with-netbeans.html&lt;/a&gt;&lt;br&gt;to get AspectJ working with my Netbeans RCP based application. 
&lt;br&gt;&lt;br&gt;I only want to use one relatively simple aspect to test if stuff is
&lt;br&gt;happening inside the EDT, because I know much of the code isn't. Hence I
&lt;br&gt;am using the aspect code described at the bottom of this article,
&lt;br&gt;&lt;a href=&quot;http://weblogs.java.net/blog/alexfromsun/archive/2006/02/debugging_swing.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://weblogs.java.net/blog/alexfromsun/archive/2006/02/debugging_swing.html&lt;/a&gt;&amp;nbsp;to find all the areas where the gui is being accessed outside the EDT. 
&lt;br&gt;&lt;br&gt;However I seem to have problems using it across modules, does anyone
&lt;br&gt;have any advice on how to use AspectJ with the netbeans RCP so that the
&lt;br&gt;pointcuts apply to all modules? Since it is only being used for
&lt;br&gt;debugging I would ideally like it to be easy to add or remove.
&lt;br&gt;&lt;br&gt;I am using the AspectJ pulgin by Ramos
&lt;br&gt;&lt;a href=&quot;http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=4015&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=4015&lt;/a&gt;&amp;nbsp;and netbeans 6.5 if that helps.
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26580727&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/AspectJ-in-a-netbeans-RCP-project-tp26580727p26580727.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26580270</id>
	<title>Re: AspectJ and code coverage?</title>
	<published>2009-11-30T11:16:17Z</published>
	<updated>2009-11-30T11:16:17Z</updated>
	<author>
		<name>Wim Deblauwe</name>
	</author>
	<content type="html">Would it be possible to provide a sample project with pom.xml on how to do it? Maybe this can be added to some wiki if there is one of aspectj or you can add it to the mavenuser wiki?&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;2009/11/30 Simone Gianni &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26580270&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;simoneg@...&lt;/a&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;Hi Wim,&lt;br&gt;
I&amp;#39;m using Maven2 + AspectJ + Cobertura successfully, but there are a few caveats.&lt;br&gt;
&lt;br&gt;
I&amp;#39;m currently weaving first and then instrumenting with cobertura. If I remember correctly, I&amp;#39;m cobertura-instrumenting the entire jar. I could do this cause in our setup coverage reports are executed in a separate step, when generating the project site. Since AspectJ inlines a few calls inside methods using &amp;quot;line 1&amp;quot; of the target class file, or the first line of the method, you&amp;#39;ll see cobertura reporting a lot of hits on this lines, even if they does not contain any apparently useful code. This may confuse who is used to cobertura reports and not aware of AspectJ internals, but can be interpreted as useful informations cause you may understand how many instructions are executed because of AspectJ aspect lookup.&lt;br&gt;

&lt;br&gt;
I also set up a &amp;quot;load time cobertura instrumentation&amp;quot;, that goes in pair with load time weaving, but in that case if an entire class does not get loaded, cobertura knows nothing about it, which alters the global coverage measurements, so I dropped it.&lt;br&gt;

&lt;br&gt;
If you have a specific error, I can try to investigate it.&lt;br&gt;
&lt;br&gt;
Simone&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Wim Deblauwe wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;
Hi,&lt;br&gt;
&lt;br&gt;
is there anybody who is using AspectJ with a code coverage tool. We are using Cobertura and Maven2, but that does not work when you start to add an aspect to your code and you need to use the ajc compiler. I just checked with Atlassian and Clover cannot seem to manage it according to them. Anybody knows a workaround? I don&amp;#39;t want to have code coverage on the aspect, I just don&amp;#39;t want to loose the coverage on my regular java classes.&lt;br&gt;

&lt;br&gt;
regards,&lt;br&gt;
&lt;br&gt;
Wim&lt;br&gt;&lt;/div&gt;&lt;/div&gt;
------------------------------------------------------------------------&lt;div class=&quot;im&quot;&gt;&lt;br&gt;
&lt;br&gt;
_______________________________________________&lt;br&gt;
aspectj-users mailing list&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26580270&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;
  &lt;br&gt;
&lt;/div&gt;&lt;/blockquote&gt;&lt;font color=&quot;#888888&quot;&gt;
&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
Simone Gianni            CEO Semeru s.r.l.           Apache Committer&lt;br&gt;
&lt;a href=&quot;http://www.simonegianni.it/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://www.simonegianni.it/&lt;/a&gt;&lt;/font&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;
&lt;br&gt;
_______________________________________________&lt;br&gt;
aspectj-users mailing list&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26580270&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26580270&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/AspectJ-and-code-coverage--tp26551154p26580270.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26580117</id>
	<title>Re: Equinox Aspects LTW: capturing aspect  instantiation</title>
	<published>2009-11-30T11:06:42Z</published>
	<updated>2009-11-30T11:06:42Z</updated>
	<author>
		<name>Mario Scalas-2</name>
	</author>
	<content type="html">Hi Martin,&lt;div&gt;   I guess the one you mentioned is the problem (no idea how to check it though ;)). I&amp;#39;ve defined a &amp;quot;real&amp;quot; aspect in my aop.xml:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;/div&gt;
&lt;div&gt;&amp;lt;!DOCTYPE aspectj PUBLIC &amp;quot;-//AspectJ//DTD//EN&amp;quot; &amp;quot;&lt;a href=&quot;http://www.eclipse.org/aspectj/dtd/aspectj.dtd&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.eclipse.org/aspectj/dtd/aspectj.dtd&lt;/a&gt;&amp;quot;&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;aspectj&amp;gt;&lt;/div&gt;&lt;div&gt;
    &amp;lt;aspects&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;&amp;lt;!-- SWT Thread Safety&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;&amp;lt;concrete-aspect name=&amp;quot;it.uniba.di.cdg.jtalk.aspects.SWTThreadingAspect&amp;quot; &lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt;extends=&amp;quot;it.uniba.di.cdg.penelope.ui.swt.AbstractSWTThreadingAspect&amp;quot;&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt;&amp;lt;pointcut name=&amp;quot;scope&amp;quot; expression=&amp;quot;within( it.uniba.di.cdg.jtalk.ui..* )&amp;quot;/&amp;gt;&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;&amp;lt;/concrete-aspect&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt; --&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;&amp;lt;aspect name=&amp;quot;it.uniba.di.cdg.jtalk.aspects.SWTThreadingAspect&amp;quot; /&amp;gt;&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;    &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;&amp;lt;!-- Aspect Injector --&amp;gt;&lt;/div&gt;&lt;div&gt;    &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;&amp;lt;concrete-aspect name=&amp;quot;it.uniba.di.cdg.jtalk.aspects.AspectInjectionAspect&amp;quot; &lt;/div&gt;
&lt;div&gt;    &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;extends=&amp;quot;it.uniba.di.cdg.penelope.AbstractAspectInjectionAspect&amp;quot;&amp;gt;&lt;/div&gt;&lt;div&gt;    &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;&amp;lt;pointcut name=&amp;quot;scope&amp;quot; expression=&amp;quot;within( it.uniba.di.cdg.jtalk.aspects.SWTThreadingAspect )&amp;quot;/&amp;gt;&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;&amp;lt;/concrete-aspect&amp;gt;&lt;/div&gt;&lt;div&gt;    &amp;lt;/aspects&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/aspectj&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;The aspect is just:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;
&lt;div&gt;package it.uniba.di.cdg.jtalk.aspects;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;import org.aspectj.lang.annotation.Aspect;&lt;/div&gt;&lt;div&gt;import org.aspectj.lang.annotation.Pointcut;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;import it.uniba.di.cdg.penelope.ui.swt.AbstractSWTThreadingAspect;&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;@Aspect&lt;/div&gt;&lt;div&gt;public class SWTThreadingAspect extends AbstractSWTThreadingAspect {&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;@Override&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;@Pointcut( &amp;quot;within( it.uniba.di.cdg.jtalk.ui..* )&amp;quot; )&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;public void scope() {}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;In this way, SWTThreadingAspect&amp;#39;s instantiation is correctly catched by the synthetic AspectInjectionAspect.&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;The good thing is that I can dependency inject aspects in this way; the bad one is that I must define &amp;quot;dummy&amp;quot; aspect classes (plus the aop.xml entry) in order to do in code what I may archieve just within the aop.xml file.&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Cheers,&lt;/div&gt;&lt;div&gt;Mario&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Mon, Nov 30, 2009 at 11:55 AM, Martin Lippert &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26580117&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;lippert@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;Hi Mario,&lt;br&gt;
&lt;br&gt;
I am not sure but I think this could be a general LTW problem. I assume the concrete aspects from aop.xml are not passed to the weaver for weaving before defined in the VM, correct?&lt;br&gt;
&lt;br&gt;
Crossposting to aspectj-dev for discussing the implementation details of this setting...&lt;br&gt;
&lt;br&gt;
Cheers,&lt;br&gt;
-Martin&lt;br&gt;
&lt;br&gt;
_______________________________________________&lt;br&gt;
aspectj-users mailing list&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26580117&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;-- &lt;br&gt;&amp;quot;Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.&amp;quot; - Brian W. Kernighan&lt;br&gt;

&lt;/div&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26580117&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Equinox-Aspects-LTW%3A-capturing-aspect-instantiation-tp26504497p26580117.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26578420</id>
	<title>Re: Performance Issues when exposing context from  Annotations</title>
	<published>2009-11-30T09:22:14Z</published>
	<updated>2009-11-30T09:22:14Z</updated>
	<author>
		<name>Andy Clement</name>
	</author>
	<content type="html">Yes, that is rather sub-optimal isn't it :) &amp;nbsp;I'll look at the bug in a
&lt;br&gt;bit. &amp;nbsp;Irrespective of that bug, the most absolute optimal way to
&lt;br&gt;express these pointcuts would probably be this:
&lt;br&gt;&lt;br&gt;public pointcut loggedMethod() : execution(@Log * *(..));
&lt;br&gt;public pointcut log(String logMessage): loggedMethod() &amp;&amp;
&lt;br&gt;@annotation(Log(logMessage));
&lt;br&gt;public pointcut log2(): loggedMethod() &amp;&amp; !cflowbelow(loggedMethod());
&lt;br&gt;&lt;br&gt;In the middle one you can see I am binding the string property of the
&lt;br&gt;annotation directly.
&lt;br&gt;&lt;br&gt;*unfortunately* that binding form isn't supported today (for strings)
&lt;br&gt;- it is only allowed for annotation values that are enums (see
&lt;br&gt;&lt;a href=&quot;http://andrewclement.blogspot.com/2009/02/aspectj-optimized-annotation-value.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://andrewclement.blogspot.com/2009/02/aspectj-optimized-annotation-value.html&lt;/a&gt;&lt;br&gt;). &amp;nbsp;I might try to add support for strings whilst looking at the other
&lt;br&gt;issue.
&lt;br&gt;&lt;br&gt;Andy
&lt;br&gt;&lt;br&gt;&lt;br&gt;2009/11/30 Simone Gianni &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26578420&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;simoneg@...&lt;/a&gt;&amp;gt;:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi Oliver,
&lt;br&gt;&amp;gt; yes, you are writing to the right mailing list.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 3 seconds against 49 is quite shocking, but I can confirm getting 4 seconds
&lt;br&gt;&amp;gt; against 22 on my machine, which is wrong anyway. I'm using AspectJ 1.6.6,
&lt;br&gt;&amp;gt; compile time weaving, inside Eclipse with AJDT.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I also tried rewriting your pointcuts a bit :
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; public pointcut loggedMethod() : execution(@Log * *(..));
&lt;br&gt;&amp;gt; public pointcut log(Log log): loggedMethod() &amp;&amp; @annotation(log);  public
&lt;br&gt;&amp;gt; pointcut log2(): loggedMethod() &amp;&amp; !cflowbelow(loggedMethod());
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; this makes log and log2 two completely different pointcut &amp;quot;hierarchies&amp;quot;,
&lt;br&gt;&amp;gt; making it easier to test them out one by one.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Also, cflowbelow(log(Log)) could cause a second context extraction (very
&lt;br&gt;&amp;gt; useful for the wormhole pattern), that could make things go slower.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; However, it did not change the results, still getting 3/4 seconds against
&lt;br&gt;&amp;gt; 22/23.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I removed the cflowbelow part completely, just to test only the context
&lt;br&gt;&amp;gt; extraction part :
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;   public pointcut loggedMethod() : execution(@Log * *(..));
&lt;br&gt;&amp;gt;   public pointcut log(Log log): loggedMethod() &amp;&amp; @annotation(log);
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Dynamic annotation :
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;       before(): loggedMethod() {
&lt;br&gt;&amp;gt;           Log log = (Log) ((MethodSignature)
&lt;br&gt;&amp;gt; thisJoinPointStaticPart.getSignature()).getMethod().getAnnotation(Log.class);
&lt;br&gt;&amp;gt;                     log.message();
&lt;br&gt;&amp;gt;       }
&lt;br&gt;&amp;gt;       after() returning: loggedMethod() {
&lt;br&gt;&amp;gt;           Log log = (Log) ((MethodSignature)
&lt;br&gt;&amp;gt; thisJoinPointStaticPart.getSignature()).getMethod().getAnnotation(Log.class);
&lt;br&gt;&amp;gt;                     log.message();
&lt;br&gt;&amp;gt;       }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Annotation as parameter :
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;       before(Log log): log(log) {
&lt;br&gt;&amp;gt;           log.message();
&lt;br&gt;&amp;gt;       }
&lt;br&gt;&amp;gt;       after(Log log) returning: log(log) {
&lt;br&gt;&amp;gt;           log.message();
&lt;br&gt;&amp;gt;       }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; And yes, the first one takes 2/3 seconds, the second one 22/23 seconds.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Raising the number of cycles from 1 milion to 10 milion still results in 20
&lt;br&gt;&amp;gt; seconds agains 200 seconds, so a 1:10 ratio anyway.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I checked that both matched correctly, obtained the same number of calls to
&lt;br&gt;&amp;gt; advice, checked that &amp;quot;log&amp;quot; was there and no other optimization was taking
&lt;br&gt;&amp;gt; place (also sent to output log.message()).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Using javap on SampleProgram I can see that AspectJ weaves these
&lt;br&gt;&amp;gt; isntructions :
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;  49:  ldc     #1; //class tests/SampleProgram
&lt;br&gt;&amp;gt;  51:  ldc     #92; //String calc
&lt;br&gt;&amp;gt;  53:  iconst_0
&lt;br&gt;&amp;gt;  54:  anewarray       #74; //class java/lang/Class
&lt;br&gt;&amp;gt;  57:  invokevirtual   #78; //Method
&lt;br&gt;&amp;gt; java/lang/Class.getDeclaredMethod:(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
&lt;br&gt;&amp;gt;  60:  ldc     #71; //class tests/Log
&lt;br&gt;&amp;gt;  62:  invokevirtual   #84; //Method
&lt;br&gt;&amp;gt; java/lang/reflect/Method.getAnnotation:(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;
&lt;br&gt;&amp;gt;  65:  checkcast       #71; //class tests/Log
&lt;br&gt;&amp;gt;  68:  invokevirtual   #91; //Method
&lt;br&gt;&amp;gt; tests/Intercept.ajc$afterReturning$tests_Intercept$2$74fc38c9:(Ltests/Log;)V
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Which, in plain java, are :
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Log l =
&lt;br&gt;&amp;gt; SampleProgram.class.getDeclaredMethod(&amp;quot;calc&amp;quot;).getAnnotation(Log.class);
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; If I change
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Log log = (Log) ((MethodSignature)
&lt;br&gt;&amp;gt; thisJoinPointStaticPart.getSignature()).getMethod().getAnnotation(Log.class);
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; To
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Log log =
&lt;br&gt;&amp;gt; SampleProgram.class.getDeclaredMethod(&amp;quot;calc&amp;quot;).getAnnotation(Log.class);
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I obtain 23/24 seconds also with dynamic annotation lookup.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; So the problem is the suboptimal way used by AspectJ when weaving
&lt;br&gt;&amp;gt; @annotation(log).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I raised the bug &lt;a href=&quot;https://bugs.eclipse.org/bugs/show_bug.cgi?id=296484&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://bugs.eclipse.org/bugs/show_bug.cgi?id=296484&lt;/a&gt;&amp;nbsp;, and
&lt;br&gt;&amp;gt; given you credit for the discovery.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Simone
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Oliver Hoff wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; At first: If I am posting on the wrong list, I am sorry for that. I didnt
&lt;br&gt;&amp;gt;&amp;gt; got used to mailing lists so far. (yeah computer science young generation
&lt;br&gt;&amp;gt;&amp;gt; loves fancy Web2.0 communication tools)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I recently started to play around with AspectJ and tried an aspect based
&lt;br&gt;&amp;gt;&amp;gt; generic logging example, where &amp;quot;log context configuration&amp;quot; (when and what
&lt;br&gt;&amp;gt;&amp;gt; should be logged) is specified within annotations. While I had no problems
&lt;br&gt;&amp;gt;&amp;gt; to get the example running, I have done some performance testing. While its
&lt;br&gt;&amp;gt;&amp;gt; definitly possible that I have messed with some &amp;quot;opimization guideline&amp;quot;,
&lt;br&gt;&amp;gt;&amp;gt; maybe you will find the following test case interesting.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Log Annotation:
&lt;br&gt;&amp;gt;&amp;gt; import java.lang.annotation.Retention;
&lt;br&gt;&amp;gt;&amp;gt; import java.lang.annotation.RetentionPolicy;
&lt;br&gt;&amp;gt;&amp;gt; @Retention(RetentionPolicy.RUNTIME)
&lt;br&gt;&amp;gt;&amp;gt; public @interface Log {
&lt;br&gt;&amp;gt;&amp;gt;    String message() default &amp;quot;&amp;quot;;
&lt;br&gt;&amp;gt;&amp;gt; }
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Test program:
&lt;br&gt;&amp;gt;&amp;gt; public class SampleProgram {
&lt;br&gt;&amp;gt;&amp;gt;    public static void main(String[] args) {
&lt;br&gt;&amp;gt;&amp;gt;        System.out.println(System.getProperties());
&lt;br&gt;&amp;gt;&amp;gt;        run();
&lt;br&gt;&amp;gt;&amp;gt;    }
&lt;br&gt;&amp;gt;&amp;gt;    @Log(message=&amp;quot;Outer&amp;quot;)
&lt;br&gt;&amp;gt;&amp;gt;    public static void run() {
&lt;br&gt;&amp;gt;&amp;gt;        for(int i = 0; i &amp;lt; 1000000; i++) calc();
&lt;br&gt;&amp;gt;&amp;gt;    }      @Log(message=&amp;quot;Inner&amp;quot;)
&lt;br&gt;&amp;gt;&amp;gt;    public static void calc() {
&lt;br&gt;&amp;gt;&amp;gt;        for(int i = 0; i &amp;lt; 10; i++) Math.exp(i);
&lt;br&gt;&amp;gt;&amp;gt;    }
&lt;br&gt;&amp;gt;&amp;gt; }
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Testaspect 1:
&lt;br&gt;&amp;gt;&amp;gt; import org.aspectj.lang.reflect.MethodSignature;
&lt;br&gt;&amp;gt;&amp;gt; public aspect Logging {
&lt;br&gt;&amp;gt;&amp;gt;        public pointcut log(): execution(* *(..)) &amp;&amp; @annotation(Log);
&lt;br&gt;&amp;gt;&amp;gt;  public pointcut log2(): log() &amp;&amp; !cflowbelow(log());
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;    before(): log() {
&lt;br&gt;&amp;gt;&amp;gt;        Log log = (Log) ((MethodSignature)
&lt;br&gt;&amp;gt;&amp;gt; thisJoinPointStaticPart.getSignature()).getMethod().getAnnotation(Log.class);
&lt;br&gt;&amp;gt;&amp;gt;        log.message();
&lt;br&gt;&amp;gt;&amp;gt;    }      before(): log2() {
&lt;br&gt;&amp;gt;&amp;gt;        System.out.println(&amp;quot;[&amp;quot; + System.currentTimeMillis() + &amp;quot;] [S &amp;quot; +
&lt;br&gt;&amp;gt;&amp;gt; thisJoinPointStaticPart.getSignature().getName() + &amp;quot;]&amp;quot;);
&lt;br&gt;&amp;gt;&amp;gt;    }      after() returning: log() {
&lt;br&gt;&amp;gt;&amp;gt;        Log log = (Log) ((MethodSignature)
&lt;br&gt;&amp;gt;&amp;gt; thisJoinPointStaticPart.getSignature()).getMethod().getAnnotation(Log.class);
&lt;br&gt;&amp;gt;&amp;gt;        log.message();
&lt;br&gt;&amp;gt;&amp;gt;    }      after() returning: log2() {
&lt;br&gt;&amp;gt;&amp;gt;        System.out.println(&amp;quot;[&amp;quot; + System.currentTimeMillis() + &amp;quot;] [F &amp;quot; +
&lt;br&gt;&amp;gt;&amp;gt; thisJoinPointStaticPart.getSignature().getName() + &amp;quot;]&amp;quot;);
&lt;br&gt;&amp;gt;&amp;gt;    }
&lt;br&gt;&amp;gt;&amp;gt; }
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Testaspect 2:
&lt;br&gt;&amp;gt;&amp;gt; public aspect Logging2 {
&lt;br&gt;&amp;gt;&amp;gt;          public pointcut log(Log log): execution(* *(..)) &amp;&amp;
&lt;br&gt;&amp;gt;&amp;gt; @annotation(log);      public pointcut log2(): log(Log) &amp;&amp;
&lt;br&gt;&amp;gt;&amp;gt; !cflowbelow(log(Log));
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;    before(Log log): log(log) {
&lt;br&gt;&amp;gt;&amp;gt;        log.message();
&lt;br&gt;&amp;gt;&amp;gt;    }      before(): log2() {
&lt;br&gt;&amp;gt;&amp;gt;        System.out.println(&amp;quot;[&amp;quot; + System.currentTimeMillis() + &amp;quot;] [S &amp;quot; +
&lt;br&gt;&amp;gt;&amp;gt; thisJoinPointStaticPart.getSignature().getName() + &amp;quot;]&amp;quot;);
&lt;br&gt;&amp;gt;&amp;gt;    }      after(Log log) returning: log(log) {
&lt;br&gt;&amp;gt;&amp;gt;        log.message();
&lt;br&gt;&amp;gt;&amp;gt;    }      after() returning: log2() {
&lt;br&gt;&amp;gt;&amp;gt;        System.out.println(&amp;quot;[&amp;quot; + System.currentTimeMillis() + &amp;quot;] [F &amp;quot; +
&lt;br&gt;&amp;gt;&amp;gt; thisJoinPointStaticPart.getSignature().getName() + &amp;quot;]&amp;quot;);
&lt;br&gt;&amp;gt;&amp;gt;    }
&lt;br&gt;&amp;gt;&amp;gt; }
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Testcase 1 output: (3 seconds execution time) (JIT on)
&lt;br&gt;&amp;gt;&amp;gt; {
&lt;br&gt;&amp;gt;&amp;gt; java.runtime.name=Java(TM) SE Runtime Environment,
&lt;br&gt;&amp;gt;&amp;gt; java.runtime.version=1.6.0_07-b06,
&lt;br&gt;&amp;gt;&amp;gt; java.vm.version=10.0-b23,
&lt;br&gt;&amp;gt;&amp;gt; java.vm.vendor=Sun Microsystems Inc.,
&lt;br&gt;&amp;gt;&amp;gt; java.vm.name=Java HotSpot(TM) Client VM,
&lt;br&gt;&amp;gt;&amp;gt; java.vm.specification.version=1.0,
&lt;br&gt;&amp;gt;&amp;gt; java.class.version=50.0,
&lt;br&gt;&amp;gt;&amp;gt; java.version=1.6.0_07,
&lt;br&gt;&amp;gt;&amp;gt; java.specification.version=1.6,
&lt;br&gt;&amp;gt;&amp;gt; sun.arch.data.model=32,
&lt;br&gt;&amp;gt;&amp;gt; ... and more ...
&lt;br&gt;&amp;gt;&amp;gt; }
&lt;br&gt;&amp;gt;&amp;gt; [1259542706359] [S run]
&lt;br&gt;&amp;gt;&amp;gt; [1259542709390] [F run]
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Testcase 2 output: (49 seconds execution time) (JIT on)
&lt;br&gt;&amp;gt;&amp;gt; { ... same as above ... }
&lt;br&gt;&amp;gt;&amp;gt; [1259542981187] [S run]
&lt;br&gt;&amp;gt;&amp;gt; [1259543029781] [F run]
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Testcase without aspects: round about 2 seconds
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; As far as I have noticed the second example is the &amp;quot;right&amp;quot; way to access
&lt;br&gt;&amp;gt;&amp;gt;  the information of an annotation, but it is more expensive than the first
&lt;br&gt;&amp;gt;&amp;gt; dynamic access.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I hope that helps somehow and again if this is wrong place or information
&lt;br&gt;&amp;gt;&amp;gt; provided is useless, I am sorry for wasting your time.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Mit freundlichen Grüßen (Sincerely)
&lt;br&gt;&amp;gt;&amp;gt; Oliver Hoff
&lt;br&gt;&amp;gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt;&amp;gt; aspectj-dev mailing list
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26578420&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-dev@...&lt;/a&gt;
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-dev&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; Simone Gianni            CEO Semeru s.r.l.           Apache Committer
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.simonegianni.it/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.simonegianni.it/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; aspectj-dev mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26578420&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-dev@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-dev&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;/div&gt;_______________________________________________
&lt;br&gt;aspectj-dev mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26578420&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-dev&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---dev-f2218.html&quot; embed=&quot;fixTarget[2218]&quot; target=&quot;_top&quot; &gt;AspectJ - dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Performance-Issues-when-exposing-context-from-Annotations-tp26568331p26578420.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26578325</id>
	<title>Re: AspectJ and code coverage?</title>
	<published>2009-11-30T09:16:01Z</published>
	<updated>2009-11-30T09:16:01Z</updated>
	<author>
		<name>Andy Clement</name>
	</author>
	<content type="html">Hi Simone,
&lt;br&gt;&lt;br&gt;Regarding:
&lt;br&gt;&lt;br&gt;&amp;gt; Since AspectJ inlines a few calls inside methods using &amp;quot;line 1&amp;quot; of the target class file, or the first line of the method,
&lt;br&gt;&amp;gt; you'll see cobertura reporting a lot of hits on this lines, even if they does not contain any apparently useful code.
&lt;br&gt;&lt;br&gt;Do you think there is something better we can do to produce nicer
&lt;br&gt;reports? (I'd probably use synthetics, or fix up the lines to
&lt;br&gt;something more appropriate, or get that SMAP thing going that we've
&lt;br&gt;put off for so long)
&lt;br&gt;&lt;br&gt;Andy
&lt;br&gt;&lt;br&gt;2009/11/30 Simone Gianni &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26578325&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;simoneg@...&lt;/a&gt;&amp;gt;:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi Wim,
&lt;br&gt;&amp;gt; I'm using Maven2 + AspectJ + Cobertura successfully, but there are a few
&lt;br&gt;&amp;gt; caveats.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I'm currently weaving first and then instrumenting with cobertura. If I
&lt;br&gt;&amp;gt; remember correctly, I'm cobertura-instrumenting the entire jar. I could do
&lt;br&gt;&amp;gt; this cause in our setup coverage reports are executed in a separate step,
&lt;br&gt;&amp;gt; when generating the project site. Since AspectJ inlines a few calls inside
&lt;br&gt;&amp;gt; methods using &amp;quot;line 1&amp;quot; of the target class file, or the first line of the
&lt;br&gt;&amp;gt; method, you'll see cobertura reporting a lot of hits on this lines, even if
&lt;br&gt;&amp;gt; they does not contain any apparently useful code. This may confuse who is
&lt;br&gt;&amp;gt; used to cobertura reports and not aware of AspectJ internals, but can be
&lt;br&gt;&amp;gt; interpreted as useful informations cause you may understand how many
&lt;br&gt;&amp;gt; instructions are executed because of AspectJ aspect lookup.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I also set up a &amp;quot;load time cobertura instrumentation&amp;quot;, that goes in pair
&lt;br&gt;&amp;gt; with load time weaving, but in that case if an entire class does not get
&lt;br&gt;&amp;gt; loaded, cobertura knows nothing about it, which alters the global coverage
&lt;br&gt;&amp;gt; measurements, so I dropped it.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; If you have a specific error, I can try to investigate it.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Simone
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Wim Deblauwe wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; is there anybody who is using AspectJ with a code coverage tool. We are
&lt;br&gt;&amp;gt;&amp;gt; using Cobertura and Maven2, but that does not work when you start to add an
&lt;br&gt;&amp;gt;&amp;gt; aspect to your code and you need to use the ajc compiler. I just checked
&lt;br&gt;&amp;gt;&amp;gt; with Atlassian and Clover cannot seem to manage it according to them.
&lt;br&gt;&amp;gt;&amp;gt; Anybody knows a workaround? I don't want to have code coverage on the
&lt;br&gt;&amp;gt;&amp;gt; aspect, I just don't want to loose the coverage on my regular java classes.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; regards,
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Wim
&lt;br&gt;&amp;gt;&amp;gt; ------------------------------------------------------------------------
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt;&amp;gt; aspectj-users mailing list
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26578325&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; Simone Gianni            CEO Semeru s.r.l.           Apache Committer
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.simonegianni.it/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.simonegianni.it/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; aspectj-users mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26578325&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;/div&gt;_______________________________________________
&lt;br&gt;aspectj-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26578325&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---users-f2219.html&quot; embed=&quot;fixTarget[2219]&quot; target=&quot;_top&quot; &gt;AspectJ - users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/AspectJ-and-code-coverage--tp26551154p26578325.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26576690</id>
	<title>Re: Performance Issues when exposing context from	Annotations</title>
	<published>2009-11-30T07:40:31Z</published>
	<updated>2009-11-30T07:40:31Z</updated>
	<author>
		<name>Simone Gianni-2</name>
	</author>
	<content type="html">Hi Oliver,
&lt;br&gt;yes, you are writing to the right mailing list.
&lt;br&gt;&lt;br&gt;3 seconds against 49 is quite shocking, but I can confirm getting 4 
&lt;br&gt;seconds against 22 on my machine, which is wrong anyway. I'm using 
&lt;br&gt;AspectJ 1.6.6, compile time weaving, inside Eclipse with AJDT.
&lt;br&gt;&lt;br&gt;I also tried rewriting your pointcuts a bit :
&lt;br&gt;&lt;br&gt;public pointcut loggedMethod() : execution(@Log * *(..));
&lt;br&gt;public pointcut log(Log log): loggedMethod() &amp;&amp; @annotation(log); &amp;nbsp;
&lt;br&gt;public pointcut log2(): loggedMethod() &amp;&amp; !cflowbelow(loggedMethod());
&lt;br&gt;&lt;br&gt;this makes log and log2 two completely different pointcut &amp;quot;hierarchies&amp;quot;, 
&lt;br&gt;making it easier to test them out one by one.
&lt;br&gt;&lt;br&gt;Also, cflowbelow(log(Log)) could cause a second context extraction (very 
&lt;br&gt;useful for the wormhole pattern), that could make things go slower.
&lt;br&gt;&lt;br&gt;However, it did not change the results, still getting 3/4 seconds 
&lt;br&gt;against 22/23.
&lt;br&gt;&lt;br&gt;I removed the cflowbelow part completely, just to test only the context 
&lt;br&gt;extraction part :
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; public pointcut loggedMethod() : execution(@Log * *(..));
&lt;br&gt;&amp;nbsp; &amp;nbsp; public pointcut log(Log log): loggedMethod() &amp;&amp; @annotation(log);
&lt;br&gt;&lt;br&gt;Dynamic annotation :
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; before(): loggedMethod() {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Log log = (Log) ((MethodSignature) 
&lt;br&gt;thisJoinPointStaticPart.getSignature()).getMethod().getAnnotation(Log.class); &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; log.message();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; after() returning: loggedMethod() {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Log log = (Log) ((MethodSignature) 
&lt;br&gt;thisJoinPointStaticPart.getSignature()).getMethod().getAnnotation(Log.class); &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; log.message();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&lt;br&gt;&lt;br&gt;Annotation as parameter :
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; before(Log log): log(log) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; log.message();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; after(Log log) returning: log(log) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; log.message();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&lt;br&gt;And yes, the first one takes 2/3 seconds, the second one 22/23 seconds.
&lt;br&gt;&lt;br&gt;Raising the number of cycles from 1 milion to 10 milion still results in 
&lt;br&gt;20 seconds agains 200 seconds, so a 1:10 ratio anyway.
&lt;br&gt;&lt;br&gt;I checked that both matched correctly, obtained the same number of calls 
&lt;br&gt;to advice, checked that &amp;quot;log&amp;quot; was there and no other optimization was 
&lt;br&gt;taking place (also sent to output log.message()).
&lt;br&gt;&lt;br&gt;Using javap on SampleProgram I can see that AspectJ weaves these 
&lt;br&gt;isntructions :
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;49: &amp;nbsp;ldc &amp;nbsp; &amp;nbsp; #1; //class tests/SampleProgram
&lt;br&gt;&amp;nbsp; &amp;nbsp;51: &amp;nbsp;ldc &amp;nbsp; &amp;nbsp; #92; //String calc
&lt;br&gt;&amp;nbsp; &amp;nbsp;53: &amp;nbsp;iconst_0
&lt;br&gt;&amp;nbsp; &amp;nbsp;54: &amp;nbsp;anewarray &amp;nbsp; &amp;nbsp; &amp;nbsp; #74; //class java/lang/Class
&lt;br&gt;&amp;nbsp; &amp;nbsp;57: &amp;nbsp;invokevirtual &amp;nbsp; #78; //Method 
&lt;br&gt;java/lang/Class.getDeclaredMethod:(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
&lt;br&gt;&amp;nbsp; &amp;nbsp;60: &amp;nbsp;ldc &amp;nbsp; &amp;nbsp; #71; //class tests/Log
&lt;br&gt;&amp;nbsp; &amp;nbsp;62: &amp;nbsp;invokevirtual &amp;nbsp; #84; //Method 
&lt;br&gt;java/lang/reflect/Method.getAnnotation:(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;
&lt;br&gt;&amp;nbsp; &amp;nbsp;65: &amp;nbsp;checkcast &amp;nbsp; &amp;nbsp; &amp;nbsp; #71; //class tests/Log
&lt;br&gt;&amp;nbsp; &amp;nbsp;68: &amp;nbsp;invokevirtual &amp;nbsp; #91; //Method 
&lt;br&gt;tests/Intercept.ajc$afterReturning$tests_Intercept$2$74fc38c9:(Ltests/Log;)V
&lt;br&gt;&lt;br&gt;Which, in plain java, are :
&lt;br&gt;&lt;br&gt;Log l = 
&lt;br&gt;SampleProgram.class.getDeclaredMethod(&amp;quot;calc&amp;quot;).getAnnotation(Log.class);
&lt;br&gt;&lt;br&gt;If I change
&lt;br&gt;&lt;br&gt;Log log = (Log) ((MethodSignature) 
&lt;br&gt;thisJoinPointStaticPart.getSignature()).getMethod().getAnnotation(Log.class); &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&lt;br&gt;To
&lt;br&gt;&lt;br&gt;Log log = 
&lt;br&gt;SampleProgram.class.getDeclaredMethod(&amp;quot;calc&amp;quot;).getAnnotation(Log.class);
&lt;br&gt;&lt;br&gt;I obtain 23/24 seconds also with dynamic annotation lookup.
&lt;br&gt;&lt;br&gt;So the problem is the suboptimal way used by AspectJ when weaving 
&lt;br&gt;@annotation(log).
&lt;br&gt;&lt;br&gt;I raised the bug &lt;a href=&quot;https://bugs.eclipse.org/bugs/show_bug.cgi?id=296484&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://bugs.eclipse.org/bugs/show_bug.cgi?id=296484&lt;/a&gt;&amp;nbsp;, 
&lt;br&gt;and given you credit for the discovery.
&lt;br&gt;&lt;br&gt;Simone
&lt;br&gt;&lt;br&gt;Oliver Hoff wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; At first: If I am posting on the wrong list, I am sorry for that. I 
&lt;br&gt;&amp;gt; didnt got used to mailing lists so far. (yeah computer science young 
&lt;br&gt;&amp;gt; generation loves fancy Web2.0 communication tools)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I recently started to play around with AspectJ and tried an aspect 
&lt;br&gt;&amp;gt; based generic logging example, where &amp;quot;log context configuration&amp;quot; (when 
&lt;br&gt;&amp;gt; and what should be logged) is specified within annotations. While I 
&lt;br&gt;&amp;gt; had no problems to get the example running, I have done some 
&lt;br&gt;&amp;gt; performance testing. While its definitly possible that I have messed 
&lt;br&gt;&amp;gt; with some &amp;quot;opimization guideline&amp;quot;, maybe you will find the following 
&lt;br&gt;&amp;gt; test case interesting.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Log Annotation:
&lt;br&gt;&amp;gt; import java.lang.annotation.Retention;
&lt;br&gt;&amp;gt; import java.lang.annotation.RetentionPolicy;
&lt;br&gt;&amp;gt; @Retention(RetentionPolicy.RUNTIME)
&lt;br&gt;&amp;gt; public @interface Log {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; String message() default &amp;quot;&amp;quot;;
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Test program:
&lt;br&gt;&amp;gt; public class SampleProgram {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; public static void main(String[] args) {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(System.getProperties());
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; run();
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; @Log(message=&amp;quot;Outer&amp;quot;)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; public static void run() {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for(int i = 0; i &amp;lt; 1000000; i++) calc();
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; } &amp;nbsp; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; @Log(message=&amp;quot;Inner&amp;quot;)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; public static void calc() {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for(int i = 0; i &amp;lt; 10; i++) Math.exp(i);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Testaspect 1:
&lt;br&gt;&amp;gt; import org.aspectj.lang.reflect.MethodSignature;
&lt;br&gt;&amp;gt; public aspect Logging {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; public pointcut log(): execution(* *(..)) &amp;&amp; @annotation(Log); &amp;nbsp; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; public pointcut log2(): log() &amp;&amp; !cflowbelow(log());
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; before(): log() {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Log log = (Log) ((MethodSignature) 
&lt;br&gt;&amp;gt; thisJoinPointStaticPart.getSignature()).getMethod().getAnnotation(Log.class); 
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; log.message();
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; } &amp;nbsp; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; before(): log2() {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&amp;quot;[&amp;quot; + System.currentTimeMillis() + &amp;quot;] [S &amp;quot; 
&lt;br&gt;&amp;gt; + thisJoinPointStaticPart.getSignature().getName() + &amp;quot;]&amp;quot;);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; } &amp;nbsp; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; after() returning: log() {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Log log = (Log) ((MethodSignature) 
&lt;br&gt;&amp;gt; thisJoinPointStaticPart.getSignature()).getMethod().getAnnotation(Log.class); 
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; log.message();
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; } &amp;nbsp; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; after() returning: log2() {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&amp;quot;[&amp;quot; + System.currentTimeMillis() + &amp;quot;] [F &amp;quot; 
&lt;br&gt;&amp;gt; + thisJoinPointStaticPart.getSignature().getName() + &amp;quot;]&amp;quot;);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Testaspect 2:
&lt;br&gt;&amp;gt; public aspect Logging2 {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; public pointcut log(Log log): execution(* *(..)) &amp;&amp; 
&lt;br&gt;&amp;gt; @annotation(log); &amp;nbsp; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; public pointcut log2(): log(Log) &amp;&amp; !cflowbelow(log(Log));
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; before(Log log): log(log) {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; log.message();
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; } &amp;nbsp; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; before(): log2() {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&amp;quot;[&amp;quot; + System.currentTimeMillis() + &amp;quot;] [S &amp;quot; 
&lt;br&gt;&amp;gt; + thisJoinPointStaticPart.getSignature().getName() + &amp;quot;]&amp;quot;);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; } &amp;nbsp; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; after(Log log) returning: log(log) {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; log.message();
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; } &amp;nbsp; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; after() returning: log2() {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&amp;quot;[&amp;quot; + System.currentTimeMillis() + &amp;quot;] [F &amp;quot; 
&lt;br&gt;&amp;gt; + thisJoinPointStaticPart.getSignature().getName() + &amp;quot;]&amp;quot;);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Testcase 1 output: (3 seconds execution time) (JIT on)
&lt;br&gt;&amp;gt; {
&lt;br&gt;&amp;gt; java.runtime.name=Java(TM) SE Runtime Environment,
&lt;br&gt;&amp;gt; java.runtime.version=1.6.0_07-b06,
&lt;br&gt;&amp;gt; java.vm.version=10.0-b23,
&lt;br&gt;&amp;gt; java.vm.vendor=Sun Microsystems Inc.,
&lt;br&gt;&amp;gt; java.vm.name=Java HotSpot(TM) Client VM,
&lt;br&gt;&amp;gt; java.vm.specification.version=1.0,
&lt;br&gt;&amp;gt; java.class.version=50.0,
&lt;br&gt;&amp;gt; java.version=1.6.0_07,
&lt;br&gt;&amp;gt; java.specification.version=1.6,
&lt;br&gt;&amp;gt; sun.arch.data.model=32,
&lt;br&gt;&amp;gt; ... and more ...
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; [1259542706359] [S run]
&lt;br&gt;&amp;gt; [1259542709390] [F run]
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Testcase 2 output: (49 seconds execution time) (JIT on)
&lt;br&gt;&amp;gt; { ... same as above ... }
&lt;br&gt;&amp;gt; [1259542981187] [S run]
&lt;br&gt;&amp;gt; [1259543029781] [F run]
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Testcase without aspects: round about 2 seconds
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; As far as I have noticed the second example is the &amp;quot;right&amp;quot; way to 
&lt;br&gt;&amp;gt; access &amp;nbsp;the information of an annotation, but it is more expensive 
&lt;br&gt;&amp;gt; than the first dynamic access.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I hope that helps somehow and again if this is wrong place or 
&lt;br&gt;&amp;gt; information provided is useless, I am sorry for wasting your time.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Mit freundlichen Grüßen (Sincerely)
&lt;br&gt;&amp;gt; Oliver Hoff
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; aspectj-dev mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26576690&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-dev@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-dev&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Simone Gianni &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CEO Semeru s.r.l. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Apache Committer
&lt;br&gt;&lt;a href=&quot;http://www.simonegianni.it/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.simonegianni.it/&lt;/a&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;aspectj-dev mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26576690&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aspectj-dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://dev.eclipse.org/mailman/listinfo/aspectj-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://dev.eclipse.org/mailman/listinfo/aspectj-dev&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AspectJ---dev-f2218.html&quot; embed=&quot;fixTarget[2218]&quot; target=&quot;_top&quot; &gt;AspectJ - dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Performance-Issues-when-exposing-context-from-Annotations-tp26568331p26576690.html" />
</entry>

</feed>
