Skip to main content
aboutsummaryrefslogtreecommitdiffstats

Back to the top

07954b971db6c11400d694f64'>org.aspectj.ajde/doc/adk15notebook/ataspectj-aspects.html8
-rwxr-xr-xorg.aspectj.ajde/doc/adk15notebook/ataspectj-declare.html5
-rwxr-xr-xorg.aspectj.ajde/doc/adk15notebook/ataspectj-itds.html3
-rwxr-xr-xorg.aspectj.ajde/doc/adk15notebook/ataspectj-pcadvice.html148
-rwxr-xr-xorg.aspectj.ajde/doc/adk15notebook/ataspectj.html2
-rwxr-xr-xorg.aspectj.ajde/doc/adk15notebook/autoboxing-and-method-dispatch.html6
-rwxr-xr-xorg.aspectj.ajde/doc/adk15notebook/autoboxing-in-aspectj5.html2
-rwxr-xr-xorg.aspectj.ajde/doc/adk15notebook/ch11s03.html2
-rwxr-xr-xorg.aspectj.ajde/doc/adk15notebook/covariance-and-join-point-matching.html16
-rwxr-xr-xorg.aspectj.ajde/doc/adk15notebook/declare-soft.html4
-rwxr-xr-xorg.aspectj.ajde/doc/adk15notebook/enums-in-aspectj5.html12
-rwxr-xr-xorg.aspectj.ajde/doc/adk15notebook/generics-inAspectJ5.html1100
-rwxr-xr-xorg.aspectj.ajde/doc/adk15notebook/generics.html38
-rwxr-xr-xorg.aspectj.ajde/doc/adk15notebook/index.html4
-rwxr-xr-xorg.aspectj.ajde/doc/adk15notebook/ltw-agents.html8
-rwxr-xr-xorg.aspectj.ajde/doc/adk15notebook/ltw-configuration.html88
-rwxr-xr-xorg.aspectj.ajde/doc/adk15notebook/ltw-packaging.html4
-rwxr-xr-xorg.aspectj.ajde/doc/adk15notebook/ltw-rules.html6
-rw-r--r--org.aspectj.ajde/doc/adk15notebook/ltw-specialcases.html13
-rwxr-xr-xorg.aspectj.ajde/doc/adk15notebook/ltw.html10
-rwxr-xr-xorg.aspectj.ajde/doc/adk15notebook/miscellaneous.html4
-rwxr-xr-xorg.aspectj.ajde/doc/adk15notebook/pertypewithin.html23
-rwxr-xr-xorg.aspectj.ajde/doc/adk15notebook/printable.html1555
-rwxr-xr-xorg.aspectj.ajde/doc/adk15notebook/varargs-in-pcds.html10
-rwxr-xr-xorg.aspectj.ajde/doc/adk15notebook/varargs.html4
-rw-r--r--org.aspectj.ajde/doc/aspectj-faq.css88
-rwxr-xr-xorg.aspectj.ajde/doc/devguide/ajbrowser-problems.html2
-rwxr-xr-xorg.aspectj.ajde/doc/devguide/ajbrowser.html4
-rwxr-xr-xorg.aspectj.ajde/doc/devguide/ajc-ref.html4
-rw-r--r--org.aspectj.ajde/doc/devguide/ajdoc-ref.html82
-rwxr-xr-xorg.aspectj.ajde/doc/devguide/antTasks-adapter.html32
-rwxr-xr-xorg.aspectj.ajde/doc/devguide/antTasks-ajc.html10
-rwxr-xr-xorg.aspectj.ajde/doc/devguide/antTasks-iajc.html26
-rwxr-xr-xorg.aspectj.ajde/doc/devguide/antTasks-install.html27
-rwxr-xr-xorg.aspectj.ajde/doc/devguide/antTasks-problems.html8
-rwxr-xr-xorg.aspectj.ajde/doc/devguide/antTasks.html2
-rw-r--r--org.aspectj.ajde/doc/devguide/aspectj-docs.css89
-rwxr-xr-xorg.aspectj.ajde/doc/devguide/ch01s02.html2
-rwxr-xr-xorg.aspectj.ajde/doc/devguide/ch01s03.html2
-rwxr-xr-xorg.aspectj.ajde/doc/devguide/ch01s04.html2
-rw-r--r--org.aspectj.ajde/doc/devguide/dd_arrow.gifbin0 -> 851 bytes-rwxr-xr-xorg.aspectj.ajde/doc/devguide/index.html6
-rwxr-xr-xorg.aspectj.ajde/doc/devguide/printable.html103
-rwxr-xr-xorg.aspectj.ajde/doc/devguide/rn01.html2
-rwxr-xr-xorg.aspectj.ajde/doc/faq.html236
-rwxr-xr-xorg.aspectj.ajde/doc/index.html6
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/apcs02.html10
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/apcs03.html12
-rw-r--r--org.aspectj.ajde/doc/progguide/aspectj-docs.css89
-rw-r--r--org.aspectj.ajde/doc/progguide/dd_arrow.gifbin0 -> 851 bytes-rwxr-xr-xorg.aspectj.ajde/doc/progguide/examples-basic.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/examples-development.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/examples-howto.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/examples-production.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/examples-reusable.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/examples.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/idioms.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/implementation.html11
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/index.html4
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/language-advice.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/language-anatomy.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/language-interType.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/language-joinPoints.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/language-thisJoinPoint.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/language.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/pitfalls-infiniteLoops.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/pitfalls.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/preface.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/printable.html287
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/quick-advice.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/quick-aspectAssociations.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/quick-interType.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/quick-other.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/quick-typePatterns.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/quick.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/semantics-advice.html44
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/semantics-aspects.html30
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/semantics-declare.html48
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/semantics-joinPoints.html4
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/semantics-pointcuts.html132
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/semantics.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/starting-aspectj.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/starting-conclusion.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/starting-development.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/starting-production.html2
-rwxr-xr-xorg.aspectj.ajde/doc/progguide/starting.html2
-rw-r--r--org.aspectj.ajde/doc/runtime-api/allclasses-frame.html66
-rw-r--r--org.aspectj.ajde/doc/runtime-api/allclasses-noframe.html66
-rw-r--r--org.aspectj.ajde/doc/runtime-api/constant-values.html228
-rw-r--r--org.aspectj.ajde/doc/runtime-api/deprecated-list.html156
-rw-r--r--org.aspectj.ajde/doc/runtime-api/help-doc.html213
-rw-r--r--org.aspectj.ajde/doc/runtime-api/index-all.html509
-rw-r--r--org.aspectj.ajde/doc/runtime-api/index.html37
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/lang/Aspects.html398
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/lang/JoinPoint.EnclosingStaticPart.html188
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/lang/JoinPoint.StaticPart.html346
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/lang/JoinPoint.html681
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/lang/NoAspectBoundException.html288
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/lang/ProceedingJoinPoint.html331
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/lang/Signature.html386
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/lang/SoftException.html363
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/lang/package-frame.html64
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/lang/package-summary.html228
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/lang/package-tree.html163
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/lang/reflect/AdviceSignature.html247
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/lang/reflect/CatchClauseSignature.html238
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/lang/reflect/CodeSignature.html263
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/lang/reflect/ConstructorSignature.html225
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/lang/reflect/FieldSignature.html241
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/lang/reflect/InitializerSignature.html225
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/lang/reflect/MemberSignature.html191
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/lang/reflect/MethodSignature.html247
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/lang/reflect/SourceLocation.html266
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/lang/reflect/package-frame.html48
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/lang/reflect/package-summary.html213
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/lang/reflect/package-tree.html151
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/runtime/reflect/Factory.html784
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/runtime/reflect/FieldSignatureImpl.html488
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/runtime/reflect/package-frame.html34
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/runtime/reflect/package-summary.html156
-rw-r--r--org.aspectj.ajde/doc/runtime-api/org/aspectj/runtime/reflect/package-tree.html148
-rw-r--r--org.aspectj.ajde/doc/runtime-api/overview-frame.html46
-rw-r--r--org.aspectj.ajde/doc/runtime-api/overview-summary.html157
-rw-r--r--org.aspectj.ajde/doc/runtime-api/overview-tree.html171
-rw-r--r--org.aspectj.ajde/doc/runtime-api/package-list3
-rw-r--r--org.aspectj.ajde/doc/runtime-api/resources/inherit.gifbin0 -> 57 bytes-rw-r--r--org.aspectj.ajde/doc/runtime-api/serialized-form.html268
-rw-r--r--org.aspectj.ajde/doc/runtime-api/stylesheet.css29
-rw-r--r--org.aspectj.ajde/doc/weaver-api/allclasses-frame.html66
-rw-r--r--org.aspectj.ajde/doc/weaver-api/allclasses-noframe.html66
-rw-r--r--org.aspectj.ajde/doc/weaver-api/constant-values.html174
-rw-r--r--org.aspectj.ajde/doc/weaver-api/deprecated-list.html140
-rw-r--r--org.aspectj.ajde/doc/weaver-api/help-doc.html213
-rw-r--r--org.aspectj.ajde/doc/weaver-api/index-all.html569
-rw-r--r--org.aspectj.ajde/doc/weaver-api/index.html37
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/loadtime/Aj.html293
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.html323
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/loadtime/ClassPreProcessor.html241
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/loadtime/DefaultMessageHandler.html322
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/loadtime/JRockitAgent.html274
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/loadtime/Options.WeaverOption.html222
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/loadtime/Options.html276
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/loadtime/definition/Definition.ConcreteAspect.html224
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/loadtime/definition/Definition.Pointcut.html224
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/loadtime/definition/Definition.html413
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/loadtime/definition/DocumentParser.html400
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/loadtime/definition/package-frame.html38
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/loadtime/definition/package-summary.html164
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/loadtime/definition/package-tree.html150
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/loadtime/package-frame.html53
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/loadtime/package-summary.html189
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/loadtime/package-tree.html156
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/tools/FuzzyBoolean.html312
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/tools/GeneratedClassHandler.html214
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/tools/PointcutExpression.html595
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/tools/PointcutParser.html329
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/tools/PointcutPrimitive.html543
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/tools/UnsupportedPointcutPrimitiveException.html288
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/tools/WeavingAdaptor.WeavingAdaptorMessageHandler.html368
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/tools/WeavingAdaptor.html565
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/tools/WeavingClassLoader.html226
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/tools/package-frame.html64
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/tools/package-summary.html224
-rw-r--r--org.aspectj.ajde/doc/weaver-api/org/aspectj/weaver/tools/package-tree.html166
-rw-r--r--org.aspectj.ajde/doc/weaver-api/overview-frame.html46
-rw-r--r--org.aspectj.ajde/doc/weaver-api/overview-summary.html155
-rw-r--r--org.aspectj.ajde/doc/weaver-api/overview-tree.html172
-rw-r--r--org.aspectj.ajde/doc/weaver-api/package-list3
-rw-r--r--org.aspectj.ajde/doc/weaver-api/resources/inherit.gifbin0 -> 57 bytes-rw-r--r--org.aspectj.ajde/doc/weaver-api/serialized-form.html185
-rw-r--r--org.aspectj.ajde/doc/weaver-api/stylesheet.css29
-rw-r--r--org.aspectj.ajde/fixes.txt39
-rwxr-xr-xorg.aspectj.runtime/aspectjrt.jarbin101953 -> 101953 bytes
180 files changed, 21657 insertions, 2225 deletions
diff --git a/org.aspectj.ajde/ajde-src.zip b/org.aspectj.ajde/ajde-src.zip
index 18bcf9139..e393e7acd 100755
--- a/org.aspectj.ajde/ajde-src.zip
+++ b/org.aspectj.ajde/ajde-src.zip
Binary files differ
diff --git a/org.aspectj.ajde/ajde.jar b/org.aspectj.ajde/ajde.jar
index 0d4f7c5dc..1c5109e54 100755
--- a/org.aspectj.ajde/ajde.jar
+++ b/org.aspectj.ajde/ajde.jar
Binary files differ
diff --git a/org.aspectj.ajde/doc/adk15notebook/annotations-declare.html b/org.aspectj.ajde/doc/adk15notebook/annotations-declare.html
index ecce5e70f..67904b374 100755
--- a/org.aspectj.ajde/doc/adk15notebook/annotations-declare.html
+++ b/org.aspectj.ajde/doc/adk15notebook/annotations-declare.html
@@ -14,16 +14,16 @@
MethodPattern |
ConstructorPattern |
FieldPattern
- </pre><p>The following examples illustrate the use of <tt>declare annotation</tt>.</p><div class="variablelist"><dl><dt><a name="d0e1611"></a><span class="term">declare @type : org.xyz.model..* : @BusinessDomain ;</span></dt><dd><p><a name="d0e1614"></a>
+ </pre><p>The following examples illustrate the use of <tt>declare annotation</tt>.</p><div class="variablelist"><dl><dt><a name="d0e1620"></a><span class="term">declare @type : org.xyz.model..* : @BusinessDomain ;</span></dt><dd><p><a name="d0e1623"></a>
All types defined in a package with the prefix <tt>org.xyz.model</tt>
have the <tt>@BusinessDomain</tt> annotation.
- </p></dd><dt><a name="d0e1623"></a><span class="term">declare @method : public * BankAccount+.*(..) : @Secured(role="supervisor")</span></dt><dd><p><a name="d0e1626"></a>
+ </p></dd><dt><a name="d0e1632"></a><span class="term">declare @method : public * BankAccount+.*(..) : @Secured(role="supervisor")</span></dt><dd><p><a name="d0e1635"></a>
All public methods in <tt>BankAccount</tt> and its subtypes have the
annotation <tt>@Secured(role="supervisor")</tt>.
- </p></dd><dt><a name="d0e1635"></a><span class="term">declare @constructor : BankAccount+.new(..) : @Secured(role="supervisor")</span></dt><dd><p><a name="d0e1638"></a>
+ </p></dd><dt><a name="d0e1644"></a><span class="term">declare @constructor : BankAccount+.new(..) : @Secured(role="supervisor")</span></dt><dd><p><a name="d0e1647"></a>
All constructors in <tt>BankAccount</tt> and its subtypes have the
annotation <tt>@Secured(role="supervisor")</tt>.
- </p></dd><dt><a name="d0e1647"></a><span class="term">declare @field : * DAO+.* : @Persisted;</span></dt><dd><p><a name="d0e1650"></a>
+ </p></dd><dt><a name="d0e1656"></a><span class="term">declare @field : * DAO+.* : @Persisted;</span></dt><dd><p><a name="d0e1659"></a>
All fields defined in <tt>DAO</tt> or its subtypes have the
<tt>@Persisted</tt> annotation.
</p></dd></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="annotations-decp.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="annotations-itds.html">Next</a></td></tr><tr><td width="40%" align="left">Using Annotations with declare statements&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="annotations.html">Up</a></td><td width="40%" align="right">&nbsp;Inter-type Declarations</td></tr></table></div></body></html> \ No newline at end of file
diff --git a/org.aspectj.ajde/doc/adk15notebook/annotations-decp.html b/org.aspectj.ajde/doc/adk15notebook/annotations-decp.html
index 8fcd19d67..3ee92632d 100755
--- a/org.aspectj.ajde/doc/adk15notebook/annotations-decp.html
+++ b/org.aspectj.ajde/doc/adk15notebook/annotations-decp.html
@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Using Annotations with declare statements</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="annotations.html" title="Chapter 2. Annotations"><link rel="previous" href="annotations-pointcuts-and-advice.html" title="Join Point Matching based on Annotations"><link rel="next" href="annotations-declare.html" title="Declare Annotation"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Using Annotations with declare statements</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="annotations-pointcuts-and-advice.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 2. Annotations</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="annotations-declare.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="annotations-decp"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="annotations-decp"></a>Using Annotations with declare statements</h2></div></div><div class="sect2"><a name="d0e1478"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1478"></a>Declare error and declare warning</h3></div></div><p>
+ <title>Using Annotations with declare statements</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="annotations.html" title="Chapter 2. Annotations"><link rel="previous" href="annotations-pointcuts-and-advice.html" title="Join Point Matching based on Annotations"><link rel="next" href="annotations-declare.html" title="Declare Annotation"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Using Annotations with declare statements</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="annotations-pointcuts-and-advice.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 2. Annotations</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="annotations-declare.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="annotations-decp"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="annotations-decp"></a>Using Annotations with declare statements</h2></div></div><div class="sect2"><a name="d0e1487"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1487"></a>Declare error and declare warning</h3></div></div><p>
Since pointcut expressions in AspectJ 5 support join point matching based
on annotations, this facility can be exploited when writing
<tt>declare warning</tt> and <tt>declare error</tt>
@@ -13,7 +13,7 @@
declare error : call(* org.xyz.model.*.*(..)) &amp;&amp;
!@within(Trusted)
: "Untrusted code should not call the model classes directly";
- </pre></div><div class="sect2"><a name="d0e1493"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1493"></a>declare parents</h3></div></div><p>
+ </pre></div><div class="sect2"><a name="d0e1502"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1502"></a>declare parents</h3></div></div><p>
The general form of a <tt>declare parents</tt> statement is:
</p><pre class="programlisting">
declare parents : TypePattern extends Type;
@@ -23,10 +23,10 @@
specification, it is now possible to match types based on the presence
of annotations <span class="emphasis"><i>with either class-file or runtime retention</i></span>.
For example:
- </p><div class="variablelist"><dl><dt><a name="d0e1509"></a><span class="term">declare parents : (@Secured *) implements SecuredObject;</span></dt><dd><p><a name="d0e1512"></a>
+ </p><div class="variablelist"><dl><dt><a name="d0e1518"></a><span class="term">declare parents : (@Secured *) implements SecuredObject;</span></dt><dd><p><a name="d0e1521"></a>
All types with the <tt>@Secured</tt> annotation
implement the <tt>SecuredObject</tt> inteface.
- </p></dd><dt><a name="d0e1521"></a><span class="term">declare parents : (@Secured BankAccount+) implements SecuredObject;</span></dt><dd><p><a name="d0e1524"></a>
+ </p></dd><dt><a name="d0e1530"></a><span class="term">declare parents : (@Secured BankAccount+) implements SecuredObject;</span></dt><dd><p><a name="d0e1533"></a>
The subset of types drawn from the <tt>BankAccount</tt> type and any subtype of
<tt>BankAccount</tt>, where the
<tt>@Secured</tt> annotation is present, implement the
@@ -35,14 +35,14 @@
statement. If an annotation type is named explicitly as the target of a
declare parents statement, a compilation error will result. If an annotation
type is matched by a non-explicit type pattern used in a declare parents
- statement it will be ignored (and an XLint warning issued).</p></div><div class="sect2"><a name="d0e1541"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1541"></a>declare precedence</h3></div></div><p>
+ statement it will be ignored (and an XLint warning issued).</p></div><div class="sect2"><a name="d0e1550"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1550"></a>declare precedence</h3></div></div><p>
The general form of a declare precedence statement is:
</p><pre class="programlisting">
declare precedence : TypePatList;
</pre><p>
AspectJ 5 allows the type patterns in the list to include annotation information
as part of the pattern specification. For example:
- </p><div class="variablelist"><dl><dt><a name="d0e1551"></a><span class="term">declare precedence : (@Security *),*;</span></dt><dd><p><a name="d0e1554"></a>
+ </p><div class="variablelist"><dl><dt><a name="d0e1560"></a><span class="term">declare precedence : (@Security *),*;</span></dt><dd><p><a name="d0e1563"></a>
All aspects with the <tt>@Security</tt> annotation
take precedence over any other aspects in the system. (Or, more
informally, all security-related aspects take precedence).
diff --git a/org.aspectj.ajde/doc/adk15notebook/annotations-pointcuts-and-advice.html b/org.aspectj.ajde/doc/adk15notebook/annotations-pointcuts-and-advice.html
index c90c877b3..42e00abbd 100755
--- a/org.aspectj.ajde/doc/adk15notebook/annotations-pointcuts-and-advice.html
+++ b/org.aspectj.ajde/doc/adk15notebook/annotations-pointcuts-and-advice.html
@@ -389,20 +389,24 @@
aspect X {
- pointcut annotatedMethodCall() :
- call(@SomeAnnotation * C1.aMethod());
+ pointcut annotatedC2MethodCall() :
+ call(@SomeAnnotation * C2.aMethod());
- pointcut c1MethodCall() :
- call(* C1.aMethod());
+ pointcut annotatedMethodCall() :
+ call(@SomeAnnotation * aMethod());
}
</pre><p>
- The pointcut <tt>annotatedMethodCall</tt> will match the call
- to <tt>c1.aMethod()</tt>, but not the call to
- <tt>c2.aMethod()</tt>.
+ The pointcut <tt>annotatedC2MethodCall</tt> will not match anything
+ since the definition of <tt>aMethod</tt> in <tt>C2</tt>
+ does not have the annotation.
</p><p>
The pointcut <tt>c1MethodCall</tt> matches both
- <tt>c1.aMethod()</tt> and <tt>c2.aMethod()</tt>.
- </p></div><div class="sect2"><a name="d0e1463"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1463"></a>Limitations</h3></div></div><p>
+ <tt>c1.aMethod()</tt> and <tt>c2.aMethod()</tt>. The call
+ to <tt>c2.aMethod</tt> is matched because the call join point has
+ multiple signatures (<tt>@SomeAnnotation C1.aMethod()</tt> and
+ <tt>C2.aMethod()</tt>), and the former of those signatures is
+ exactly matched by the pattern.
+ </p></div><div class="sect2"><a name="d0e1472"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1472"></a>Limitations</h3></div></div><p>
It would be useful to be able to match join points based on
annotation values, rather than merely the presence of a
class-file retention annotation of a given type. This facility may be supported in a future version of AspectJ, by expanding the
diff --git a/org.aspectj.ajde/doc/adk15notebook/annotations.html b/org.aspectj.ajde/doc/adk15notebook/annotations.html
index d776d0b4f..c86003998 100755
--- a/org.aspectj.ajde/doc/adk15notebook/annotations.html
+++ b/org.aspectj.ajde/doc/adk15notebook/annotations.html
@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Chapter 2. Annotations</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="previous" href="join-point-matching-summary.html" title="Summary of Join Point Matching"><link rel="next" href="annotations-aspectmembers.html" title="Annotating Aspects"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 2. Annotations</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="join-point-matching-summary.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="annotations-aspectmembers.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="annotations"></a>Chapter 2. Annotations</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="annotations.html#annotations-inJava5">Annotations in Java 5</a></dt><dd><dl><dt><a href="annotations.html#d0e578">Using Annotations</a></dt><dt><a href="annotations.html#d0e624">Retention Policies</a></dt><dt><a href="annotations.html#d0e659">Accessing Annotations at Runtime</a></dt><dt><a href="annotations.html#d0e694">Annotation Inheritance</a></dt></dl></dd><dt><a href="annotations-aspectmembers.html">Annotating Aspects</a></dt><dt><a href="annotations-pointcuts-and-advice.html">Join Point Matching based on Annotations</a></dt><dd><dl><dt><a href="annotations-pointcuts-and-advice.html#d0e782">Annotation Patterns</a></dt><dt><a href="annotations-pointcuts-and-advice.html#d0e867">Type Patterns</a></dt><dt><a href="annotations-pointcuts-and-advice.html#signaturePatterns">Signature Patterns</a></dt><dt><a href="annotations-pointcuts-and-advice.html#d0e1121">Example Pointcuts</a></dt><dt><a href="annotations-pointcuts-and-advice.html#d0e1194">Runtime type matching and context exposure</a></dt><dt><a href="annotations-pointcuts-and-advice.html#d0e1421">Package and Parameter Annotations</a></dt><dt><a href="annotations-pointcuts-and-advice.html#d0e1431">Annotation Inheritance and pointcut matching</a></dt><dt><a href="annotations-pointcuts-and-advice.html#d0e1463">Limitations</a></dt></dl></dd><dt><a href="annotations-decp.html">Using Annotations with declare statements</a></dt><dd><dl><dt><a href="annotations-decp.html#d0e1478">Declare error and declare warning</a></dt><dt><a href="annotations-decp.html#d0e1493">declare parents</a></dt><dt><a href="annotations-decp.html#d0e1541">declare precedence</a></dt></dl></dd><dt><a href="annotations-declare.html">Declare Annotation</a></dt><dt><a href="annotations-itds.html">Inter-type Declarations</a></dt></dl></div><div class="sect1"><a name="annotations-inJava5"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="annotations-inJava5"></a>Annotations in Java 5</h2></div></div><p>
+ <title>Chapter 2. Annotations</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="previous" href="join-point-matching-summary.html" title="Summary of Join Point Matching"><link rel="next" href="annotations-aspectmembers.html" title="Annotating Aspects"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 2. Annotations</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="join-point-matching-summary.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="annotations-aspectmembers.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="annotations"></a>Chapter 2. Annotations</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="annotations.html#annotations-inJava5">Annotations in Java 5</a></dt><dd><dl><dt><a href="annotations.html#d0e578">Using Annotations</a></dt><dt><a href="annotations.html#d0e624">Retention Policies</a></dt><dt><a href="annotations.html#d0e659">Accessing Annotations at Runtime</a></dt><dt><a href="annotations.html#d0e694">Annotation Inheritance</a></dt></dl></dd><dt><a href="annotations-aspectmembers.html">Annotating Aspects</a></dt><dt><a href="annotations-pointcuts-and-advice.html">Join Point Matching based on Annotations</a></dt><dd><dl><dt><a href="annotations-pointcuts-and-advice.html#d0e782">Annotation Patterns</a></dt><dt><a href="annotations-pointcuts-and-advice.html#d0e867">Type Patterns</a></dt><dt><a href="annotations-pointcuts-and-advice.html#signaturePatterns">Signature Patterns</a></dt><dt><a href="annotations-pointcuts-and-advice.html#d0e1121">Example Pointcuts</a></dt><dt><a href="annotations-pointcuts-and-advice.html#d0e1194">Runtime type matching and context exposure</a></dt><dt><a href="annotations-pointcuts-and-advice.html#d0e1421">Package and Parameter Annotations</a></dt><dt><a href="annotations-pointcuts-and-advice.html#d0e1431">Annotation Inheritance and pointcut matching</a></dt><dt><a href="annotations-pointcuts-and-advice.html#d0e1472">Limitations</a></dt></dl></dd><dt><a href="annotations-decp.html">Using Annotations with declare statements</a></dt><dd><dl><dt><a href="annotations-decp.html#d0e1487">Declare error and declare warning</a></dt><dt><a href="annotations-decp.html#d0e1502">declare parents</a></dt><dt><a href="annotations-decp.html#d0e1550">declare precedence</a></dt></dl></dd><dt><a href="annotations-declare.html">Declare Annotation</a></dt><dt><a href="annotations-itds.html">Inter-type Declarations</a></dt></dl></div><div class="sect1"><a name="annotations-inJava5"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="annotations-inJava5"></a>Annotations in Java 5</h2></div></div><p>
This section provides the essential information about annotations in
Java 5 needed to understand how annotations are treated in AspectJ 5.
For a full introduction to annotations in Java, please see the
diff --git a/org.aspectj.ajde/doc/adk15notebook/aspectj-docs.css b/org.aspectj.ajde/doc/adk15notebook/aspectj-docs.css
index 884dfd758..9be5a3954 100644
--- a/org.aspectj.ajde/doc/adk15notebook/aspectj-docs.css
+++ b/org.aspectj.ajde/doc/adk15notebook/aspectj-docs.css
@@ -5,7 +5,8 @@ body {
h1 {
margin-bottom: 3px;
- padding-bottom: 5px;
+ padding-bottom: 0px;
+ line-height: 1.1em;
}
h2 {
diff --git a/org.aspectj.ajde/doc/adk15notebook/ataspectj-aspects.html b/org.aspectj.ajde/doc/adk15notebook/ataspectj-aspects.html
index 362cc2ef5..7b75f42a0 100755
--- a/org.aspectj.ajde/doc/adk15notebook/ataspectj-aspects.html
+++ b/org.aspectj.ajde/doc/adk15notebook/ataspectj-aspects.html
@@ -12,15 +12,13 @@
</pre><p>And since issingleton() is the default aspect instantiation model it is equivalent to:</p><pre class="programlisting">
@Aspect("issingleton()")
public class Foo {}
- </pre><p>Privileged aspects are not supported by the annotation style</p><p>To specify an aspect an aspect instantiation model (the default is
+ </pre><p>To specify an aspect an aspect instantiation model (the default is
singleton), provide the perclause as the
<tt>@Aspect</tt> value.
For example:
</p><pre class="programlisting">
@Aspect("perthis(execution(* abc..*(..)))")
public class Foo {}
-
- is equivalent to...
-
+ </pre><p>is equivalent to...</p><pre class="programlisting">
public aspect Foo perthis(execution(* abc..*(..))) {}
- </pre></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ataspectj.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ataspectj-pcadvice.html">Next</a></td></tr><tr><td width="40%" align="left">Chapter 9. An Annotation Based Development Style&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="ataspectj.html">Up</a></td><td width="40%" align="right">&nbsp;Pointcuts and Advice</td></tr></table></div></body></html> \ No newline at end of file
+ </pre><div class="sect2"><a name="d0e3640"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3640"></a>Limitations</h3></div></div><p>Privileged aspects are not supported by the annotation style.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ataspectj.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ataspectj-pcadvice.html">Next</a></td></tr><tr><td width="40%" align="left">Chapter 9. An Annotation Based Development Style&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="ataspectj.html">Up</a></td><td width="40%" align="right">&nbsp;Pointcuts and Advice</td></tr></table></div></body></html> \ No newline at end of file
diff --git a/org.aspectj.ajde/doc/adk15notebook/ataspectj-declare.html b/org.aspectj.ajde/doc/adk15notebook/ataspectj-declare.html
index 3f031ee7b..9af130a60 100755
--- a/org.aspectj.ajde/doc/adk15notebook/ataspectj-declare.html
+++ b/org.aspectj.ajde/doc/adk15notebook/ataspectj-declare.html
@@ -57,7 +57,10 @@
@DeclareAnnotation("* DAO+.*")
@Persisted Object daoFields;
}
- </pre><p>We also support annotation style declarations for declare warning and
+ </pre><p>
+ <span class="emphasis"><i>Note: Declare annotation is not available in AspectJ 1.5 M3 and syntax may change
+ when the design and implementation is complete.</i></span>
+ </p><p>We also support annotation style declarations for declare warning and
declare error - any corresponding warnings and errors will be emitted at
weave time, not when the aspects containing the declarations are compiled.
(This is the same behaviour as when using declare warning or error with the
diff --git a/org.aspectj.ajde/doc/adk15notebook/ataspectj-itds.html b/org.aspectj.ajde/doc/adk15notebook/ataspectj-itds.html
index a78a3a818..bd494b5a0 100755
--- a/org.aspectj.ajde/doc/adk15notebook/ataspectj-itds.html
+++ b/org.aspectj.ajde/doc/adk15notebook/ataspectj-itds.html
@@ -1,6 +1,7 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Inter-type Declarations</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="ataspectj.html" title="Chapter 9. An Annotation Based Development Style"><link rel="previous" href="ataspectj-pcadvice.html" title="Pointcuts and Advice"><link rel="next" href="ataspectj-declare.html" title="Declare statements"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Inter-type Declarations</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ataspectj-pcadvice.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 9. An Annotation Based Development Style</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ataspectj-declare.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="ataspectj-itds"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ataspectj-itds"></a>Inter-type Declarations</h2></div></div><p>
+ <title>Inter-type Declarations</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="ataspectj.html" title="Chapter 9. An Annotation Based Development Style"><link rel="previous" href="ataspectj-pcadvice.html" title="Pointcuts and Advice"><link rel="next" href="ataspectj-declare.html" title="Declare statements"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Inter-type Declarations</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ataspectj-pcadvice.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 9. An Annotation Based Development Style</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ataspectj-declare.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="ataspectj-itds"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ataspectj-itds"></a>Inter-type Declarations</h2></div></div><p><span class="emphasis"><i>The features described in this section will not be supported until the
+ AspectJ 5 M4 milestone build.</i></span></p><p>
Inter-type declarations are challenging to support using an annotation style.
It's very important to preserve the exact same semantics between the code style
and the annotation style. We also want to support compilation of a large set
diff --git a/org.aspectj.ajde/doc/adk15notebook/ataspectj-pcadvice.html b/org.aspectj.ajde/doc/adk15notebook/ataspectj-pcadvice.html
index f48862818..a85d38686 100755
--- a/org.aspectj.ajde/doc/adk15notebook/ataspectj-pcadvice.html
+++ b/org.aspectj.ajde/doc/adk15notebook/ataspectj-pcadvice.html
@@ -5,7 +5,7 @@
<tt>Pointcut, Before, After, AfterReturning, AfterThrowing,</tt>
and
<tt>Around</tt> annotations.
- </p><div class="sect2"><a name="d0e3980"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3980"></a>Pointcuts</h3></div></div><p>
+ </p><div class="sect2"><a name="d0e3657"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3657"></a>Pointcuts</h3></div></div><p>
Pointcuts are specified using the
<tt>org.aspectj.lang.annotation.Pointcut</tt> annotation
on a method declaration. The method should have a
@@ -21,31 +21,23 @@
<tt>args(), target(), this(), @args(), @target(), @this(), @annotation())</tt> in the
pointcut, then they must appear in the method signature.
</p><p>
- There is one special case to the general rule for when you use
- <tt>if()</tt> pointcut
- as detailled in the next section.
- </p><p>A simple example:</p><pre class="programlisting">
+ The <tt>if()</tt> pointcut is treated specially and is discussed in a later section.
+ </p><p>Here is a simple example of a pointcut declaration in both code and @AspectJ styles:</p><pre class="programlisting">
@Pointcut("call(* *.*(..))")
void anyCall() {}
-
- is equivalent to...
-
+ </pre><p>is equivalent to...</p><pre class="programlisting">
pointcut anyCall() : call(* *.*(..));
- </pre><p>An example with formal bindings:</p><pre class="programlisting">
+ </pre><p>When binding arguments, simply declare the arguments as normal in the annotated method:</p><pre class="programlisting">
@Pointcut("call(* *.*(int)) &amp;&amp; args(i) &amp;&amp; target(callee)")
void someCall(int i, Foo callee) {}
-
- is equivalent to...
-
+ </pre><p>is equivalent to...</p><pre class="programlisting">
pointcut anyCall(int i, Foo callee) : call(* *.*(int)) &amp;&amp; args(i) &amp;&amp; target(callee);
</pre><p>An example with modifiers (it is also good to remember that Java 5 annotations are not inherited):</p><pre class="programlisting">
@Pointcut("")
protected abstract void anyCall();
-
- is equivalent to...
-
+ </pre><p>is equivalent to...</p><pre class="programlisting">
protected abstract pointcut anyCall();
- </pre><p>
+ </pre><div class="sect3"><a name="d0e3708"></a><div class="titlepage"><div><h4 class="title"><a name="d0e3708"></a>Type references inside @AspectJ annotations</h4></div></div><p>
Using the code style, types referenced in pointcut expressions are
resolved with respect to the imported types in the compilation unit.
When using the annotation style, types referenced in pointcut
@@ -53,7 +45,7 @@
to be fully qualified if they are not by default visible to the
declaring type (outside of the declaring package and
<tt>java.lang</tt>). This
- to not apply to type patterns with wildcards, which are always resolved
+ does not apply to type patterns with wildcards, which are always resolved
in a global scope.
</p><p>
Consider the following compilation unit:
@@ -86,41 +78,40 @@
void anyUtilityCall() {}
}
- </pre><p>The
- <tt>value</tt> attribute of the
- <tt>Pointcut</tt> declaration may contain any valid
- AspectJ pointcut declaration - though <tt>if()</tt> pointcut is a special case explained below.
- </p><p>The special case for the <tt>if()</tt> pointcut.</p><p>In code style, it is possible to use the <tt>if(...)</tt> poincut to implement
- conditional pointcut whose residual if form will be evaluated at runtime. The <tt>if(...)</tt>
+ </pre></div><div class="sect3"><a name="d0e3724"></a><div class="titlepage"><div><h4 class="title"><a name="d0e3724"></a>if() pointcut expressions</h4></div></div><p>In code style, it is possible to use the <tt>if(...)</tt> poincut to define
+ a conditional pointcut expression which will be evaluated at runtime for each candidate join point.
+ The <tt>if(...)</tt>
body can be any valid Java boolean expression, and can use any exposed formal, as well as the join point forms
<tt>thisJoinPoint, thisJoinPointStaticPart and thisJoinPointEnclosingStaticPart</tt>.
</p><p>
When using the annotation style, it would be really a pain to write a valid Java expression within
the annotation value so the syntax differs sligthly, whilst providing the very same
- semantics and runtime behaviour. Take the following examples:
+ semantics and runtime behaviour. An <tt>if()</tt> pointcut expression can be
+ declared in an <tt>@Pointcut</tt>, but must either an empty body, or be one
+ of the expression <tt>if(true)</tt> or <tt>if(false)</tt>. The annotated
+ method must be public, static, and return a boolean. The body of the method contains the
+ condition to be evaluated. For example:
</p><pre class="programlisting">
@Pointcut("call(* *.*(int)) &amp;&amp; args(i) &amp;&amp; if()")
public static boolean someCallWithIfTest(int i) {
return i &gt; 0;
}
-
- is equivalent to...
-
+ </pre><p>is equivalent to...</p><pre class="programlisting">
pointcut someCallWithIfTest(int i) : call(* *.*(int)) &amp;&amp; args(i) &amp;&amp; if(i &gt; 0);
</pre><p> and the following is also a valid form:</p><pre class="programlisting">
static int COUNT = 0;
@Pointcut("call(* *.*(int)) &amp;&amp; args(i) &amp;&amp; if()")
public static boolean someCallWithIfTest(int i, JoinPoint jp, JoinPoint.EnclosingStaticPart esjp) {
- // can call any kind of method (though this method is a static one)
+ // any legal Java expression...
return i &gt; 0
&amp;&amp; jp.getSignature().getName.startsWith("doo")
&amp;&amp; esjp.getSignature().getName().startsWith("test")
&amp;&amp; COUNT++ &lt; 10;
}
- @Before("someCallWithIfTest(arg0, jp, enc)") // see how the pointcut is referenced: we obey its exact signature
- public void beforeAdviceWithRuntimeTest(int arg0, JoinPoint jp, JoinPoint.EnclosingStaticPart enc) {
+ @Before("someCallWithIfTest(anInt, jp, enc)")
+ public void beforeAdviceWithRuntimeTest(int anInt, JoinPoint jp, JoinPoint.EnclosingStaticPart enc) {
//...
}
@@ -134,15 +125,15 @@
</pre><p>
It is thus possible with the annotation style to use the <tt>if()</tt> pointcut
only within an <tt>@Pointcut</tt> expression. The <tt>if()</tt> must not contain any
- body. The so annotated <tt>@Pointcut</tt> method must then be of the form <tt>public static boolean</tt>
+ body. The annotated <tt>@Pointcut</tt> method must then be of the form <tt>public static boolean</tt>
and can use formal bindings as usual.
- Extra <span class="emphasis"><i>implicit</i></span> (thus unbound) arguments of type JoinPoint, JoinPoint.StaticPart and JoinPoint.EnclosingStaticPart can also be used
- (they can't for regular pointcut without <tt>if()</tt> form).
+ Extra <span class="emphasis"><i>implicit</i></span> arguments of type JoinPoint, JoinPoint.StaticPart and JoinPoint.EnclosingStaticPart can also be used
+ (this is not permitted for regular annotated pointcuts not using the <tt>if()</tt> form).
</p><p>
The special forms <tt>if(true)</tt> and <tt>if(false)</tt> can be used in a more
general way and don't imply that the pointcut method must have a body.
You can thus write <tt>@Before("somePoincut() &amp;&amp; if(false)")</tt>.
- </p></div><div class="sect2"><a name="d0e4101"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4101"></a>Advice</h3></div></div><p>In this section we first discuss the use of annotations for
+ </p></div></div><div class="sect2"><a name="d0e3796"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3796"></a>Advice</h3></div></div><p>In this section we first discuss the use of annotations for
simple advice declarations. Then we show how
<tt>thisJoinPoint</tt>
and its siblings are handled in the body of advice and discuss the
@@ -158,50 +149,24 @@
</p><p>A method that has an advice annotation is treated exactly as an
advice declaration by AspectJ's weaver. This includes the join points that
arise when the advice is executed (an adviceexecution join point, not a
- method execution join point), and the restriction that advice cannot be
- invoked explicitly (the weaver will issue an error if an advice method
- is explicitly invoked).</p><p>The following example shows a simple before advice declaration in
+ method execution join point).</p><p>The following example shows a simple before advice declaration in
both styles:</p><pre class="programlisting">
- before() : call(* org.aspectprogrammer..*(..)) &amp;&amp; this(Foo) {
- System.out.println("Call from Foo");
- }
-
- is equivalent to...
-
@Before("call(* org.aspectprogrammer..*(..)) &amp;&amp; this(Foo)")
public void callFromFoo() {
System.out.println("Call from Foo");
}
- </pre><p>Notice one slight difference between the two advice declarations: in
- the annotation style, the advice has a name, "callFromFoo". Even though
- advice cannot be invoked explicitly, this name is useful in join point
- matching when advising advice execution. For this reason, and to preserve
- exact semantic equivalence between the two styles, we also support the
- <tt>org.aspectj.lang.annotation.AdviceName</tt> annotation.
- The exact equivalent declarations are:
- </p><pre class="programlisting">
- @AdviceName("callFromFoo")
+ </pre><p>is equivalent to...</p><pre class="programlisting">
before() : call(* org.aspectprogrammer..*(..)) &amp;&amp; this(Foo) {
System.out.println("Call from Foo");
}
-
- is equivalent to...
-
- @Before("call(* org.aspectprogrammer..*(..)) &amp;&amp; this(Foo)")
- public void callFromFoo() {
- System.out.println("Call from Foo");
- }
- </pre><p>If the advice body needs to know which particular
- <tt>Foo</tt>
- was doing the calling, just add a parameter to the advice declaration.
+ </pre><p>If the advice body needs to know which particular
+ <tt>Foo</tt> instance
+ is making the call, just add a parameter to the advice declaration.
</p><pre class="programlisting">
- @AdviceName("callFromFoo")
before(Foo foo) : call(* org.aspectprogrammer..*(..)) &amp;&amp; this(foo) {
System.out.println("Call from Foo: " + foo);
}
-
- is equivalent to...
-
+ </pre><p>can be written as:</p><pre class="programlisting">
@Before("call(* org.aspectprogrammer..*(..)) &amp;&amp; this(foo)")
public void callFromFoo(Foo foo) {
System.out.println("Call from Foo: " + foo);
@@ -213,20 +178,17 @@
be declared as additional method parameters when using the annotation
style.
</p><pre class="programlisting">
- @AdviceName("callFromFoo")
- before(Foo foo) : call(* org.aspectprogrammer..*(..)) &amp;&amp; this(foo) {
+ @Before("call(* org.aspectprogrammer..*(..)) &amp;&amp; this(foo)")
+ public void callFromFoo(JoinPoint thisJoinPoint, Foo foo) {
System.out.println("Call from Foo: " + foo + " at "
+ thisJoinPoint);
}
-
- is equivalent to...
-
- @Before("call(* org.aspectprogrammer..*(..)) &amp;&amp; this(foo)")
- public void callFromFoo(JoinPoint thisJoinPoint, Foo foo) {
+ </pre><p>is equivalent to...</p><pre class="programlisting">
+ before(Foo foo) : call(* org.aspectprogrammer..*(..)) &amp;&amp; this(foo) {
System.out.println("Call from Foo: " + foo + " at "
+ thisJoinPoint);
}
- </pre><p>Advice that needs all three variables would be declared:</p><pre class="programlisting">
+ </pre><p>Advice that needs all three variables would be declared:</p><pre class="programlisting">
@Before("call(* org.aspectprogrammer..*(..)) &amp;&amp; this(Foo)")
public void callFromFoo(JoinPoint thisJoinPoint,
JoinPoint.StaticPart thisJoinPointStaticPart,
@@ -254,23 +216,21 @@
parameter as a parameter in the method body and bind it with the "returning"
attribute:
</p><pre class="programlisting">
- after() returning : criticalOperation() {
+ @AfterReturning("criticalOperation()")
+ public void phew() {
System.out.println("phew");
}
- after() returning(Foo f) : call(Foo+.new(..)) {
+ @AfterReturning(pointcut="call(Foo+.new(..))",returning="f")
+ public void itsAFoo(Foo f) {
System.out.println("It's a Foo: " + f);
}
-
- can be written as...
-
- @AfterReturning("criticalOperation()")
- public void phew() {
+ </pre><p>is equivalent to...</p><pre class="programlisting">
+ after() returning : criticalOperation() {
System.out.println("phew");
}
- @AfterReturning(pointcut="call(Foo+.new(..))",returning="f")
- public void itsAFoo(Foo f) {
+ after() returning(Foo f) : call(Foo+.new(..)) {
System.out.println("It's a Foo: " + f);
}
</pre><p>(Note the use of the "pointcut=" prefix in front of the pointcut
@@ -302,16 +262,6 @@
return thisJoinPoint.proceed();
}
</pre><p>Here's an example that uses parameters for the proceed call:</p><pre class="programlisting">
- public aspect ProceedAspect {
- pointcut setAge(int i): call(* setAge(..)) &amp;&amp; args(i);
-
- Object around(int i): setAge(i) {
- return proceed(i*2);
- }
- }
-
- can be written as...
-
@Aspect
public class ProceedAspect {
@@ -325,5 +275,13 @@
}
- Note that the ProceedingJoinPoint does not need to be passed as the proceed(..) arguments.
- </pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ataspectj-aspects.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ataspectj-itds.html">Next</a></td></tr><tr><td width="40%" align="left">Aspect Declarations&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="ataspectj.html">Up</a></td><td width="40%" align="right">&nbsp;Inter-type Declarations</td></tr></table></div></body></html> \ No newline at end of file
+ </pre><p>is equivalent to:</p><pre class="programlisting">
+ public aspect ProceedAspect {
+ pointcut setAge(int i): call(* setAge(..)) &amp;&amp; args(i);
+
+ Object around(int i): setAge(i) {
+ return proceed(i*2);
+ }
+ }
+ </pre><p>Note that the ProceedingJoinPoint does not need to be passed to the proceed(..) arguments.
+</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ataspectj-aspects.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ataspectj-itds.html">Next</a></td></tr><tr><td width="40%" align="left">Aspect Declarations&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="ataspectj.html">Up</a></td><td width="40%" align="right">&nbsp;Inter-type Declarations</td></tr></table></div></body></html> \ No newline at end of file
diff --git a/org.aspectj.ajde/doc/adk15notebook/ataspectj.html b/org.aspectj.ajde/doc/adk15notebook/ataspectj.html
index ed77464a4..5bb19387a 100755
--- a/org.aspectj.ajde/doc/adk15notebook/ataspectj.html
+++ b/org.aspectj.ajde/doc/adk15notebook/ataspectj.html
@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Chapter 9. An Annotation Based Development Style</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="previous" href="pertypewithin.html" title="Chapter 8. The pertypewithin Aspect Instantiation Model"><link rel="next" href="ataspectj-aspects.html" title="Aspect Declarations"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 9. An Annotation Based Development Style</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="pertypewithin.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ataspectj-aspects.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="ataspectj"></a>Chapter 9. An Annotation Based Development Style</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="ataspectj.html#ataspectj-intro">Introduction</a></dt><dt><a href="ataspectj-aspects.html">Aspect Declarations</a></dt><dt><a href="ataspectj-pcadvice.html">Pointcuts and Advice</a></dt><dd><dl><dt><a href="ataspectj-pcadvice.html#d0e3980">Pointcuts</a></dt><dt><a href="ataspectj-pcadvice.html#d0e4101">Advice</a></dt></dl></dd><dt><a href="ataspectj-itds.html">Inter-type Declarations</a></dt><dt><a href="ataspectj-declare.html">Declare statements</a></dt><dt><a href="ataspectj-aspectof.html">aspectOf() and hasAspect() methods</a></dt></dl></div><div class="sect1"><a name="ataspectj-intro"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ataspectj-intro"></a>Introduction</h2></div></div><p>In addition to the familiar AspectJ code-based style of aspect
+ <title>Chapter 9. An Annotation Based Development Style</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="previous" href="pertypewithin.html" title="Chapter 8. The pertypewithin Aspect Instantiation Model"><link rel="next" href="ataspectj-aspects.html" title="Aspect Declarations"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 9. An Annotation Based Development Style</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="pertypewithin.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ataspectj-aspects.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="ataspectj"></a>Chapter 9. An Annotation Based Development Style</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="ataspectj.html#ataspectj-intro">Introduction</a></dt><dt><a href="ataspectj-aspects.html">Aspect Declarations</a></dt><dd><dl><dt><a href="ataspectj-aspects.html#d0e3640">Limitations</a></dt></dl></dd><dt><a href="ataspectj-pcadvice.html">Pointcuts and Advice</a></dt><dd><dl><dt><a href="ataspectj-pcadvice.html#d0e3657">Pointcuts</a></dt><dt><a href="ataspectj-pcadvice.html#d0e3796">Advice</a></dt></dl></dd><dt><a href="ataspectj-itds.html">Inter-type Declarations</a></dt><dt><a href="ataspectj-declare.html">Declare statements</a></dt><dt><a href="ataspectj-aspectof.html">aspectOf() and hasAspect() methods</a></dt></dl></div><div class="sect1"><a name="ataspectj-intro"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ataspectj-intro"></a>Introduction</h2></div></div><p>In addition to the familiar AspectJ code-based style of aspect
declaration, AspectJ 5 also supports an annotation-based style of
aspect declaration. We informally call the set of annotations that
support this development style the "@AspectJ" annotations.</p><p>
diff --git a/org.aspectj.ajde/doc/adk15notebook/autoboxing-and-method-dispatch.html b/org.aspectj.ajde/doc/adk15notebook/autoboxing-and-method-dispatch.html
index 3b512194b..85aa94593 100755
--- a/org.aspectj.ajde/doc/adk15notebook/autoboxing-and-method-dispatch.html
+++ b/org.aspectj.ajde/doc/adk15notebook/autoboxing-and-method-dispatch.html
@@ -2,10 +2,10 @@
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Inter-type method declarations and method dispatch</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="autoboxing.html" title="Chapter 4. Autoboxing and Unboxing"><link rel="previous" href="autoboxing-in-aspectj5.html" title="Autoboxing and Join Point matching in AspectJ 5"><link rel="next" href="covariance.html" title="Chapter 5. Covariance"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Inter-type method declarations and method dispatch</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="autoboxing-in-aspectj5.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 4. Autoboxing and Unboxing</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="covariance.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="autoboxing-and-method-dispatch"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="autoboxing-and-method-dispatch"></a>Inter-type method declarations and method dispatch</h2></div></div><p>Autoboxing, unboxing, and also varargs all affect the method
dispatch algorithm used in Java 5. In AspectJ 5, the target method
- of a call is selected according to the following algorithm:</p><div class="orderedlist"><ol type="1"><li><a name="d0e3482"></a>Attempt to locate a matching method or inter-type declared
+ of a call is selected according to the following algorithm:</p><div class="orderedlist"><ol type="1"><li><a name="d0e3165"></a>Attempt to locate a matching method or inter-type declared
method without considering
- autoboxing, unboxing, or vararg invocations.</li><li><a name="d0e3484"></a>If no match is found, try again considering autoboxing
- and unboxing.</li><li><a name="d0e3486"></a>Finally try again considering both autoboxing, unboxing,
+ autoboxing, unboxing, or vararg invocations.</li><li><a name="d0e3167"></a>If no match is found, try again considering autoboxing
+ and unboxing.</li><li><a name="d0e3169"></a>Finally try again considering both autoboxing, unboxing,
and varargs.</li></ol></div><p>One consequence is that a directly matching inter-type declared
method will take precedence over a method declared locally in the
target class but that only matches via autoboxing.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="autoboxing-in-aspectj5.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="covariance.html">Next</a></td></tr><tr><td width="40%" align="left">Autoboxing and Join Point matching in AspectJ 5&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="autoboxing.html">Up</a></td><td width="40%" align="right">&nbsp;Chapter 5. Covariance</td></tr></table></div></body></html> \ No newline at end of file
diff --git a/org.aspectj.ajde/doc/adk15notebook/autoboxing-in-aspectj5.html b/org.aspectj.ajde/doc/adk15notebook/autoboxing-in-aspectj5.html
index 24d982d65..ef052e07c 100755
--- a/org.aspectj.ajde/doc/adk15notebook/autoboxing-in-aspectj5.html
+++ b/org.aspectj.ajde/doc/adk15notebook/autoboxing-in-aspectj5.html
@@ -11,7 +11,7 @@
AspectJ 5 applies autoboxing and unboxing in determining argument matching.
In other words, <tt>args(Integer)</tt> will match any join
point at which there is a single argument of type <tt>Integer</tt>
- or of type <tt>int</tt>.</p><div class="itemizedlist"><ul><li><a name="d0e3458"></a>args(Integer) and args(int) are equivalent</li><li><a name="d0e3460"></a>args(Float) and args(float) are equivalent</li><li><a name="d0e3462"></a>args(Double) and args(double) are equivalent</li><li><a name="d0e3464"></a>args(Short) and args(short) are equivalent</li><li><a name="d0e3466"></a>args(Byte) and args(byte) are equivalent</li><li><a name="d0e3468"></a>args(Long) and args(long) are equivalent</li><li><a name="d0e3470"></a>args(Boolean) and args(boolean) are equivalent</li></ul></div><p>
+ or of type <tt>int</tt>.</p><div class="itemizedlist"><ul><li><a name="d0e3141"></a>args(Integer) and args(int) are equivalent</li><li><a name="d0e3143"></a>args(Float) and args(float) are equivalent</li><li><a name="d0e3145"></a>args(Double) and args(double) are equivalent</li><li><a name="d0e3147"></a>args(Short) and args(short) are equivalent</li><li><a name="d0e3149"></a>args(Byte) and args(byte) are equivalent</li><li><a name="d0e3151"></a>args(Long) and args(long) are equivalent</li><li><a name="d0e3153"></a>args(Boolean) and args(boolean) are equivalent</li></ul></div><p>
Autoboxing and unboxing are also applied when binding pointcut or
advice parameters, for example:
</p><pre class="programlisting">
diff --git a/org.aspectj.ajde/doc/adk15notebook/ch11s03.html b/org.aspectj.ajde/doc/adk15notebook/ch11s03.html
index 07f9340d1..301fadc74 100755
--- a/org.aspectj.ajde/doc/adk15notebook/ch11s03.html
+++ b/org.aspectj.ajde/doc/adk15notebook/ch11s03.html
@@ -1,4 +1,4 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Tools</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="miscellaneous.html" title="Chapter 11. Other Changes in AspectJ 5"><link rel="previous" href="declare-soft.html" title="Declare Soft"><link rel="next" href="ltw.html" title="Chapter 12. Load-Time Weaving"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Tools</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="declare-soft.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 11. Other Changes in AspectJ 5</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ltw.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="d0e4390"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e4390"></a>Tools</h2></div></div><div class="sect2"><a name="d0e4393"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4393"></a>Aspectpath</h3></div></div><p>AspectJ 5 allows the specification of directories (containing .class files) on the aspectpath in
+ <title>Tools</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="miscellaneous.html" title="Chapter 11. Other Changes in AspectJ 5"><link rel="previous" href="declare-soft.html" title="Declare Soft"><link rel="next" href="ltw.html" title="Chapter 12. Load-Time Weaving"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Tools</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="declare-soft.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 11. Other Changes in AspectJ 5</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ltw.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="d0e4109"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e4109"></a>Tools</h2></div></div><div class="sect2"><a name="d0e4112"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4112"></a>Aspectpath</h3></div></div><p>AspectJ 5 allows the specification of directories (containing .class files) on the aspectpath in
addition to jar/zip files.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="declare-soft.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ltw.html">Next</a></td></tr><tr><td width="40%" align="left">Declare Soft&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="miscellaneous.html">Up</a></td><td width="40%" align="right">&nbsp;Chapter 12. Load-Time Weaving</td></tr></table></div></body></html> \ No newline at end of file
diff --git a/org.aspectj.ajde/doc/adk15notebook/covariance-and-join-point-matching.html b/org.aspectj.ajde/doc/adk15notebook/covariance-and-join-point-matching.html
index 643e9d8a3..05230014a 100755
--- a/org.aspectj.ajde/doc/adk15notebook/covariance-and-join-point-matching.html
+++ b/org.aspectj.ajde/doc/adk15notebook/covariance-and-join-point-matching.html
@@ -17,24 +17,24 @@
</p><pre class="programlisting">
A A.whoAreYou()
B B.whoAreYou()
- </pre><p>Following the join point matching rules given in <a href="jpsigs.html">Join Point Signatures</a>,</p><div class="variablelist"><dl><dt><a name="d0e3540"></a><span class="term">call(* whoAreYou())</span></dt><dd><p><a name="d0e3543"></a>Matches both calls, (since each call join point has at least
+ </pre><p>Following the join point matching rules given in <a href="jpsigs.html">Join Point Signatures</a>,</p><div class="variablelist"><dl><dt><a name="d0e3223"></a><span class="term">call(* whoAreYou())</span></dt><dd><p><a name="d0e3226"></a>Matches both calls, (since each call join point has at least
one matching signature).
- </p></dd><dt><a name="d0e3546"></a><span class="term">call(* A.whoAreYou())</span></dt><dd><p><a name="d0e3549"></a>Matches both calls, (since each call join point has at least
+ </p></dd><dt><a name="d0e3229"></a><span class="term">call(* A.whoAreYou())</span></dt><dd><p><a name="d0e3232"></a>Matches both calls, (since each call join point has at least
one matching signature).
- </p></dd><dt><a name="d0e3552"></a><span class="term">call(A whoAreYou())</span></dt><dd><p><a name="d0e3555"></a>Matches both calls, (since each call join point has at least
+ </p></dd><dt><a name="d0e3235"></a><span class="term">call(A whoAreYou())</span></dt><dd><p><a name="d0e3238"></a>Matches both calls, (since each call join point has at least
one matching signature).
- </p></dd><dt><a name="d0e3558"></a><span class="term">call(A B.whoAreYou())</span></dt><dd><p><a name="d0e3561"></a>Does not match anything - neither of the call join points
+ </p></dd><dt><a name="d0e3241"></a><span class="term">call(A B.whoAreYou())</span></dt><dd><p><a name="d0e3244"></a>Does not match anything - neither of the call join points
has a signature matched by this pattern. A lint warning is
given for the call <tt>a.whoAreYou()</tt> ("does not match
because declaring type is A, if match required use target(B)").
- </p></dd><dt><a name="d0e3567"></a><span class="term">call(A+ B.whoAreYou())</span></dt><dd><p><a name="d0e3570"></a>Matches the call to <tt>b.whoAreYou()</tt> since
+ </p></dd><dt><a name="d0e3250"></a><span class="term">call(A+ B.whoAreYou())</span></dt><dd><p><a name="d0e3253"></a>Matches the call to <tt>b.whoAreYou()</tt> since
the signature pattern matches the signature <tt>B B.whoAreYou()</tt>.
A lint warning is given for the call <tt>a.whoAreYou()</tt> ("does not match
because declaring type is A, if match required use target(B)").
- </p></dd><dt><a name="d0e3582"></a><span class="term">call(B A.whoAreYou())</span></dt><dd><p><a name="d0e3585"></a>Does not match anything since neither join point has a
+ </p></dd><dt><a name="d0e3265"></a><span class="term">call(B A.whoAreYou())</span></dt><dd><p><a name="d0e3268"></a>Does not match anything since neither join point has a
signature matched by this pattern.
- </p></dd><dt><a name="d0e3588"></a><span class="term">call(B whoAreYou())</span></dt><dd><p><a name="d0e3591"></a>Matches the call to <tt>b.whoAreYou()</tt> only.
- </p></dd><dt><a name="d0e3597"></a><span class="term">call(B B.whoAreYou())</span></dt><dd><p><a name="d0e3600"></a>Matches the call to <tt>b.whoAreYou()</tt> only.
+ </p></dd><dt><a name="d0e3271"></a><span class="term">call(B whoAreYou())</span></dt><dd><p><a name="d0e3274"></a>Matches the call to <tt>b.whoAreYou()</tt> only.
+ </p></dd><dt><a name="d0e3280"></a><span class="term">call(B B.whoAreYou())</span></dt><dd><p><a name="d0e3283"></a>Matches the call to <tt>b.whoAreYou()</tt> only.
</p></dd></dl></div><p>The rule for signature matching at call and execution join points
is unchanged from AspectJ 1.2: a call or execution pointcut matches if
the signature pattern matches at least one of the signatures of the
diff --git a/org.aspectj.ajde/doc/adk15notebook/declare-soft.html b/org.aspectj.ajde/doc/adk15notebook/declare-soft.html
index b62e1cac0..514a1e770 100755
--- a/org.aspectj.ajde/doc/adk15notebook/declare-soft.html
+++ b/org.aspectj.ajde/doc/adk15notebook/declare-soft.html
@@ -7,12 +7,12 @@
or a subtype of <tt>RuntimeException</tt> then a new XLint warning will be issued:</p><pre class="programlisting">
declare soft : SomeRuntimeException : execution(* *(..));
- &amp;gt;&amp;gt; "SomeRuntimeException will not be softened as it is already a RuntimeException" [XLint:runtimeExceptionNotSoftened]
+ &gt;&gt; "SomeRuntimeException will not be softened as it is already a RuntimeException" [XLint:runtimeExceptionNotSoftened]
</pre><p>
This XLint message can be controlled by setting the <tt>runtimeExceptionNotSoftened</tt> XLint parameter.
</p><p>
If the exception type specified in a declare soft statement is a super type of <tt>RuntimeException</tt>
- (such as <tt>Exception</tt> for example) then any <font color="red">&lt;i&gt;checked&lt;/i&gt;</font> exception thrown at a matched join point,
+ (such as <tt>Exception</tt> for example) then any <span class="emphasis"><i>checked</i></span> exception thrown at a matched join point,
where the exception is an instance of the softened exception, will be softened to an
<tt>org.aspectj.lang.SoftException</tt>.
</p><pre class="programlisting">
diff --git a/org.aspectj.ajde/doc/adk15notebook/enums-in-aspectj5.html b/org.aspectj.ajde/doc/adk15notebook/enums-in-aspectj5.html
index ec555e9c2..5f44859d7 100755
--- a/org.aspectj.ajde/doc/adk15notebook/enums-in-aspectj5.html
+++ b/org.aspectj.ajde/doc/adk15notebook/enums-in-aspectj5.html
@@ -4,12 +4,12 @@
AspectJ 5 supports the declaration of enumerated types just as Java 5
does. Because of the special restrictions Java 5 places around enumerated
types, AspectJ makes the following additional restrictions:
- </p><div class="itemizedlist"><ul><li><a name="d0e3829"></a>You cannot use declare parents to change the super type of
- an enum.</li><li><a name="d0e3831"></a>You cannot use declare parents to declare java.lang.Enum as
- the parent of any type.</li><li><a name="d0e3833"></a>You cannot make inter-type constructor declarations on an
- enum.</li><li><a name="d0e3835"></a>You cannot extend the set of values in an enum via any
- ITD-like construct.</li><li><a name="d0e3837"></a>You cannot make inter-type method or field declarations on
- an enum.</li><li><a name="d0e3839"></a>You cannot use declare parents to make an enum type implement
+ </p><div class="itemizedlist"><ul><li><a name="d0e3512"></a>You cannot use declare parents to change the super type of
+ an enum.</li><li><a name="d0e3514"></a>You cannot use declare parents to declare java.lang.Enum as
+ the parent of any type.</li><li><a name="d0e3516"></a>You cannot make inter-type constructor declarations on an
+ enum.</li><li><a name="d0e3518"></a>You cannot extend the set of values in an enum via any
+ ITD-like construct.</li><li><a name="d0e3520"></a>You cannot make inter-type method or field declarations on
+ an enum.</li><li><a name="d0e3522"></a>You cannot use declare parents to make an enum type implement
an interface.</li></ul></div><p>In theory, the last of these two items <span class="emphasis"><i>could</i></span>
be supported. However, AspectJ 5 follows the simple rule that <span class="emphasis"><i>
an enum type cannot be the target of an inter-type declaration or declare
diff --git a/org.aspectj.ajde/doc/adk15notebook/generics-inAspectJ5.html b/org.aspectj.ajde/doc/adk15notebook/generics-inAspectJ5.html
index 0d2e8832f..60b29ce64 100755
--- a/org.aspectj.ajde/doc/adk15notebook/generics-inAspectJ5.html
+++ b/org.aspectj.ajde/doc/adk15notebook/generics-inAspectJ5.html
@@ -5,453 +5,383 @@
legal AspectJ 5 progam. In addition, AspectJ 5 provides support for generic and parameterized types in pointcuts, inter-type
declarations, and declare statements. Parameterized types may freely be used within aspect members, and support is
also provided for generic <span class="emphasis"><i>abstract</i></span> aspects.
- </p><div class="sect2"><a name="d0e2095"></a><div class="titlepage"><div><h3 class="title"><a name="d0e2095"></a>Matching generic and parameterized types in type patterns</h3></div></div><p>
- The foundation of AspectJ's support for generic and parameterized types in aspect declarations is the extension of type
- pattern matching to allow matching against generic and parameterized types.
- </p><p>
- The type pattern <tt>"Foo"</tt> matches all types named <tt>Foo</tt>, whether they
- be simple types, generic types, or parameterized types. So for example, <tt>Foo</tt>,
- <tt>Foo&lt;T&gt;</tt>, and <tt>Foo&lt;String&gt;</tt>will all be matched.
- </p><p>
- AspectJ 5 also extends the specification of type patterns to allow explicit matching of generic and parameterized
- types by including one or more type parameter patterns inside angle braces (<tt>&lt; &gt;</tt>) immediately
- after the type pattern. For example, <tt>List&lt;String&gt;</tt>
- </p><pre class="programlisting">
- TypePattern := SimpleTypePattern |
- '!' TypePattern |
- '(' AnnotationPattern? TypePattern ')'
- TypePattern '&amp;&amp;' TypePattern |
- TypePattern '||' TypePattern |
- TypePattern '&lt;' TypeParameterPatternList '&gt;'
-
- TypeParameterPatternList ::= TypeParameterPattern (',' TypeParameterPattern)*
-
- TypeParameterPattern ::= TypePattern |
- '?' TypeBoundPattern?
-
- TypeBoundPattern ::= 'extends' TypePattern AdditionalBoundPatternList? |
- 'super' TypePattern AdditionalBoundPatternList?
-
- AdditionalBoundPatternList ::= AdditionalBoundPattern AdditionalBoundPatternList |
- AdditionalBoundPattern
-
- AdditionalBoundPattern ::= '&amp;' TypePattern
-
- </pre><p>
- A simple identifier (such as <tt>String</tt>) occuring in a type parameter list will be treated as a type name unless
- a type variable of that name is in scope (declaring type variables is covered later). The type pattern <tt>List&lt;E&gt;</tt>
- will result in an "invalid absolute type name" warning if no type <tt>E</tt> is in scope (declared in the default package, or
- imported in the compilation unit) and no declaration of <tt>E</tt> as a type variable is in scope either.
- </p><p>Some simple examples of type patterns follow:</p><div class="variablelist"><dl><dt><a name="d0e2144"></a><span class="term">List&lt;String&gt;</span></dt><dd><p><a name="d0e2147"></a>Matches the parameterized type <tt>List&lt;String&gt;</tt>
- </p></dd><dt><a name="d0e2153"></a><span class="term">List&lt;? extends Number&gt;</span></dt><dd><p><a name="d0e2156"></a>Matches the parameterized type <tt>List&lt;? extends Number&gt;</tt>
- </p></dd><dt><a name="d0e2162"></a><span class="term">List&lt;E&gt;</span></dt><dd><p><a name="d0e2165"></a>Outside of a scope in which <tt>E</tt>is defined as a type variable, this pattern matches the
- parameterized type <tt>List&lt;E&gt;</tt>. If <tt>E</tt> is not
- a type then an <tt>invalidAbsoluteTypeName</tt> xlint warning will be issued.
- </p><p>In a scope in which
- <tt>E</tt> is defined as a type variable, this pattern matches the generic type <tt>List&lt;E&gt;</tt>.
- The type parameter name does not have to match the name used in the declaration of <tt>List</tt>,
- but the bounds must match. This pattern <span class="emphasis"><i>also</i></span> matches any parameterization of <tt>List</tt>
- that satisfies the bounds of the type variable (for example, <tt>List&lt;String&gt;</tt>).
- </p></dd></dl></div><p>
- The <tt>*</tt>, <tt>+</tt>, and <tt>..</tt> wildcards may be used in type patterns
- matching against generic and parameterized types (just as in any other type pattern). The <tt>+</tt>
- wildcard matches all subtypes. Recalling the discussion on subtypes and supertypes in the previous section, note
- that the pattern <tt>List&lt;Number&gt;+</tt> will match <tt>List&lt;Number&gt;</tt> and
- <tt>LinkedList&lt;Number&gt;</tt>, but not <tt>List&lt;Double&gt;</tt>. To match lists of
- any number type use the pattern <tt>List&lt;Number+&gt;</tt> which will match
- <tt>List&lt;Number&gt;</tt>, <tt>List&lt;Double&gt;</tt>, <tt>List&lt;Float&gt;</tt>
- and so on.
- </p><p>
- The generics wildcard <tt>?</tt> is considered part of the signature of a parameterized type, and
- is <span class="emphasis"><i>not</i></span> used as an AspectJ wildcard in type matching. For example:
- </p><div class="variablelist"><dl><dt><a name="d0e2247"></a><span class="term">List&lt;*&gt;</span></dt><dd><p><a name="d0e2250"></a>Matches any generic or parameterized <tt>List</tt>type (<tt>List&lt;String&gt;</tt>,
- <tt>List&lt;Integer&gt;</tt> and so on) with a single type parameter.
- </p></dd><dt><a name="d0e2262"></a><span class="term">List&lt;?&gt;</span></dt><dd><p><a name="d0e2265"></a>Matches the parameterized type <tt>List&lt;?&gt;</tt> (and does
- <span class="emphasis"><i>not</i></span> match <tt>List&lt;String&gt;</tt>,
- <tt>List&lt;Integer&gt;</tt> and so on)
- </p></dd><dt><a name="d0e2280"></a><span class="term">List&lt;? extends Number+&gt;</span></dt><dd><p><a name="d0e2283"></a>Matches <tt>List&lt;? extends Number&gt;</tt>, <tt>List&lt;? extends Double&gt;</tt>,
- and so on, but does not match <tt>List&lt;Double&gt;</tt>.
- </p></dd></dl></div></div><div class="sect2"><a name="d0e2295"></a><div class="titlepage"><div><h3 class="title"><a name="d0e2295"></a>Signature patterns</h3></div></div><p>
- Now that we understand how to write type patterns that match generic and parameterized types, it is time to look at
- how these can be utilized to match member declarations by using signature patterns.
- </p><p>To match members declared in generic types and making use of type variables defined in those types (for
- example <tt>interface Foo&lt;T&gt; { public T doSomething(); }</tt> use a signature pattern of the form:</p><pre class="programlisting">
- X Foo&lt;X&gt;.doSomething()
- </pre><p>
- This assumes a scope in which <tt>X</tt> is declared as a type variable. As with type patterns, the name
- of the type variable does not have to match the name used in the member declaration, but the bounds must match.
- For example, if the interface was declared as <tt>Foo&lt;T extends Number&gt;</tt> then the signature
- pattern would be: <tt>X Foo&lt;X extends Number&gt;.doSomething()</tt>.
- </p><div class="variablelist"><dl><dt><a name="d0e2319"></a><span class="term">T Util&lt;T extends Number,S&gt;.someFunction(List&lt;S&gt;)</span></dt><dd><p><a name="d0e2322"></a>Matches the method <tt>someFunction</tt> in a generic type <tt>Util</tt> with
- two type parameters, the first type parameter having an upper bound of <tt>Number</tt>.
- </p></dd><dt><a name="d0e2334"></a><span class="term">LinkedList&lt;E&gt;.new()</span></dt><dd><p><a name="d0e2337"></a>Matches the no-argument constructor of the generic type <tt>LinkedList</tt>.
- </p></dd></dl></div><p>
- Matching a field with a generic type works in the same way. For example:
- </p><pre class="programlisting">
- T *&lt;T&gt;.*
- </pre><p>Matches a field of the type of type parameter <tt>T</tt> in any generic type with a single
- unbounded type parameter (the pattern<tt>*&lt;T&gt;</tt>). The field may be of any name.
- </p><p>Matching of members of parameterized types is straightforward. For example,
- <tt>void List&lt;String&gt;.add(String)</tt> matches the add method in the
- parameterized type <tt>List&lt;String&gt;</tt>.
- </p><p>
- To match a generic <span class="emphasis"><i>method</i></span> the generic method type variable
- declarations become part of the signature pattern. For example:
- </p><pre class="programlisting">
- &lt;T&gt; List&lt;T&gt; *.favourites(List&lt;T&gt;)
- </pre><p>matches a generic method <tt>favourites</tt> declared in any type. To match a
- static generic method simply include the <tt>static</tt> modifier in the type pattern.</p></div><div class="sect2"><a name="d0e2378"></a><div class="titlepage"><div><h3 class="title"><a name="d0e2378"></a>Pointcuts</h3></div></div><p>
- In this section we discuss how type patterns and signature patterns matching on generic and
- parameterized types, methods, and constructors can be used in pointcut expressions.
- We distinguish between pointcuts that match based on static type information, and pointcuts
- that match based on runtime type information (<tt>this, target, args</tt>).
- </p><p>
- First however we need to address the notion of type variables and scopes. There is a
- convention in Java, but no requirement, that type variables are named with a single letter.
- Likewise it is rare, but perfectly legal, to declare a type with a single character name. Given the
- type pattern <tt>List&lt;Strng&gt;</tt>, is this a mis-spelling of the
- parameterized type pattern <tt>List&lt;String&gt;</tt> or is it a generic type pattern
- with one unbounded type variable <tt>Strng</tt>?. Alternatively, given the
- type pattern <tt>List&lt;E&gt;</tt>, if the type <tt>E</tt> cannot be found,
- is this a missing import statement or an implied type variable? There is no way for AspectJ
- to disambiguate in these situations without an explicit declaration of type variable names. If
- <tt>E</tt> is defined as a type variable, and <tt>Strng</tt> is not, then both
- declarations can be correctly interpreted.
- </p><div class="sect3"><a name="d0e2409"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2409"></a>Type Variables in Pointcut Expressions</h4></div></div><p>The type variables in scope for a pointcut primitive are declared in a type variable
- list immediately following the pointcut desginator keyword. For example:</p><pre class="programlisting">
- call&lt;T&gt;(* Foo&lt;T&gt;.*(T))
- </pre><p>matches a call to a method with any name (<tt>*</tt>) declared
- by a generic type <tt>Foo</tt> with one unbounded type parameter. The method
- takes one argument which is of the type of the type variable.</p><p>In contrast, the pointcut</p><pre class="programlisting">
- call(* Foo&lt;T&gt;.*(T))
- </pre><p>matches a call to a method with any name that takes an argument of
- type <tt>T</tt>, where the target of the call is declared as the parameterized
- type <tt>Foo&lt;T&gt;</tt>. If there is no type <tt>T</tt> in scope, an
- "invalid absolute type name (T)" warning will be issued.</p><p>
- The type variables declaration following a pointcut designator permits only simple identifiers
- (e.g. <tt>&lt;S,T&gt;</tt> and not <tt>&lt;S extends Number&gt;</tt>).
- </p><p>A type variable declaration list can appear following any pointcut designator except
- for <tt>handler</tt> (Java 5 does
- not permit a generic class to be a direct or indirect subtype of <tt>Throwable</tt>
- - see JLS 8.1.2), the dynamic pointcuts <tt>this, target, args, if, cflow, cflowbelow</tt>,
- and the annotation pointcut designators
- (<tt>@args, @this, @within</tt> and so on).</p></div><div class="sect3"><a name="d0e2461"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2461"></a>Initialization and execution pointcuts</h4></div></div><p>
- Recall that there is only ever one type for a generic type (e.g. <tt>List&lt;E&gt;</tt>)
- regardless of how many different parameterizations of that type (e.g.
- <tt>List&lt;String&gt;</tt>, <tt>List&lt;Double&gt;</tt>) are used within a
- program. For join points that occur within a type, such as execution join points, it therefore only
- makes sense to talk about execution join points for the generic type. Given the generic type
- </p><pre class="programlisting">
- public class Foo&lt;T&gt; {
+ </p><div class="sect2"><a name="d0e2104"></a><div class="titlepage"><div><h3 class="title"><a name="d0e2104"></a>Matching generic and parameterized types in pointcut expressions</h3></div></div><p>
+ The simplest way to work with generic and parameterized types in pointcut expressions and type patterns
+ is simply to use the raw type name. For example, the type pattern <tt>List</tt> will match
+ the generic type <tt>List&lt;E&gt;</tt> and any parameterization of that type
+ (<tt>List&lt;String&gt;, List&lt;?&gt;, List&lt;? extends Number&gt;</tt> and so on. This
+ ensures that pointcuts written in existing code that is not generics-aware will continue to work as
+ expected in AspectJ 5. It is also the recommended way to match against generic and parameterized types
+ in AspectJ 5 unless you explicitly wish to narrow matches to certain parameterizations of a generic type.
+ </p><p>Generic methods and constructors, and members defined in generic types, may use type variables
+ as part of their signature. For example:</p><pre class="programlisting">
+ public class Utils {
- T doSomething(T toSomeT) {
- return T;
- }
-
- }
- </pre><p>
- then
- </p><div class="variablelist"><dl><dt><a name="d0e2480"></a><span class="term">execution&lt;T&gt;(T Foo&lt;T&gt;.doSomething(..))</span></dt><dd><p><a name="d0e2483"></a>matches the execution of the <tt>doSomething</tt> method in
- <tt>Foo</tt>.
- </p></dd><dt><a name="d0e2492"></a><span class="term">execution(* Foo.doSomething(..))</span></dt><dd><p><a name="d0e2495"></a>also matches the execution of the <tt>doSomething</tt> method in
- <tt>Foo</tt>.
- </p></dd><dt><a name="d0e2504"></a><span class="term">execution(T Foo.doSomething(..))</span></dt><dd><p><a name="d0e2507"></a>results in an "invalid absolute type name (T)" warning since <tt>T</tt> is
- interpreted as a type, not a type variable.
- </p></dd><dt><a name="d0e2513"></a><span class="term">execution(String Foo&lt;String&gt;.doSomething(..))</span></dt><dd><p><a name="d0e2516"></a>results in a compilation error "no execution join points for parameterized type
- Foo&lt;String&gt;, use a generic signature instead".
- </p></dd></dl></div><p>
- Given the type declaration
- </p><pre class="programlisting">
- public class Bar&lt;N extends Number&gt; {
+ /** static generic method */
+ static &lt;T&gt; T first(List&lt;T&gt; ts) { ... }
- N doSomething(N toSomeN) {
- return N;
- }
+ /** instance generic method */
+ &lt;T extends Number&gt; T max(T t1, T t2) { ... }
+
+ }
- }
- </pre><p>
- then
- </p><div class="variablelist"><dl><dt><a name="d0e2526"></a><span class="term">execution&lt;T&gt;(T Bar&lt;T&gt;.doSomething(..))</span></dt><dd><p><a name="d0e2529"></a>does not match the execution of <tt>Bar.doSomething</tt> since
- the bounds of the type parameter <tt>T</tt> in the pointcut expression do
- not match the bounds of the type parameter <tt>N</tt> in the type declaration.
- </p></dd><dt><a name="d0e2541"></a><span class="term">execution&lt;T&gt;(T Bar&lt;T extends Number&gt;.doSomething(..))</span></dt><dd><p><a name="d0e2544"></a>matches the execution of the <tt>doSomething</tt> method in
- <tt>Bar</tt>.
- </p></dd><dt><a name="d0e2553"></a><span class="term">execution&lt;T extends Number&gt;(T Bar&lt;T&gt;.doSomething(..))</span></dt><dd><p><a name="d0e2556"></a>results in a compilation error, since type variable bounds must be specified as part
- of the declaring type pattern, and not in the type variable list.
- </p></dd></dl></div><p>
- If a type implements a <span class="emphasis"><i>parameterized</i></span> interface, then
- execution join points exist and can be matched for the parameterized interface operations within
- the implementing type. For example, given the pair of types:
- </p><pre class="programlisting">
- public interface Greatest&lt;T&gt; {
- T greatest(List&lt;T&gt; ts);
- }
-
- public class NumberOperations implements Greatest&lt;Number&gt; {
- public Number greatest(List&lt;Number&gt; numbers) {
- //...
- }
- }
- </pre><p>
- then
- </p><pre class="programlisting">
- execution(* Greatest&lt;Number&gt;.*(..))
+ public class G&lt;T&gt; {
+
+ // field with parameterized type
+ T myData;
+
+ // method with parameterized return type
+ public List&lt;T&gt; getAllDataItems() {...}
+
+ }
</pre><p>
- will match the execution of the <tt>greatest</tt> method declared in
- <tt>NumberOperations</tt>. However, it <span class="emphasis"><i>does not</i></span>
- match the execution of <tt>greatest</tt> in the program below:
- </p><pre class="programlisting">
- public interface Greatest&lt;T&gt; {
- T greatest(List&lt;T&gt; ts);
- }
-
- public class NumberOperations&lt;N extends Number&gt; implements Greatest&lt;N&gt; {
- public N greatest(List&lt;N&gt; numbers) {
- //...
- }
- }
-
- // in some fragment of code...
- NumberOperations&lt;Number&gt; numOps = new NumberOperations&lt;Number&gt;();
- numOps.greatest(numList);
- </pre><p>Since there is only one generic type, <tt>NumberOperations</tt>,
- which implements a generic interface. Either of the pointcut expressions
- <tt>execution&lt;T&gt;(* Greatest&lt;T&gt;&gt;.*(..))</tt> or
- <tt>execution&lt;T&gt;(* Greatest&lt;T extends Number&gt;&gt;.*(..))</tt> will
- match the execution of <tt>greatest</tt> in this example. Recall from
- chapter <a href="jpsigs.html">Join Point Signatures</a> that a kinded pointcut primitive matches a join point if
- it exactly matches one of the signatures of the join point. The signatures of the
- execution join point for <tt>greatest</tt> in the example above are:</p><div class="variablelist"><dl><dt><a name="d0e2606"></a><span class="term">public N Greatest&lt;N&gt;.greatest(List&lt;N&gt;)</span></dt><dd><p><a name="d0e2609"></a>from the declaration in the <tt>Greatest</tt> interface, and
- </p></dd><dt><a name="d0e2615"></a><span class="term">public N Greatest&lt;N extends Number&gt;.greatest(List&lt;N&gt;)</span></dt><dd><p><a name="d0e2618"></a>from the additional bounds restriction of <tt>N</tt> in the
- declaration of <tt>NumberOperations</tt>
- </p></dd></dl></div><p>
- Join points for <tt>staticinitialization</tt>,<tt>initialization</tt> and
- <tt>preinitialization</tt>
- only ever exist on a generic type (an interface cannot define a constructor). The expression
- <tt>initialization&lt;T&gt;(Foo&lt;T&gt;.new(..))</tt> which match any initialization
- join point for the generic type <tt>Foo&lt;T&gt;</tt>, and
- <tt>staticinitialization&lt;T&gt;(Foo&lt;T&gt;)</tt> matches the static initialization
- of that same type.
- </p><p>
- The expression <tt>staticinitialization(List&lt;String&gt;)</tt> will result in a
- compilation error: there is no static initialization join point for the parameterized type
- <tt>List&lt;String&gt;</tt>. However, the expression
- <tt>staticinitialization(List&lt;String&gt;+)</tt> <span class="emphasis"><i>is</i></span>
- legal, and will match the static initialization of any type that
- <tt>implements List&lt;String&gt;</tt>. The expression
- <tt>staticinitialization&lt;T&gt;(List&lt;T&gt;+)</tt> will match the static
- initialization join point of any type that either extends or implements the generic
- type <tt>List&lt;T&gt;</tt> or implements any parameterization of that
- interface.
- </p></div><div class="sect3"><a name="d0e2670"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2670"></a>Static scoping: within and withincode</h4></div></div><p>The <tt>within</tt> and <tt>withincode</tt>
- pointcut designators both match the
- execution of join points that occur within a type or a member of a type respectively. Therefore
- the same considerations with respect to there only being <tt>one</tt> type for
- a generic type regardless of how many parameterizations of that type are used in a program
- apply.
- </p><p>The <tt>within</tt> pointcut designator can never be used in conjunction
- with a simple parameterized type. So
- </p><div class="variablelist"><dl><dt><a name="d0e2690"></a><span class="term">within&lt;T&gt;(Foo&lt;T&gt;)</span></dt><dd><p><a name="d0e2693"></a>matches all join points occurring within the generic type <tt>Foo&lt;T&gt;</tt>,
- and
- </p></dd><dt><a name="d0e2699"></a><span class="term">within(Foo&lt;String&gt;)</span></dt><dd><p><a name="d0e2702"></a>results in a compilation error since there is no concept of a join point within a
- parameterized type, but
- </p></dd><dt><a name="d0e2705"></a><span class="term">within(Foo&lt;String&gt;+)</span></dt><dd><p><a name="d0e2708"></a>matches any join point occurring within a type that
- <tt>implements Foo&lt;String&gt;</tt>.
- </p></dd></dl></div><p>The <tt>withincode</tt> designator is likewise normally used with a
- generic type, but can be used with a parameterized interface type to match join points
- arising from code lexically within the implementation of the interface methods in a type
- that implements the parameterized interface.
- </p><div class="variablelist"><dl><dt><a name="d0e2720"></a><span class="term">withincode&lt;T&gt;(* Foo&lt;T&gt;.*(..))</span></dt><dd><p><a name="d0e2723"></a>matches all join points arising from code lexically within a method of the
- generic type <tt>Foo&lt;T&gt;</tt>
- </p></dd><dt><a name="d0e2729"></a><span class="term">withincode(* Foo&lt;String&gt;.*(..))</span></dt><dd><p><a name="d0e2732"></a>results in a compilation error if <tt>Foo</tt> is not an interface. If
- <tt>Foo</tt> is an interface then it matches all join points arising from
- code lexically within the implementation of the interface methods in a type that
- implements <tt>Foo&lt;String&gt;</tt>.
- </p></dd><dt><a name="d0e2744"></a><span class="term">withincode(* Foo&lt;String&gt;+.*(..))</span></dt><dd><p><a name="d0e2747"></a>matches any join point occurring within a method of a type that
- <tt>implements Foo&lt;String&gt;</tt>.
- </p></dd></dl></div></div><div class="sect3"><a name="d0e2753"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2753"></a>Call, get and set pointcuts</h4></div></div><p>
- The <tt>call, get,</tt> and <tt>set</tt> join points can occur on the client
- side (ie. outside of the type owning the member being called, accessed, or updated) or
- within the type that owns the target member. The following short program demonstrates this:
- </p><pre class="programlisting">
- public class Foo&lt;T&gt; {
-
- public T timeFor;
-
- public Foo&lt;T&gt;(T aCuppa) {
- timeFor = aCuppa; // set-site A
+ AspectJ 5 does not allow the use of type variables in pointcut expressions and type patterns. Instead, members that
+ use type parameters as part of their signature are matched by their <span class="emphasis"><i>erasure</i></span>. Java 5 defines the
+ rules for determing the erasure of a type as follows.
+ </p><p>Let <tt>|T|</tt> represent the erasure of some type <tt>T</tt>. Then:</p><table class="simplelist" border="0" summary="Simple list"><tr><td>The erasure of a parameterized type <tt>T&lt;T1,...,Tn&gt;</tt> is <tt>|T|</tt>.
+ For example, the erasure of <tt>List&lt;String&gt;</tt> is <tt>List</tt>.</td></tr><tr><td>The erasure of a nested type <tt>T.C</tt> is <tt>|T|.C</tt>. For example,
+ the erasure of the nested type <tt>Foo&lt;T&gt;.Bar</tt> is <tt>Foo.Bar</tt>.</td></tr><tr><td>The erasure of an array type <tt>T[]</tt> is <tt>|T|[]</tt>. For example,
+ the erasure of <tt>List&lt;String&gt;[]</tt> is <tt>List[]</tt>.</td></tr><tr><td>The erasure of a type variable is its leftmost bound. For example, the erasure of a
+ type variable <tt>P</tt> is <tt>Object</tt>, and the erasure of a type
+ variable <tt>N extends Number</tt> is <tt>Number</tt>.</td></tr><tr><td>The erasure of every other type is the type itself</td></tr></table><p>Applying these rules to the earlier examples, we find that the methods defined in <tt>Utils</tt>
+ can be matched by a signature pattern matching <tt>static Object Utils.first(List)</tt> and
+ <tt>Number Utils.max(Number, Number)</tt> respectively. The members of the generic type
+ <tt>G</tt> can be matched by a signature pattern matching <tt>Object G.myData</tt> and
+ <tt>public List G.getAllDataItems()</tt> respectively.</p><div class="sect3"><a name="d0e2215"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2215"></a>Restricting matching using parameterized types</h4></div></div><p>Pointcut matching can be further restricted to match only given parameterizations of parameter types (methods and constructors), return
+ types (methods) and field types (fields). This is achieved by specifying a parameterized type pattern at the appropriate point
+ in the signature pattern. For example, given the class <tt>Foo</tt>:</p><pre class="programlisting">
+ public class Foo {
+
+ List&lt;String&gt; myStrings;
+ List&lt;Float&gt; myFloats;
+
+ public List&lt;String&gt; getStrings() { return myStrings; }
+ public List&lt;Float&gt; getFloats() { return myFloats; }
+
+ public void addStrings(List&lt;String&gt; evenMoreStrings) {
+ myStrings.addAll(evenMoreStrings);
+ }
+
}
-
- public void doThis(T t) {
- doThat(t); // call-site A
- }
-
- public void doThat(T t) {
- return;
+ </pre><p>Then a <tt>get</tt> join point for the field <tt>myStrings</tt> can be matched by the
+ pointcut <tt>get(List Foo.myStrings)</tt> and by the pointcut <tt>get(List&lt;String&gt; Foo.myStrings)</tt>,
+ but <span class="emphasis"><i>not</i></span> by the pointcut <tt>get(List&lt;Number&gt; *)</tt>.</p><p>A <tt>get</tt> join point for the field <tt>myFloats</tt> can be matched by the
+ pointcut <tt>get(List Foo.myFloats)</tt>, the pointcut <tt>get(List&lt;Float&gt; *)</tt>,
+ and the pointcut <tt>get(List&lt;Number+&gt; *)</tt>. This last example shows how AspectJ type
+ patterns can be used to match type parameters types just like any other type. The pointcut
+ <tt>get(List&lt;Double&gt; *)</tt> does <span class="emphasis"><i>not</i></span> match.</p><p>The execution of the methods <tt>getStrings</tt> and <tt>getFloats</tt> can be
+ matched by the pointcut expression <tt>execution(List get*(..))</tt>, and the pointcut
+ expression <tt>execution(List&lt;*&gt; get*(..))</tt>, but only <tt>getStrings</tt>
+ is matched by <tt>execution(List&lt;String&gt; get*(..))</tt> and only <tt>getFloats</tt>
+ is matched by <tt>execution(List&lt;Number+&gt; get*(..))</tt></p><p>A call to the method <tt>addStrings</tt> can be matched by the pointcut expression
+ <tt>call(* addStrings(List))</tt> and by the expression <tt>call(* addStrings(List&lt;String&gt;))</tt>,
+ but <span class="emphasis"><i>not</i></span> by the expression <tt>call(* addStrings(List&lt;Number&gt;))</tt>.
+ </p><p>Remember that any type variable reference in a generic member is
+ <span class="emphasis"><i>always</i></span> matched by its erasure. Thus given the following
+ example:</p><pre class="programlisting">
+ class G&lt;T&gt; {
+
+ List&lt;T&gt; foo(List&lt;String ls) { return null; }
+
}
+ </pre><p>The execution of <tt>foo</tt> can be matched by
+ <tt>execution(List foo(List))</tt>,
+ <tt>execution(List foo(List&lt;String&gt;&gt;))</tt>, and
+ <tt>execution(* foo(List&lt;String&lt;))</tt>but
+ <span class="emphasis"><i>not</i></span> by <tt>execution(List&lt;Object&gt; foo(List&lt;String&gt;&gt;)</tt>
+ since the erasure of <tt>List&lt;T&gt;</tt> is <tt>List</tt>
+ and not <tt>List&lt;Object&gt;</tt>.
+ </p></div><div class="sect3"><a name="d0e2348"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2348"></a>Generic wildcards and signature matching</h4></div></div><p>
+ When it comes to signature matching, a type parameterized using a generic wildcard is a distinct type.
+ For example, <tt>List&lt;?&gt;</tt> is a very different type to <tt>List&lt;String&gt;</tt>,
+ even though a variable of type <tt>List&lt;String&gt;</tt> can be assigned to a variable of
+ type <tt>List&lt;?&gt;</tt>. Given the methods:
+ </p><pre class="programlisting">
+ class C {
+
+ public void foo(List&lt;? extends Number&gt; listOfSomeNumberType) {}
- }
-
- public class Main {
- public static void main(String[] args) {
- Foo&lt;String&gt; foos = new Foo&lt;String&gt;();
- foos.doThis("b"); //call-site B
- foos.doThat("c"); // call-site C
- foos.timeFor = "a cuppa"; // set-site B
+ public void bar(List&lt;?&gt; listOfSomeType) {}
+
+ public void goo(List&lt;Double&gt; listOfDoubles) {}
+
}
- }
- </pre><p>
- We have annotated the three method call sites as call-site A, call-site B, and call-site C.
- Call-site A is situated within the generic type <tt>Foo&lt;T&gt;</tt> and the call
- join point has signature <tt>public void Foo&lt;T&gt;doThat(T)</tt>. The join point
- arising from call-site B is a client-side call join point and has the signatures
- <tt>public void Foo&lt;String&gt;doThis(String)</tt> (from the static type of
- <tt>foos</tt>) <span class="emphasis"><i>and</i></span>
- <tt>public void Foo&lt;T&gt;doThis(T)</tt>. Likewise the call join point arising from
- call-site C has the signatures
- <tt>public void Foo&lt;String&gt;doThat(String)</tt> (from the static type of
- <tt>foos</tt>) <span class="emphasis"><i>and</i></span>
- <tt>public void Foo&lt;T&gt;doThat(T)</tt>. A call pointcut expression matches if the
- signature pattern exactly matches one of the signatures of the call join point.
- </p><p>
- The signatures for get and set join points works in a similar fashion. At set-site A in the above
- example, the set join point has signature <tt>public T Foo&lt;T&gt;.timeFor</tt>. At
- set-site B the set join point has signatures <tt>public T Foo&lt;T&gt;.timeFor</tt> and
- <tt>public String Foo&lt;String&gt;.timeFor</tt>. A get or set pointcut expression
- matches if the signature pattern exactly matches one of the signatures of the join point.
- </p>
+ </pre><div class="variablelist"><dl><dt><a name="d0e2369"></a><span class="term">execution(* C.*(List))</span></dt><dd><p><a name="d0e2372"></a>Matches an execution join point for any of the three methods.
+ </p></dd><dt><a name="d0e2375"></a><span class="term">execution(* C.*(List&lt;? extends Number&gt;))</span></dt><dd><p><a name="d0e2378"></a>matches only the
+ execution of <tt>foo</tt>, and <span class="emphasis"><i>not</i></span> the execution
+ of <tt>goo</tt> since <tt>List&lt;? extends Number&gt;</tt> and
+ <tt>List&lt;Double&gt;</tt> are distinct types.
+ </p></dd><dt><a name="d0e2396"></a><span class="term">execution(* C.*(List&lt;?&gt;))</span></dt><dd><p><a name="d0e2399"></a>matches only the execution of <tt>bar</tt>.
+ </p></dd><dt><a name="d0e2405"></a><span class="term">execution(* C.*(List&lt;? extends Object+&gt;))</span></dt><dd><p><a name="d0e2408"></a>matches both the execution of <tt>foo</tt> and the execution of <tt>bar</tt>
+ since the upper bound of <tt>List&lt;?&gt;</tt> is implicitly <tt>Object</tt>.
+ </p></dd></dl></div></div><div class="sect3"><a name="d0e2423"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2423"></a>Treatment of bridge methods</h4></div></div><p>Under certain circumstances a Java 5 compiler is required to create <span class="emphasis"><i>bridge
+ methods</i></span> that support the compilation of programs using raw types. Consider the types</p><pre class="programlisting">
+ class Generic&lt;T&gt; {
+
+ public T foo(T someObject) {
+ return someObject;
+ }
+
+ }
+
+ class SubGeneric&lt;N extends Number&gt; extends Generic&lt;N&gt; {
+
+ public N foo(N someNumber) {
+ return someNumber;
+ }
+
+ }
+ </pre><p>The class <tt>SubGeneric</tt> extends <tt>Generic</tt>
+ and overrides the method <tt>foo</tt>. Since the upper bound of the type variable
+ <tt>N</tt> in <tt>SubGeneric</tt> is different to the upper bound of
+ the type variable <tt>T</tt> in <tt>Generic</tt>, the method <tt>foo</tt>
+ in <tt>SubGeneric</tt> has a different erasure to the method <tt>foo</tt>
+ in <tt>Generic</tt>. This is an example of a case where a Java 5 compiler will create
+ a <span class="emphasis"><i>bridge method</i></span> in <tt>SubGeneric</tt>. Although you never see it,
+ the bridge method will look something like this:</p><pre class="programlisting">
+ public Object foo(Object arg) {
+ Number n = (Number) arg; // "bridge" to the signature defined in this type
+ return foo(n);
+ }
+ </pre><p>Bridge methods are synthetic artefacts generated as a result of a particular compilation strategy and
+ have no execution join points in AspectJ 5. So the pointcut <tt>execution(Object SubGeneric.foo(Object))</tt>
+ does not match anything. (The pointcut <tt>execution(Object Generic.foo(Object))</tt> matches the
+ execution of <tt>foo</tt> in both <tt>Generic</tt> and <tt>SubGeneric</tt> since
+ both are implementations of <tt>Generic.foo</tt>).
+ </p><p>It <span class="emphasis"><i>is</i></span> possible to <span class="emphasis"><i>call</i></span> a bridge method as the following short
+ code snippet demonstrates. Such a call <span class="emphasis"><i>does</i></span> result in a call join point for the call to
+ the method.
+ </p><pre class="programlisting">
+ SubGeneric rawType = new SubGeneric();
+ rawType.foo("hi"); // call to bridge method (will result in a runtime failure in this case)
+ Object n = new Integer(5);
+ rawType.foo(n); // call to bridge method that would succeed at runtime
+ </pre></div><div class="sect3"><a name="d0e2510"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2510"></a>Runtime type matching with this(), target() and args()</h4></div></div><p>The <tt>this()</tt>, <tt>target()</tt>, and
+ <tt>args()</tt> pointcut expressions all match based on the runtime
+ type of their arguments. Because Java 5 implements generics using erasure, it is not
+ possible to ask at runtime whether an object is an instance of a given parameterization of a type
+ (only whether or not it is an instance of the erasure of that parameterized type). Therefore
+ AspectJ 5 does not support the use of parameterized types with the <tt>this()</tt> and
+ <tt>target()</tt> pointcuts. Parameterized types may however be used in conjunction with
+ <tt>args()</tt>. Consider the following class
+ </p><pre class="programlisting">
+ public class C {
+
+ public void foo(List&lt;String&gt; listOfStrings) {}
+
+ public void bar(List&lt;Double&gt; listOfDoubles) {}
+
+ public void goo(List&lt;? extends Number&gt; listOfSomeNumberType) {}
- Some examples follow:
+ }
+ </pre><div class="variablelist"><dl><dt><a name="d0e2537"></a><span class="term">args(List)</span></dt><dd><p><a name="d0e2540"></a>will match an execution or call join point for any of
+ these methods
+ </p></dd><dt><a name="d0e2543"></a><span class="term">args(List&lt;String&gt;)</span></dt><dd><p><a name="d0e2546"></a>will match an execution
+ or call join point for <tt>foo</tt>.
+ </p></dd><dt><a name="d0e2552"></a><span class="term">args(List&lt;Double&gt;)</span></dt><dd><p><a name="d0e2555"></a>matches an execution or call join point for <tt>bar</tt>, and <span class="emphasis"><i>may</i></span> match
+ at an execution or call join point for <tt>goo</tt> since it is legitimate to pass an
+ object of type <tt>List&lt;Double&gt;</tt> to a method expecting a <tt>List&lt;? extends Number&gt;</tt>.
+ </p><p>
+ In this situation a runtime test would normally be applied to ascertain whether or not the argument
+ was indeed an instance of the required type. However, in the case of parameterized types such a test is not
+ possible and therefore AspectJ 5 considers this a match, but issues an <span class="emphasis"><i>unchecked</i></span> warning.
+ For example, compiling the aspect <tt>A</tt> below with the class <tt>C</tt> produces the
+ compilation warning: "unchecked match of List&lt;Double&gt; with List&lt;? extends Number&gt; when argument is
+ an instance of List at join point method-execution(void C.goo(List&lt;? extends Number&gt;)) [Xlint:uncheckedArgument]";
+ </p></dd></dl></div><pre class="programlisting">
+ public aspect A {
- <div class="variablelist"><dl><dt><a name="d0e2811"></a><span class="term">call(* List&lt;?&gt;.*(..))</span></dt><dd><p><a name="d0e2814"></a>matches a call to any method of a <tt>List&lt;?&gt;</tt> (a call where the
- target is declared to be a <tt>List&lt;?&gt;</tt>). For example:
+ before(List&lt;Double&gt; listOfDoubles) : execution(* C.*(..)) &amp;&amp; args(listOfDoubles) {
+ for (Double d : listOfDoubles) {
+ // do something
+ }
+ }
+
+ }
+ </pre><p>Like all Lint messages, the <tt>uncheckedArgument</tt> warning can be
+ configured in severity from the default warning level to error or even ignore if preferred.
+ In addition, AspectJ 5 offers the annotation <tt>@SuppressAjWarnings</tt> which is
+ the AspectJ equivalent of Java's <tt>@SuppressWarnings</tt> annotation. If the
+ advice is annotated with <tt>@SuppressWarnings</tt> then <span class="emphasis"><i>all</i></span>
+ lint warnings issued during matching of pointcut associated with the advice will be
+ suppressed. To suppress just an <tt>uncheckedArgument</tt> warning, use the
+ annotation <tt>@SuppressWarnings("uncheckedArgument")</tt> as in the following
+ examples:
</p><pre class="programlisting">
- int countItems(List&lt;?&gt; anyList) {
- return anyList.size(); // matched by call(* List&lt;?&gt;.*(..))
- }
- </pre></dd><dt><a name="d0e2825"></a><span class="term">call&lt;T&gt;(* List&lt;T&gt;.*(..))</span></dt><dd><p><a name="d0e2828"></a>matches any call to an operation defined in the generic type
- <tt>List&lt;E&gt;</tt>. This includes calls made to <tt>List&lt;String&gt;</tt>,
- <tt>List&lt;Number&gt;</tt>, <tt>List&lt;? super Foo&gt;</tt> and so on.
- </p></dd><dt><a name="d0e2843"></a><span class="term">get&lt;T&gt;(T *&lt;T extends Account&gt;.*)</span></dt><dd><p><a name="d0e2846"></a>matches the get of any field defined in a generic type with one type parameter that has
- an upper bound of <tt>Account</tt>. The field has the type of the type parameter, and
- can be of any name. This pointcut expression matches both gets of the field within the
- declaring type, and also gets on parameterized instances of the type.
- </p></dd><dt><a name="d0e2852"></a><span class="term">set(Account Foo&lt;Account&gt;.*Account)</span></dt><dd><p><a name="d0e2855"></a>matches the set of a field of type <tt>Account</tt> where the target
- is of type <tt>Foo&lt;Account&gt;</tt> and the field name ends with "Account". Does not
- match sets of any "*Account" field occurring within the <tt>Foo</tt> type itself.
- </p></dd><dt><a name="d0e2867"></a><span class="term">call(* List&lt;? extends Number&gt;.add(..))</span></dt><dd><p><a name="d0e2870"></a>matches any call to add an element to a list of type <tt>List&lt;? extends Number&gt;</tt>.
- Does not match calls to add elements to lists of type <tt>List&lt;Number&gt;</tt> or
- <tt>List&lt;Double&gt;</tt> as these are distinct types.
- </p></dd><dt><a name="d0e2882"></a><span class="term">call(* List&lt;Number+&gt;.add(..))</span></dt><dd><p><a name="d0e2885"></a>matches any call to add an element to a list of type <tt> Number</tt> or
- any subclass of <tt>Number</tt>. For example, <tt>List&lt;Number&gt;,
- List&lt;Double&gt; List&lt;Float&gt;</tt>.
- Does not match calls to add elements to lists of type <tt>List&lt;? extends Number&gt;</tt>
- as this is a distinct type.
- </p></dd></dl></div></div><div class="sect3"><a name="d0e2900"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2900"></a>Handler</h4></div></div><p>
- The Java Language Specification states that a generic class may not be a direct or indirect
- subclass of <tt>Throwable</tt>. Therefore it is a compilation error to use a generic
- or parameterized type pattern in a <tt>handler</tt> pointcut expression.
- </p></div><div class="sect3"><a name="d0e2911"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2911"></a>Runtime type matching: this, target and args</h4></div></div><p>
- Java 5 generics are implemented using a technique known an <span class="emphasis"><i>erasure</i></span>.
- In particular, what gets "erased" is the ability to find out the parameterized runtime type
- of an instance of a generic type. You can ask if something is an <tt>instanceof List</tt>,
- but not if something is an <tt>instanceof List&lt;String&gt;</tt>
- </p><p>
- The <tt>this, target</tt> and <tt>args</tt> pointcut designators all match
- based on the runtime type of the appropriate object (this, target, or argument) at a join point.
- To match any parameterization of a generic type, simply use the raw type (type variables are
- not permitted with these designators). For example:
- </p><div class="variablelist"><dl><dt><a name="d0e2934"></a><span class="term">target(List)</span></dt><dd><p><a name="d0e2937"></a>matches any call to an instance of <tt>List</tt> (including
- <tt>List&lt;String&gt;, List&lt;Number&gt;</tt>, and so on.
- </p></dd><dt><a name="d0e2946"></a><span class="term">args (List)</span></dt><dd><p><a name="d0e2949"></a>matches any join point with a single argument that is an instance of
- <tt>List</tt>.
- </p></dd></dl></div><p>
- To match specific parameterizations of a generic type, simply use the type that you require
- the relevant object to be an instance of inside the pointcut expression. For example:
- <tt>target(List&lt;String&gt;)</tt>.
- </p><p>
- Recall that runtime tests to determine whether an object is an instance of a parameterized
- type are not possible due to erasure. Therefore AspectJ matching behaviour with
- parameterized types for <tt>this, target</tt> and <tt>args</tt> is as follows.
- </p><table class="simplelist" border="0" summary="Simple list"><tr><td>If it can be statically determined that a given object will always be an instance
- of the required type, then the pointcut expressions matches. For example, given a variable
- <tt>bankAccounts</tt>
- of type <tt>Set&lt;BankAccount&gt;</tt> and the pointcut expression
- <tt>target(Set&lt;BankAccount&gt;)</tt> then any call made to
- <tt>bankAccounts</tt> will be matched.</td></tr><tr><td>If it can be statically determined that a given object can never be an
- instance of the required type, then the pointcut expression does not match. The
- expression <tt>target(List&lt;String&gt;)</tt>will never match a call made
- using a variable of type <tt>List&lt;Number&gt;</tt> (it is not possible for
- a type to implement two different parameterizations of the same interface).</td></tr><tr><td>If an object <span class="emphasis"><i>might</i></span> be an instance of the required
- type in some circumstances but not in others, then since it is not possible to perform
- the runtime test, AspectJ deems the pointcut expression to match, but issues an
- unchecked warning. This is analogous to the behaviour of the Java compiler when
- converting between raw and parameterized types. Given a variable of type
- <tt>List&lt;? extends Number&gt;</tt> and a call join point with
- target pointcut expression <tt>target(List&lt;Double&gt;)</tt> then
- the expression matches but with an unchecked warning. The warning can be suppressed
- by annotating the associated advice with either <tt>@SuppressAjWarnings</tt>
- or <tt>@SuppressAjWarnings("unchecked")</tt>.</td></tr></table><p>
- When using a parameterized type with the
- <tt>this</tt> pointcut designator then a joinpoint is unambiguously
- matched if and only if one or more of the following conditions hold:
- </p><table class="simplelist" border="0" summary="Simple list"><tr><td>the runtime type of the <tt>this</tt> object extends or
- implements the parameterized type. For example,
- <tt>class Foo implements List&lt;String&gt;</tt> will match
- <tt>this(List&lt;String&gt;)</tt>.</td></tr><tr><td>
- The parameterized "this" type is given using a generics wildcard in the pointcut
- expression, and the bounds of
- the generic runtime type of <tt>this</tt> are such that all valid parameterizations
- are matched by the wildcard. For example, the pointcut expression
- <tt>this(List&lt;? extends Number&gt;)</tt> will match a <tt>this</tt>
- object of type <tt>class Foo&lt;N extends Number&gt; implements List&lt;N&gt;</tt>,
- but not an object of type <tt>class Foo&lt;N&gt; implements List&lt;N&gt;</tt>.
- </td></tr></table><p>
- You've already seen some examples of using the generic wildcard <tt>?</tt>
- in parameterized type patterns. Since <tt>this, target</tt> and
- <tt>args</tt> match using an instance of test, the generic wildcard can be useful in
- specifying an acceptable range of parameterized types to match. When used in the binding
- form, the same restrictions on operations permitted on the bound variable apply as when a
- method declares a parameter with a wildcard type. For example, in the advice below, it is
- a compilation error to attemp to add an element into the list <tt>aList</tt>.
- </p><pre class="programlisting">
- before(List&lt;? extends Number&gt; aList) :
- execution(* org.xyz.Foo.*(..)) &amp;&amp; args(aList) {
- aList.add(new Double(5.0d)); // Compilation error on this line
- }
- </pre></div><div class="sect3"><a name="d0e3058"></a><div class="titlepage"><div><h4 class="title"><a name="d0e3058"></a>Declaring pointcuts in generic classes</h4></div></div><p>
- AspectJ permits pointcuts to be declared in classes as well as aspects. A pointcut defined
- inside a generic class may not use the type variables of the class in the pointcut expression
- (just as static members of a generic class may not use type variables).
- For example:
- </p><pre class="programlisting">
- public class Foo&lt;T extends Number&gt; {
-
- ...
-
- // Not allowed - uses T in the pointcut expression
- public pointcut fooOperationCall(T t) :
- call(* Foo&lt;T&gt;.*(T)) &amp;&amp; args(t);
-
+ import org.aspectj.lang.annotation.SuppressAjWarnings
+ public aspect A {
+
+ @SuppressAjWarnings // will not see *any* lint warnings for this advice
+ before(List&lt;Double&gt; listOfDoubles) : execution(* C.*(..)) &amp;&amp; args(listOfDoubles) {
+ for (Double d : listOfDoubles) {
+ // do something
+ }
+ }
- // permitted, but recommended to use an alternate variable name in the local
- // type variable declaration - e.g. execution&lt;S&gt;(...)
- public pointcut fooExecution(Number n) :
- execution&lt;T&gt;(* Foo&lt;T&gt;.*(T)) &amp;&amp; args(n);
- }
- </pre></div></div><div class="sect2"><a name="d0e3065"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3065"></a>Inter-type Declarations</h3></div></div><p>
- AspectJ 5 allows type parameters to be used in inter-type declarations - either for declaring generic
- methods and constructors, or for declaring members on generic types. The syntax for declaring generic
- methods and constructors follows the regular AspectJ convention of simply qualifying the member name with
- the target type.
- </p><div class="variablelist"><dl><dt><a name="d0e3071"></a><span class="term">&lt;T extends Number&gt; T Utils.max(T first, T second) {...}</span></dt><dd><p><a name="d0e3074"></a>Declares a generic instance method <tt>max</tt> on the class <tt>Util</tt>.
+ @SuppressAjWarnings("uncheckedArgument") // will not see *any* lint warnings for this advice
+ before(List&lt;Double&gt; listOfDoubles) : execution(* C.*(..)) &amp;&amp; args(listOfDoubles) {
+ for (Double d : listOfDoubles) {
+ // do something
+ }
+ }
+
+ }
+ </pre><p>
+ The safest way to deal with <tt>uncheckedArgument</tt> warnings however is to restrict the pointcut
+ to match only at those join points where the argument is guaranteed to match. This is achieved by combining
+ <tt>args</tt> with a <tt>call</tt> or <tt>execution</tt> signature matching
+ pointcut. In the following example the advice will match the execution of <tt>bar</tt> but not
+ of <tt>goo</tt> since the signature of <tt>goo</tt> is not matched by the execution pointcut
+ expression.
+ </p><pre class="programlisting">
+ public aspect A {
+
+ before(List&lt;Double&gt; listOfDoubles) : execution(* C.*(List&lt;Double&gt;)) &amp;&amp; args(listOfDoubles) {
+ for (Double d : listOfDoubles) {
+ // do something
+ }
+ }
+
+ }
+ </pre><p>Generic wildcards can be used in args type patterns, and matching follows regular Java 5 assignability rules. For
+ example, <tt>args(List&lt;?&gt;)</tt> will match a list argument of any type, and
+ <tt>args(List&lt;? extends Number&gt;)</tt> will match an argument of type
+ <tt>List&lt;Number&gt;, List&lt;Double&gt;, List&lt;Float&gt;</tt> and so on. Where a match cannot be
+ fully statically determined, the compiler will once more issue an <tt>uncheckedArgument</tt> warning.
+ </p><p>Consider the following program:</p><pre class="programlisting">
+ public class C {
+
+ public static void main(String[] args) {
+ C c = new C();
+ List&lt;String&gt; ls = new ArrayList&lt;String&gt;();
+ List&lt;Double&gt; ld = new ArrayList&lt;Double&gt;();
+ c.foo("hi");
+ c.foo(ls);
+ c.foo(ld);
+ }
+
+ public void foo(Object anObject) {}
+ }
+
+ aspect A {
+ before(List&lt;? extends Number&gt; aListOfSomeNumberType)
+ : call(* foo(..)) &amp;&amp; args(aListOfSomeNumberType) {
+ // process list...
+ }
+ }
+ </pre><p>From the signature of <tt>foo</tt> all we know is that the runtime argument will be an instance of
+ <tt>Object</tt>.Compiling this program gives the unchecked argument warning:
+ "unchecked match of List&lt;? extends Number&gt; with List when argument is
+ an instance of List at join point method-execution(void C.foo(Object)) [Xlint:uncheckedArgument]".
+ The advice will not execute at the call join point for <tt>c.foo("hi")</tt> since <tt>String</tt>
+ is not an instance of <tt>List</tt>. The advice <span class="emphasis"><i>will</i></span> execute at the call join points
+ for <tt>c.foo(ls)</tt> and <tt>c.foo(ld)</tt> since in both cases the argument is an instance of
+ <tt>List</tt>.
+ </p><p>Combine a wildcard argument type with a signature pattern to avoid unchecked argument matches. In the example
+ below we use the signature pattern <tt>List&lt;Number+&gt;</tt> to match a call to any method taking
+ a <tt>List&lt;Number&gt;, List&lt;Double&gt;, List&lt;Float&gt;</tt> and so on. In addition the
+ signature pattern <tt>List&lt;? extends Number+&gt;</tt> can be used to match a call to a method
+ declared to take a <tt>List&lt;? extends Number&gt;</tt>, <tt>List&lt;? extends Double&gt;</tt>
+ and so on. Taken together, these restrict matching to only
+ those join points at which the argument is guaranteed to be an instance of <tt>List&lt;? extends Number&gt;</tt>.</p><pre class="programlisting">
+ aspect A {
+ before(List&lt;? extends Number&gt; aListOfSomeNumberType)
+ : (call(* foo(List&lt;Number+&gt;)) || call(* foo(List&lt;? extends Number+&gt;)))
+ &amp;&amp; args(aListOfSomeNumberType) {
+ // process list...
+ }
+ }
+ </pre></div><div class="sect3"><a name="d0e2706"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2706"></a>Binding return values in after returning advice</h4></div></div><p>
+ After returning advice can be used to bind the return value from a matched join point. AspectJ 5 supports the use of
+ a parameterized type in the returning clause, with matching following the same rules as described for args. For
+ example, the following aspect matches the execution of any method returning a <tt>List</tt>, and makes
+ the returned list available to the body of the advice.
+ </p><pre class="programlisting">
+ public aspect A {
+
+ pointcut executionOfAnyMethodReturningAList() : execution(List *(..));
+
+ after() returning(List&lt;?&gt; listOfSomeType) : executionOfAnyMethodReturningAList() {
+ for (Object element : listOfSomeType) {
+ // process element...
+ }
+ }
+
+ }
+ </pre><p>The pointcut uses the raw type pattern <tt>List</tt>, and hence it
+ matches methods returning any kind of list (<tt>List&lt;String&gt;, List&lt;Double&gt;</tt>,
+ and so on. We've chosen to bind the returned list as the parameterized type
+ <tt>List&lt;?&gt;</tt> in the advice since Java's type checking will now ensure
+ that we only perform safe operations on the list.</p><p>Given the class</p><pre class="programlisting">
+ public class C {
+
+ public List&lt;String&gt; foo(List&lt;String&gt; listOfStrings) {...}
+
+ public List&lt;Double&gt; bar(List&lt;Double&gt; listOfDoubles) {...}
+
+ public List&lt;? extends Number&gt; goo(List&lt;? extends Number&gt; listOfSomeNumberType) {...}
+
+ }
+ </pre><p>The advice in the aspect below will run after the execution of <tt>bar</tt>
+ and bind the return value. It will also run after the execution of <tt>goo</tt> and
+ bind the return value, but gives an <tt>uncheckedArgument</tt> warning during
+ compilation. It does <span class="emphasis"><i>not</i></span> run after the execution of <tt>foo</tt>.
+ </p><pre class="programlisting">
+ public aspect Returning {
+
+ after() returning(List&lt;Double&gt; listOfDoubles) : execution(* C.*(..)) {
+ for(Double d : listOfDoubles) {
+ // process double...
+ }
+ }
+
+ }
+ </pre><p>As with <tt>args</tt> you can guarantee that after returning advice only
+ executes on lists <span class="emphasis"><i>statically determinable</i></span> to be of the right
+ type by specifying a return type pattern in the associated pointcut. The
+ <tt>@SuppressAjWarnings</tt> annotation can also be used if desired.</p></div><div class="sect3"><a name="d0e2762"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2762"></a>Declaring pointcuts inside generic types</h4></div></div><p><span class="emphasis"><i>This language feature will not be supported until AspectJ 5 M4.</i></span></p><p>Pointcuts can be declared in both classes and aspects. A pointcut declared in a generic
+ type may use the type variables of the type in which it is declared. All references to
+ a pointcut declared in a generic type from outside of that type must be via a parameterized type reference,
+ and not a raw type reference.</p><p>Consider the generic type <tt>Generic</tt> with a pointcut <tt>foo</tt>:
+ </p><pre class="programlisting">
+ public class Generic&lt;T&gt; {
+
+ /**
+ * matches the execution of any implementation of a method defined for T
+ */
+ public pointcut foo() : execution(* T.*(..));
+
+ }
+ </pre><p>Such a pointcut must be refered to using a parameterized reference as shown
+ below.</p><pre class="programlisting">
+ public aspect A {
+
+ // runs before the execution of any implementation of a method defined for MyClass
+ before() : Generic&lt;MyClass&gt;.foo() {
+ // ...
+ }
+
+ // runs before the execution of any implementation of a method defined for YourClass
+ before() : Generic&lt;YourClass&gt;.foo() {
+ // ...
+ }
+
+ // results in a compilation error - raw type reference
+ before() : Generic.foo() { }
+
+ }
+ </pre></div></div><div class="sect2"><a name="d0e2785"></a><div class="titlepage"><div><h3 class="title"><a name="d0e2785"></a>Inter-type Declarations</h3></div></div><p>
+ AspectJ 5 supports the inter-type declaration of generic methods, and of members on
+ generic types. For generic methods, the syntax is exactly as for a regular method
+ declaration, with the addition of the target type specification:
+ </p><div class="variablelist"><dl><dt><a name="d0e2791"></a><span class="term">&lt;T extends Number&gt; T Utils.max(T first, T second) {...}</span></dt><dd><p><a name="d0e2794"></a>Declares a generic instance method <tt>max</tt> on the class <tt>Util</tt>.
The <tt>max</tt> method takes two arguments, <tt>first</tt> and <tt>second</tt> which must
both be of the same type (and that type must be Number or a subtype of Number) and returns an instance
of that type.
- </p></dd><dt><a name="d0e3092"></a><span class="term">static &lt;E&gt; E Utils.first(List&lt;E&gt; elements) {...}</span></dt><dd><p><a name="d0e3095"></a>Declares a static generic method <tt>first</tt> on the class <tt>Util</tt>.
+ </p></dd><dt><a name="d0e2812"></a><span class="term">static &lt;E&gt; E Utils.first(List&lt;E&gt; elements) {...}</span></dt><dd><p><a name="d0e2815"></a>Declares a static generic method <tt>first</tt> on the class <tt>Util</tt>.
The <tt>first</tt> method takes a list of elements of some type, and returns an instance
of that type.
- </p></dd><dt><a name="d0e3107"></a><span class="term">&lt;T&gt; Sorter.new(List&lt;T&gt; elements,Comparator&lt;? super T&gt; comparator) {...}</span></dt><dd><p><a name="d0e3110"></a>Declares a constructor on the class <tt>Sorter</tt>.
+ </p></dd><dt><a name="d0e2827"></a><span class="term">&lt;T&gt; Sorter.new(List&lt;T&gt; elements,Comparator&lt;? super T&gt; comparator) {...}</span></dt><dd><p><a name="d0e2830"></a>Declares a constructor on the class <tt>Sorter</tt>.
The constructor takes a list of elements of some type, and a comparator that can compare instances
of the element type.
</p></dd></dl></div><p>
@@ -460,63 +390,30 @@
must match the number of type parameters in
the generic type declaration. Type parameter <span class="emphasis"><i>names</i></span> do not have to match.
For example, given the generic type <tt>Foo&lt;T,S extends Number&gt;</tt> then:
- </p><div class="variablelist"><dl><dt><a name="d0e3125"></a><span class="term">String Foo.getName() {...}</span></dt><dd><p><a name="d0e3128"></a>Declares a <tt>getName</tt> method on behalf of the raw type <tt>Foo</tt>. It is
+ </p><div class="variablelist"><dl><dt><a name="d0e2845"></a><span class="term">String Foo.getName() {...}</span></dt><dd><p><a name="d0e2848"></a>Declares a <tt>getName</tt> method on behalf of the type <tt>Foo</tt>. It is
not possible to refer to the type parameters of Foo in such a declaration.
- </p></dd><dt><a name="d0e3137"></a><span class="term">R Foo&lt;Q, R&gt;.getMagnitude() {...}</span></dt><dd><p><a name="d0e3140"></a>Declares a method <tt>getMagnitude</tt> on the generic class <tt>Foo</tt>.
+ </p></dd><dt><a name="d0e2857"></a><span class="term">public R Foo&lt;Q, R&gt;.getMagnitude() {...}</span></dt><dd><p><a name="d0e2860"></a>Declares a method <tt>getMagnitude</tt> on the generic class <tt>Foo</tt>.
The method returns an instance of the type substituted for the second type parameter in an invocation
- of <tt>Foo</tt>.
- </p></dd><dt><a name="d0e3152"></a><span class="term">R Foo&lt;Q, R extends Number&gt;.getMagnitude() {...}</span></dt><dd><p><a name="d0e3155"></a>Results in a compilation error since a bounds specification is not allowed in this
+ of <tt>Foo</tt> If <tt>Foo</tt> is declared as
+ <tt>Foo&lt;T,N extends Number&gt; {...}</tt> then this inter-type declaration is
+ equivalent to the declaration of a method <tt>public N getMagnitude()</tt>
+ within the body of <tt>Foo</tt>.
+ </p></dd><dt><a name="d0e2884"></a><span class="term">R Foo&lt;Q, R extends Number&gt;.getMagnitude() {...}</span></dt><dd><p><a name="d0e2887"></a>Results in a compilation error since a bounds specification is not allowed in this
form of an inter-type declaration (the bounds are determined from the declaration of the
target type).
</p></dd></dl></div><p>A parameterized type may not be the target of an inter-type declaration. This is because
there is only one type (the generic type) regardless of how many different invocations (parameterizations) of
that generic type are made in a program. Therefore it does not make sense to try and declare a member
- on behalf of (say) <tt>Foo&lt;String&gt;</tt>, you can only declare members on the generic
- type <tt>Foo&lt;T&gt;</tt>.
- </p><p>
- If an inter-type member is declared inside a generic aspect, then the type parameter names from the
- aspect declaration may be used in the signature specification of the inter-type declaration, but
- <span class="emphasis"><i>not</i></span> as type parameter names for a generic target type. In other words the example
- that follows is legal:
- </p><pre class="programlisting">
- public abstract aspect A&lt;T&gt; {
-
- private T Foo.data;
-
- public T Foo.getData(T defaultValue) {
- return (this.data != null ? data : defaultValue);
- }
-
- }
- </pre><p>
- Whereas the following example is not allowed and will report an error that a parameterized type may not be the
- target of an inter-type declaration (since when the type parameter <tt>T</tt> in the aspect is subsituted with
- say, <tt>String</tt>, then the target of the inter-type declaration becomes <tt>Goo&lt;String&gt;</tt>).
- </p><pre class="programlisting">
- public abstract aspect A&lt;T&gt; {
-
- private T Goo&lt;T&gt;.data;
-
- public T Goo&lt;T&gt;.getData(T defaultValue) {
- return (this.data != null ? data : defaultValue);
- }
-
- }
- </pre></div><div class="sect2"><a name="d0e3186"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3186"></a>Declare Parents</h3></div></div><p>Both generic and parameterized types can be used as the parent type in a <tt>declare parents</tt>
+ on behalf of (say) <tt>Bar&lt;String&gt;</tt>, you can only declare members on the generic
+ type <tt>Bar&lt;T&gt;</tt>.
+ </p></div><div class="sect2"><a name="d0e2898"></a><div class="titlepage"><div><h3 class="title"><a name="d0e2898"></a>Declare Parents</h3></div></div><p>Both generic and parameterized types can be used as the parent type in a <tt>declare parents</tt>
statement (as long as the resulting type hierarchy would be well-formed in accordance with Java's sub-typing
- rules). Generic types may also be used as the target type of a <tt>declare parents</tt> statement:
- a type variable list follows the <tt>parents</tt> keyword in these cases to declare the
- type variables in scope.
- Some examples follow:</p><div class="variablelist"><dl><dt><a name="d0e3201"></a><span class="term">declare parents: Foo implements List&lt;String&gt;</span></dt><dd><p><a name="d0e3204"></a>The <tt>Foo</tt> type implements the <tt>List&lt;String&gt;</tt> interface. If
+ rules). Generic types may also be used as the target type of a <tt>declare parents</tt> statement.</p><div class="variablelist"><dl><dt><a name="d0e2910"></a><span class="term">declare parents: Foo implements List&lt;String&gt;</span></dt><dd><p><a name="d0e2913"></a>The <tt>Foo</tt> type implements the <tt>List&lt;String&gt;</tt> interface. If
<tt>Foo</tt> already implements some other parameterization of the <tt>List</tt>
interface (for example, <tt>List&lt;Integer&gt;</tt> then a compilation error will result since a
type cannot implement multiple parameterizations of the same generic interface type.
- </p></dd><dt><a name="d0e3222"></a><span class="term">declare parents &lt;T&gt;: org.xyz..*&lt;T&gt; extends Base&lt;T&gt;</span></dt><dd><p><a name="d0e3225"></a>All generic types declared in a package beginning with <tt>org.xyz</tt> and with a
- single unbounded type parameter, extend the generic type <tt>Base&lt;T&gt;</tt>.
- </p></dd><dt><a name="d0e3234"></a><span class="term">declare parents &lt;T&gt;: org.xyz..*&lt;T&gt; extends Base&lt;S&gt;</span></dt><dd><p><a name="d0e3237"></a>Results in a compilation error (unless <tt>S</tt> is a type) since <tt>S</tt> is
- not bound in the type pattern.
- </p></dd></dl></div></div><div class="sect2"><a name="d0e3246"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3246"></a>Declare Soft</h3></div></div><p>It is an error to use a generic or parameterized type as the softened exception type in a declare soft statement. Java 5 does
- not permit a generic class to be a direct or indirect subtype of <tt>Throwable</tt> (JLS 8.1.2).</p></div><div class="sect2"><a name="d0e3254"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3254"></a>Parameterized Aspects</h3></div></div><p>
+ </p></dd></dl></div></div><div class="sect2"><a name="d0e2931"></a><div class="titlepage"><div><h3 class="title"><a name="d0e2931"></a>Declare Soft</h3></div></div><p>It is an error to use a generic or parameterized type as the softened exception type in a declare soft statement. Java 5 does
+ not permit a generic class to be a direct or indirect subtype of <tt>Throwable</tt> (JLS 8.1.2).</p></div><div class="sect2"><a name="d0e2939"></a><div class="titlepage"><div><h3 class="title"><a name="d0e2939"></a>Generic Aspects</h3></div></div><p><span class="emphasis"><i>This feature will not be fully implemented until AspectJ5 M4.</i></span></p><p>
AspectJ 5 allows an <span class="emphasis"><i>abstract</i></span> aspect to be declared as a generic type. Any concrete
aspect extending a generic abstract aspect must extend a parameterized version of the abstract aspect.
Wildcards are not permitted in this parameterization.
@@ -524,81 +421,107 @@
public abstract aspect ParentChildRelationship&lt;P,C&gt; {
...
}
- </pre><p>then</p><div class="variablelist"><dl><dt><a name="d0e3269"></a><span class="term">public aspect FilesInFolders extends ParentChildRelationship&lt;Folder,File&gt; {...</span></dt><dd><p><a name="d0e3272"></a>declares a concrete sub-aspect, <tt>FilesInFolders</tt> which extends the
+ </pre><p>then</p><div class="variablelist"><dl><dt><a name="d0e2957"></a><span class="term">public aspect FilesInFolders extends ParentChildRelationship&lt;Folder,File&gt; {...</span></dt><dd><p><a name="d0e2960"></a>declares a concrete sub-aspect, <tt>FilesInFolders</tt> which extends the
parameterized abstract aspect <tt>ParentChildRelationship&lt;Folder,File&gt;</tt>.
- </p></dd><dt><a name="d0e3281"></a><span class="term">public aspect FilesInFolders extends ParentChildRelationship {...</span></dt><dd><p><a name="d0e3284"></a>results in a compilation error since the <tt>ParentChildRelationship</tt> aspect must
+ </p></dd><dt><a name="d0e2969"></a><span class="term">public aspect FilesInFolders extends ParentChildRelationship {...</span></dt><dd><p><a name="d0e2972"></a>results in a compilation error since the <tt>ParentChildRelationship</tt> aspect must
be fully parameterized.
- </p></dd><dt><a name="d0e3290"></a><span class="term">public aspect ThingsInFolders&lt;T&gt; extends ParentChildRelationship&lt;Folder,T&gt;</span></dt><dd><p><a name="d0e3293"></a>results in a compilation error since concrete aspects may not have type parameters.
- </p></dd><dt><a name="d0e3296"></a><span class="term">public abstract aspect ThingsInFolders&lt;T&gt; extends ParentChildRelationship&lt;Folder,T&gt;</span></dt><dd><p><a name="d0e3299"></a>declares a sub-aspect of <tt>ParentChildRelationship</tt> in which <tt>Folder</tt>
+ </p></dd><dt><a name="d0e2978"></a><span class="term">public aspect ThingsInFolders&lt;T&gt; extends ParentChildRelationship&lt;Folder,T&gt;</span></dt><dd><p><a name="d0e2981"></a>results in a compilation error since concrete aspects may not have type parameters.
+ </p></dd><dt><a name="d0e2984"></a><span class="term">public abstract aspect ThingsInFolders&lt;T&gt; extends ParentChildRelationship&lt;Folder,T&gt;</span></dt><dd><p><a name="d0e2987"></a>declares a sub-aspect of <tt>ParentChildRelationship</tt> in which <tt>Folder</tt>
plays the role of parent (is bound to the type variable <tt>P</tt>).
- </p></dd></dl></div><p>An exception to the rule that concrete aspects may not be generic is a pertypewithin aspect, which
- may be declared with a single unbounded type parameter. This is discussed in the chapter on <a href="pertypewithin.html">pertypewithin</a>.</p><p>The type parameter variables from a generic aspect declaration may be used in place of a type within any
- member of the aspect. For example, we can declare a <tt>ParentChildRelationship</tt> aspect to
+ </p></dd></dl></div><p>The type parameter variables from a generic aspect declaration may be used in place of a type within any
+ member of the aspect, <span class="emphasis"><i>except for within inter-type declarations</i></span>.
+ For example, we can declare a <tt>ParentChildRelationship</tt> aspect to
manage the bi-directional relationship between parent and child nodes as follows:
</p><pre class="programlisting">
- public abstract aspect ParentChildRelationship&lt;P,C&gt; {
-
- /**
- * Parents contain a list of children
- */
- private List&lt;C&gt; P.children;
-
- /**
- * Each child has a parent
- */
- private P C.parent;
+ /**
+ * a generic aspect, we've used descriptive role names for the type variables
+ * (Parent and Child) but you could use anything of course
+ */
+ public abstract aspect ParentChildRelationship&lt;Parent,Child&gt; {
- /**
- * Parents provide access to their children
- */
- public List&lt;C&gt; P.getChildren() {
- return Collections.unmodifiableList(children);
- }
-
- /**
- * A child provides access to its parent
- */
- public P C.getParent() {
- return parent;
+ /** generic interface implemented by parents */
+ interface ParentHasChildren&lt;C extends ChildHasParent&gt;{
+ List&lt;C&gt; getChildren();
+ void addChild(C child);
+ void removeChild(C child);
+ }
+
+ /** generic interface implemented by children */
+ interface ChildHasParent&lt;P extends ParentHasChildren&gt;{
+ P getParent();
+ void setParent(P parent);
+ }
+
+ /** ensure the parent type implements ParentHasChildren&lt;child type&gt; */
+ declare parents: Parent implements ParentHasChildren&lt;Child&gt;;
+
+ /** ensure the child type implements ChildHasParent&lt;parent type&gt; */
+ declare parents: Child implements ChildHasParent&lt;Parent&gt;;
+
+ // Inter-type declarations made on the *generic* interface types to provide
+ // default implementations.
+
+ /** list of children maintained by parent */
+ private List&lt;C&gt; ParentHasChildren&lt;C&gt;.children;
+
+ /** reference to parent maintained by child */
+ private P ChildHasParent&lt;P&gt;.parent;
+
+ /** Default implementation of getChildren for the generic type ParentHasChildren */
+ public List&lt;C&gt; ParentHasChildren&lt;C&gt;.getChildren() {
+ return Collections.unmodifiableList(children);
+ }
+
+ /** Default implementation of getParent for the generic type ChildHasParent */
+ public P ChildHasParent&lt;P&gt;.getParent() {
+ return parent;
+ }
+
+ /**
+ * Default implementation of addChild, ensures that parent of child is
+ * also updated.
+ */
+ public void ParentHasChildren&lt;C&gt;.addChild(C child) {
+ if (child.parent != null) {
+ child.parent.removeChild(child);
}
+ children.add(child);
+ child.parent = this;
+ }
+
+ /**
+ * Default implementation of removeChild, ensures that parent of
+ * child is also updated.
+ */
+ public void ParentHasChildren&lt;C&gt;.removeChild(C child) {
+ if (children.remove(child)) {
+ child.parent = null;
+ }
+ }
+
+ /**
+ * Default implementation of setParent for the generic type ChildHasParent.
+ * Ensures that this child is added to the children of the parent too.
+ */
+ public void ChildHasParent&lt;P&gt;.setParent(P parent) {
+ parent.addChild(this);
+ }
+
+ /**
+ * Matches at an addChild join point for the parent type P and child type C
+ */
+ public pointcut addingChild(Parent p, Child c) :
+ execution(* Parent.addChild(Child)) &amp;&amp; this(p) &amp;&amp; args(c);
- /**
- * ensure bi-directional navigation on adding a child
- */
- public void P.addChild(C child) {
- if (child.parent != null) {
- child.parent.removeChild(child);
- }
- children.add(child);
- child.parent = this;
- }
-
- /**
- * ensure bi-directional navigation on removing a child
- */
- public void P.removeChild(C child) {
- if (children.remove(child)) {
- child.parent = null;
- }
- }
+ /**
+ * Matches at a removeChild join point for the parent type P and child type C
+ */
+ public pointcut removingChild(Parent p, Child c) :
+ execution(* Parent.removeChild(C)) &amp;&amp; this(p) &amp;&amp; args(c);
- /**
- * ensure bi-directional navigation on setting parent
- */
- public void C.setParent(P parent) {
- parent.addChild(this);
- }
-
- public pointcut addingChild(P p, C c) :
- execution(* P.addChild(C)) &amp;&amp; this(p) &amp;&amp; args(c);
-
- public pointcut removingChild(P p, C c) :
- execution(* P.removeChild(C)) &amp;&amp; this(p) &amp;&amp; args(c);
- }
+ }
+
</pre><p>
- Note in the above example how the type parameters <tt>P</tt> and <tt>C</tt> can be
- used in inter-type declarations, pointcut expressions, and any other member of the aspect type.
- </p><p>
The example aspect captures the protocol for managing a bi-directional parent-child relationship between
any two types playing the role of parent and child. In a compiler implementation managing an abstract syntax
tree (AST) in which AST nodes may contain other AST nodes we could declare the concrete aspect:
@@ -613,54 +536,55 @@
</pre><p>
As a result of this declaration, <tt>ASTNode</tt> gains members:
</p><table class="simplelist" border="0" summary="Simple list"><tr><td><tt>List&lt;ASTNode&gt; children</tt></td></tr><tr><td><tt>ASTNode parent</tt></td></tr><tr><td><tt>List&lt;ASTNode&gt;getChildren()</tt></td></tr><tr><td><tt>ASTNode getParent()</tt></td></tr><tr><td><tt>void addChild(ASTNode child)</tt></td></tr><tr><td><tt>void removeChild(ASTNode child)</tt></td></tr><tr><td><tt>void setParent(ASTNode parent)</tt></td></tr></table><p>
- In a system managing files and folders, we could declare the concrete aspect:
+ In a system managing orders, we could declare the concrete aspect:
</p><pre class="programlisting">
- public aspect FilesInFolders extends ParentChildRelationship&lt;Folder,File&gt; {
+ public aspect OrderItemsInOrders extends ParentChildRelationship&lt;Order,OrderItem&gt; {
}
</pre><p>
- As a result of this declaration, <tt>Folder</tt> gains members:
- </p><table class="simplelist" border="0" summary="Simple list"><tr><td><tt>List&lt;File&gt; children</tt></td></tr><tr><td><tt>List&lt;File&gt; getChildren()</tt></td></tr><tr><td><tt>void addChild(File child)</tt></td></tr><tr><td><tt>void removeChild(File child)</tt></td></tr></table><p>and <tt>File</tt> gains members:</p><table class="simplelist" border="0" summary="Simple list"><tr><td><tt>Folder parent</tt></td></tr><tr><td><tt>Folder getParent()</tt></td></tr><tr><td><tt>void setParent(Folder parent)</tt></td></tr></table><p>When used in this way, the type parameters in a generic abstract aspect declare
- <span class="emphasis"><i>roles</i></span>, and the parameterization of the abstract aspect in the <tt>extends</tt>
- clause binds types to those roles. This is a case where you may consider departing from the standard practice
- of using a single letter to represent a type parameter, and instead use a role name. It makes no difference
- to the compiler which option you choose of course.</p><pre class="programlisting">
- public abstract aspect ParentChildRelationship&lt;Parent,Child&gt; {
-
- /**
- * Parents contain a list of children
- */
- private List&lt;Child&gt; Parent.children;
-
- /**
- * Each child has a parent
- */
- private Parent Child.parent;
-
- /**
- * Parents provide access to their children
- */
- public List&lt;Children&gt; Parent.getChildren() {
- return Collections.unmodifiableList(children);
- }
-
- /**
- * A child provides access to its parent
- */
- public Parent Children.getParent() {
- return parent;
- }
-
- /**
- * ensure bi-directional navigation on adding a child
- */
- public void Parent.addChild(Child child) {
- if (child.parent != null) {
- child.parent.removeChild(child);
- }
- children.add(child);
- child.parent = this;
- }
-
- ...
- </pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="generics.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="autoboxing.html">Next</a></td></tr><tr><td width="40%" align="left">Chapter 3. Generics&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="generics.html">Up</a></td><td width="40%" align="right">&nbsp;Chapter 4. Autoboxing and Unboxing</td></tr></table></div></body></html> \ No newline at end of file
+ As a result of this declaration, <tt>Order</tt> gains members:
+ </p><table class="simplelist" border="0" summary="Simple list"><tr><td><tt>List&lt;OrderItem&gt; children</tt></td></tr><tr><td><tt>List&lt;OrderItem&gt; getChildren()</tt></td></tr><tr><td><tt>void addChild(OrderItem child)</tt></td></tr><tr><td><tt>void removeChild(OrderItem child)</tt></td></tr></table><p>and <tt>OrderItem</tt> gains members:</p><table class="simplelist" border="0" summary="Simple list"><tr><td><tt>Order parent</tt></td></tr><tr><td><tt>Order getParent()</tt></td></tr><tr><td><tt>void setParent(Order parent)</tt></td></tr></table><p>A second example of an abstract aspect, this time for handling exceptions in a uniform
+ manner, is shown below:</p><pre class="programlisting">
+ abstract aspect ExceptionHandling&lt;T extends Throwable&gt; {
+
+ /**
+ * method to be implemented by sub-aspects to handle thrown exceptions
+ */
+ protected abstract void onException(T anException);
+
+ /**
+ * to be defined by sub-aspects to specify the scope of exception handling
+ */
+ protected abstract pointcut inExceptionHandlingScope();
+
+ /**
+ * soften T within the scope of the aspect
+ */
+ declare soft: T : inExceptionHandlingScope();
+
+ /**
+ * bind an exception thrown in scope and pass it to the handler
+ */
+ after() throwing (T anException) : inExceptionHandlingScope() {
+ onException(anException);
+ }
+
+ }
+ </pre><p>Notice how the type variable <tt>T extends Throwable</tt> allows the
+ components of the aspect to be designed to work together in a type-safe manner. The
+ following concrete sub-aspect shows how the abstract aspect might be extended to
+ handle <tt>IOExceptions</tt>.</p><pre class="programlisting">
+ public aspect IOExceptionHandling extends ExceptionHandling&lt;IOException&gt;{
+
+ protected pointcut inExceptionHandlingScope() :
+ call(* doIO*(..)) &amp;&amp; within(org.xyz..*);
+
+ /**
+ * called whenever an IOException is thrown in scope.
+ */
+ protected void onException(IOException ex) {
+ System.err.println("handled exception: " + ex.getMessage());
+ throw new MyDomainException(ex);
+ }
+ }
+ </pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="generics.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="autoboxing.html">Next</a></td></tr><tr><td width="40%" align="left">Chapter 3. Generics&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="generics.html">Up</a></td><td width="40%" align="right">&nbsp;Chapter 4. Autoboxing and Unboxing</td></tr></table></div></body></html> \ No newline at end of file
diff --git a/org.aspectj.ajde/doc/adk15notebook/generics.html b/org.aspectj.ajde/doc/adk15notebook/generics.html
index 2c220a7f5..24b114887 100755
--- a/org.aspectj.ajde/doc/adk15notebook/generics.html
+++ b/org.aspectj.ajde/doc/adk15notebook/generics.html
@@ -1,11 +1,11 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Chapter 3. Generics</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="previous" href="annotations-itds.html" title="Inter-type Declarations"><link rel="next" href="generics-inAspectJ5.html" title="Generics in AspectJ 5"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 3. Generics</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="annotations-itds.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="generics-inAspectJ5.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="generics"></a>Chapter 3. Generics</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="generics.html#generics-inJava5">Generics in Java 5</a></dt><dd><dl><dt><a href="generics.html#d0e1673">Declaring Generic Types</a></dt><dt><a href="generics.html#d0e1804">Using Generic and Parameterized Types</a></dt><dt><a href="generics.html#d0e1948">Subtypes, Supertypes, and Assignability</a></dt><dt><a href="generics.html#d0e2051">Generic Methods and Constructors</a></dt><dt><a href="generics.html#d0e2069">Erasure</a></dt></dl></dd><dt><a href="generics-inAspectJ5.html">Generics in AspectJ 5</a></dt><dd><dl><dt><a href="generics-inAspectJ5.html#d0e2095">Matching generic and parameterized types in type patterns</a></dt><dt><a href="generics-inAspectJ5.html#d0e2295">Signature patterns</a></dt><dt><a href="generics-inAspectJ5.html#d0e2378">Pointcuts</a></dt><dt><a href="generics-inAspectJ5.html#d0e3065">Inter-type Declarations</a></dt><dt><a href="generics-inAspectJ5.html#d0e3186">Declare Parents</a></dt><dt><a href="generics-inAspectJ5.html#d0e3246">Declare Soft</a></dt><dt><a href="generics-inAspectJ5.html#d0e3254">Parameterized Aspects</a></dt></dl></dd></dl></div><div class="sect1"><a name="generics-inJava5"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="generics-inJava5"></a>Generics in Java 5</h2></div></div><p>
+ <title>Chapter 3. Generics</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="previous" href="annotations-itds.html" title="Inter-type Declarations"><link rel="next" href="generics-inAspectJ5.html" title="Generics in AspectJ 5"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 3. Generics</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="annotations-itds.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="generics-inAspectJ5.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="generics"></a>Chapter 3. Generics</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="generics.html#generics-inJava5">Generics in Java 5</a></dt><dd><dl><dt><a href="generics.html#d0e1682">Declaring Generic Types</a></dt><dt><a href="generics.html#d0e1813">Using Generic and Parameterized Types</a></dt><dt><a href="generics.html#d0e1957">Subtypes, Supertypes, and Assignability</a></dt><dt><a href="generics.html#d0e2060">Generic Methods and Constructors</a></dt><dt><a href="generics.html#d0e2078">Erasure</a></dt></dl></dd><dt><a href="generics-inAspectJ5.html">Generics in AspectJ 5</a></dt><dd><dl><dt><a href="generics-inAspectJ5.html#d0e2104">Matching generic and parameterized types in pointcut expressions</a></dt><dt><a href="generics-inAspectJ5.html#d0e2785">Inter-type Declarations</a></dt><dt><a href="generics-inAspectJ5.html#d0e2898">Declare Parents</a></dt><dt><a href="generics-inAspectJ5.html#d0e2931">Declare Soft</a></dt><dt><a href="generics-inAspectJ5.html#d0e2939">Generic Aspects</a></dt></dl></dd></dl></div><div class="sect1"><a name="generics-inJava5"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="generics-inJava5"></a>Generics in Java 5</h2></div></div><p>
This section provides the essential information about generics in
Java 5 needed to understand how generics are treated in AspectJ 5.
For a full introduction to generics in Java, please see the
documentation for the Java 5 SDK.
- </p><div class="sect2"><a name="d0e1673"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1673"></a>Declaring Generic Types</h3></div></div><p>
+ </p><div class="sect2"><a name="d0e1682"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1682"></a>Declaring Generic Types</h3></div></div><p>
A generic type is declared with one or more type parameters following the type name.
By convention formal type parameters are named using a single letter, though this is not required.
A simple generic list type
@@ -28,15 +28,15 @@
all of its type parameters (for example, <tt>List&lt;String&gt;</tt> or <tt>List&lt;Food&gt;</tt>).
</p><p>A generic type may be declared with multiple type parameters. In addition to simple type parameter names, type
parameter declarations can also constrain the set of types allowed by using the <tt>extends</tt>
- keyword. Some examples follow:</p><div class="variablelist"><dl><dt><a name="d0e1711"></a><span class="term">class Foo&lt;T&gt; {...}</span></dt><dd><p><a name="d0e1714"></a>A class <tt>Foo</tt> with one type parameter, <tt>T</tt>.
- </p></dd><dt><a name="d0e1723"></a><span class="term">class Foo&lt;T,S&gt; {...}</span></dt><dd><p><a name="d0e1726"></a>A class <tt>Foo</tt> with two type parameters, <tt>T</tt> and <tt>S</tt>.
- </p></dd><dt><a name="d0e1738"></a><span class="term">class Foo&lt;T extends Number&gt; {...}</span></dt><dd><p><a name="d0e1741"></a>A class <tt>Foo</tt> with one type parameter <tt>T</tt>, where <tt>T</tt> must be
+ keyword. Some examples follow:</p><div class="variablelist"><dl><dt><a name="d0e1720"></a><span class="term">class Foo&lt;T&gt; {...}</span></dt><dd><p><a name="d0e1723"></a>A class <tt>Foo</tt> with one type parameter, <tt>T</tt>.
+ </p></dd><dt><a name="d0e1732"></a><span class="term">class Foo&lt;T,S&gt; {...}</span></dt><dd><p><a name="d0e1735"></a>A class <tt>Foo</tt> with two type parameters, <tt>T</tt> and <tt>S</tt>.
+ </p></dd><dt><a name="d0e1747"></a><span class="term">class Foo&lt;T extends Number&gt; {...}</span></dt><dd><p><a name="d0e1750"></a>A class <tt>Foo</tt> with one type parameter <tt>T</tt>, where <tt>T</tt> must be
instantiated as the type <tt>Number</tt> or a subtype of <tt>Number</tt>.
- </p></dd><dt><a name="d0e1759"></a><span class="term">class Foo&lt;T, S extends T&gt; {...}</span></dt><dd><p><a name="d0e1762"></a>A class <tt>Foo</tt> with two type parameters, <tt>T</tt> and <tt>S</tt>. <tt>Foo</tt>
+ </p></dd><dt><a name="d0e1768"></a><span class="term">class Foo&lt;T, S extends T&gt; {...}</span></dt><dd><p><a name="d0e1771"></a>A class <tt>Foo</tt> with two type parameters, <tt>T</tt> and <tt>S</tt>. <tt>Foo</tt>
must be instantiated with a type <tt>S</tt> that is a subtype of the type specified for parameter <tt>T</tt>.
- </p></dd><dt><a name="d0e1783"></a><span class="term">class Foo&lt;T extends Number &amp; Comparable&gt; {...}</span></dt><dd><p><a name="d0e1786"></a>A class <tt>Foo</tt> with one type parameter, <tt>T</tt>. <tt>Foo</tt>
+ </p></dd><dt><a name="d0e1792"></a><span class="term">class Foo&lt;T extends Number &amp; Comparable&gt; {...}</span></dt><dd><p><a name="d0e1795"></a>A class <tt>Foo</tt> with one type parameter, <tt>T</tt>. <tt>Foo</tt>
must be instantiated with a type that is a subtype of <tt>Number</tt> and that implements <tt>Comparable</tt>.
- </p></dd></dl></div></div><div class="sect2"><a name="d0e1804"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1804"></a>Using Generic and Parameterized Types</h3></div></div><p>You declare a variable (or a method/constructor argument) of a parameterized type by specifying a concrete type specfication for each type parameter in
+ </p></dd></dl></div></div><div class="sect2"><a name="d0e1813"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1813"></a>Using Generic and Parameterized Types</h3></div></div><p>You declare a variable (or a method/constructor argument) of a parameterized type by specifying a concrete type specfication for each type parameter in
the generic type. The following example declares a list of strings and a list of numbers:</p><pre class="programlisting">
List&lt;String&gt; strings;
List&lt;Number&gt; numbers;
@@ -53,30 +53,30 @@
When declaring parameterized types, the <tt>?</tt> wildcard may be used, which stands for "some type".
The <tt>extends</tt> and <tt>super</tt> keywords may be used in conjunction with the wildcard
to provide upper and lower bounds on the types that may satisfy the type constraints. For example:
- </p><div class="variablelist"><dl><dt><a name="d0e1838"></a><span class="term">List&lt;?&gt;</span></dt><dd><p><a name="d0e1841"></a>A list containing elements of some type, the type of the elements in the list is unknown.
- </p></dd><dt><a name="d0e1844"></a><span class="term">List&lt;? extends Number&gt;</span></dt><dd><p><a name="d0e1847"></a>A list containing elements of some type that extends Number, the exact type of the elements in the list is unknown.
- </p></dd><dt><a name="d0e1850"></a><span class="term">List&lt;? super Double&gt;</span></dt><dd><p><a name="d0e1853"></a>A list containing elements of some type that is a super-type of Double, the exact type of the elements in the list is unknown.
+ </p><div class="variablelist"><dl><dt><a name="d0e1847"></a><span class="term">List&lt;?&gt;</span></dt><dd><p><a name="d0e1850"></a>A list containing elements of some type, the type of the elements in the list is unknown.
+ </p></dd><dt><a name="d0e1853"></a><span class="term">List&lt;? extends Number&gt;</span></dt><dd><p><a name="d0e1856"></a>A list containing elements of some type that extends Number, the exact type of the elements in the list is unknown.
+ </p></dd><dt><a name="d0e1859"></a><span class="term">List&lt;? super Double&gt;</span></dt><dd><p><a name="d0e1862"></a>A list containing elements of some type that is a super-type of Double, the exact type of the elements in the list is unknown.
</p></dd></dl></div><p>
A generic type may be extended as any other type. Given a generic type <tt>Foo&lt;T&gt;</tt> then
a subtype <tt>Goo</tt> may be declared in one of the following ways:
- </p><div class="variablelist"><dl><dt><a name="d0e1865"></a><span class="term">class Goo extends Foo</span></dt><dd><p><a name="d0e1868"></a>Here <tt>Foo</tt> is used as a raw type, and the appropriate warning messages will be
+ </p><div class="variablelist"><dl><dt><a name="d0e1874"></a><span class="term">class Goo extends Foo</span></dt><dd><p><a name="d0e1877"></a>Here <tt>Foo</tt> is used as a raw type, and the appropriate warning messages will be
issued by the compiler on attempting to invoke methods in <tt>Foo</tt>.
- </p></dd><dt><a name="d0e1877"></a><span class="term">class Goo&lt;E&gt; extends Foo</span></dt><dd><p><a name="d0e1880"></a><tt>Goo</tt> is a generic type, but the super-type <tt>Foo</tt> is used as a raw
+ </p></dd><dt><a name="d0e1886"></a><span class="term">class Goo&lt;E&gt; extends Foo</span></dt><dd><p><a name="d0e1889"></a><tt>Goo</tt> is a generic type, but the super-type <tt>Foo</tt> is used as a raw
type and the appropriate warning messages will be
issued by the compiler on attempting to invoke methods defined by <tt>Foo</tt>.
- </p></dd><dt><a name="d0e1891"></a><span class="term">class Goo&lt;E&gt; extends Foo&lt;E&gt;</span></dt><dd><p><a name="d0e1894"></a>This is the most usual form. <tt>Goo</tt> is a generic type with one parameter that extends
+ </p></dd><dt><a name="d0e1900"></a><span class="term">class Goo&lt;E&gt; extends Foo&lt;E&gt;</span></dt><dd><p><a name="d0e1903"></a>This is the most usual form. <tt>Goo</tt> is a generic type with one parameter that extends
the generic type <tt>Foo</tt> with that same parameter. So <tt>Goo&lt;String&lt;</tt> is
a subclass of <tt>Foo&lt;String&gt;</tt>.
- </p></dd><dt><a name="d0e1909"></a><span class="term">class Goo&lt;E,F&gt; extends Foo&lt;E&gt;</span></dt><dd><p><a name="d0e1912"></a><tt>Goo</tt> is a generic type with two parameters that extends
+ </p></dd><dt><a name="d0e1918"></a><span class="term">class Goo&lt;E,F&gt; extends Foo&lt;E&gt;</span></dt><dd><p><a name="d0e1921"></a><tt>Goo</tt> is a generic type with two parameters that extends
the generic type <tt>Foo</tt> with the first type parameter of <tt>Goo</tt> being used
to parameterize <tt>Foo</tt>. So <tt>Goo&lt;String,Integer&lt;</tt> is
a subclass of <tt>Foo&lt;String&gt;</tt>.
- </p></dd><dt><a name="d0e1932"></a><span class="term">class Goo extends Foo&lt;String&gt;</span></dt><dd><p><a name="d0e1935"></a><tt>Goo</tt> is a type that extends
+ </p></dd><dt><a name="d0e1941"></a><span class="term">class Goo extends Foo&lt;String&gt;</span></dt><dd><p><a name="d0e1944"></a><tt>Goo</tt> is a type that extends
the parameterized type <tt>Foo&lt;String&gt;</tt>.
</p></dd></dl></div><p>A generic type may implement one or more generic interfaces, following the type binding
rules given above. A type may also implement one or more parameterized interfaces (for example,
<tt>class X implements List&lt;String&gt;</tt>, however a type may not at the same time
- be a subtype of two interface types which are different parameterizations of the same interface.</p></div><div class="sect2"><a name="d0e1948"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1948"></a>Subtypes, Supertypes, and Assignability</h3></div></div><p>
+ be a subtype of two interface types which are different parameterizations of the same interface.</p></div><div class="sect2"><a name="d0e1957"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1957"></a>Subtypes, Supertypes, and Assignability</h3></div></div><p>
The supertype of a generic type <tt>C</tt> is the type given in the extends clause of
<tt>C</tt>, or <tt>Object</tt> if no extends clause is present. Given the type declaration
</p><pre class="programlisting">
@@ -101,7 +101,7 @@
<tt>Tm</tt> falls within the bounds of the wildcard. For example, <tt>List&lt;String&gt;</tt>
can be assigned to a variable of type <tt>Collection&lt;?&gt;</tt>, and <tt>List&lt;Double&gt;</tt>
can be assigned to a variable of type <tt>List&lt;? extends Number&gt;</tt>.
- </p></div><div class="sect2"><a name="d0e2051"></a><div class="titlepage"><div><h3 class="title"><a name="d0e2051"></a>Generic Methods and Constructors</h3></div></div><p>
+ </p></div><div class="sect2"><a name="d0e2060"></a><div class="titlepage"><div><h3 class="title"><a name="d0e2060"></a>Generic Methods and Constructors</h3></div></div><p>
A static method may be declared with one or more type parameters as in the following declaration:
</p><pre class="programlisting">
static &lt;T&gt; T first(List&lt;T&gt; ts) { ... }
@@ -112,7 +112,7 @@
Non-static methods may also be declared with one or more type parameters in a similar fashion:
</p><pre class="programlisting">
&lt;T extends Number&gt; T max(T t1, T t2) { ... }
- </pre><p>The same technique can be used to declare a generic constructor.</p></div><div class="sect2"><a name="d0e2069"></a><div class="titlepage"><div><h3 class="title"><a name="d0e2069"></a>Erasure</h3></div></div><p>Generics in Java are implemented using a technique called <span class="emphasis"><i>erasure</i></span>. All
+ </pre><p>The same technique can be used to declare a generic constructor.</p></div><div class="sect2"><a name="d0e2078"></a><div class="titlepage"><div><h3 class="title"><a name="d0e2078"></a>Erasure</h3></div></div><p>Generics in Java are implemented using a technique called <span class="emphasis"><i>erasure</i></span>. All
type parameter information is erased from the run-time type system. Asking an object of a parameterized
type for its class will return the class object for the raw type (eg. <tt>List</tt> for an object
declared to be of type <tt>List&lt;String&gt;</tt>. A consequence of this is that you cannot at
diff --git a/org.aspectj.ajde/doc/adk15notebook/index.html b/org.aspectj.ajde/doc/adk15notebook/index.html
index 9b2120a21..9fbefe055 100755
--- a/org.aspectj.ajde/doc/adk15notebook/index.html
+++ b/org.aspectj.ajde/doc/adk15notebook/index.html
@@ -1,7 +1,7 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>The AspectJTM 5 Development Kit Developer's Notebook</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="next" href="jpsigs.html" title="Chapter 1. Join Point Signatures"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The AspectJ<sup>TM</sup> 5 Development Kit Developer's Notebook</th></tr><tr><td width="20%" align="left">&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="jpsigs.html">Next</a></td></tr></table><hr></div><div class="book" id="d0e1"><div class="titlepage"><div><h1 class="title"><a name="d0e1"></a>The AspectJ<sup>TM</sup> 5 Development Kit Developer's Notebook</h1></div><div><h3 class="author">the AspectJ Team</h3></div><div><div class="legalnotice"><p>
- Copyright (c) 2004 Contributors,
+ Copyright (c) 2004, 2005 Contributors,
All rights reserved.
</p></div></div><div><div class="abstract"><p><a name="d0e15"></a><b>Abstract</b></p><p>
This guide describes the changes to the AspectJ language
@@ -18,4 +18,4 @@
have more confidence in the design will be implemented earlier, providing a
framework for user feedback and direction setting on features for which the
use cases are less obvious at time of writing.
- </p></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>1. <a href="jpsigs.html">Join Point Signatures</a></dt><dd><dl><dt><a href="jpsigs.html#join-point-matching">Join Point Matching</a></dt><dt><a href="join-point-signatures.html">Join Point Signatures</a></dt><dd><dl><dt><a href="join-point-signatures.html#d0e246">Method call join point signatures</a></dt><dt><a href="join-point-signatures.html#d0e351">Method execution join point signatures</a></dt><dt><a href="join-point-signatures.html#d0e373">Field get and set join point signatures</a></dt></dl></dd><dt><a href="join-point-modifiers.html">Join Point Modifiers</a></dt><dt><a href="join-point-matching-summary.html">Summary of Join Point Matching</a></dt></dl></dd><dt>2. <a href="annotations.html">Annotations</a></dt><dd><dl><dt><a href="annotations.html#annotations-inJava5">Annotations in Java 5</a></dt><dd><dl><dt><a href="annotations.html#d0e578">Using Annotations</a></dt><dt><a href="annotations.html#d0e624">Retention Policies</a></dt><dt><a href="annotations.html#d0e659">Accessing Annotations at Runtime</a></dt><dt><a href="annotations.html#d0e694">Annotation Inheritance</a></dt></dl></dd><dt><a href="annotations-aspectmembers.html">Annotating Aspects</a></dt><dt><a href="annotations-pointcuts-and-advice.html">Join Point Matching based on Annotations</a></dt><dd><dl><dt><a href="annotations-pointcuts-and-advice.html#d0e782">Annotation Patterns</a></dt><dt><a href="annotations-pointcuts-and-advice.html#d0e867">Type Patterns</a></dt><dt><a href="annotations-pointcuts-and-advice.html#signaturePatterns">Signature Patterns</a></dt><dt><a href="annotations-pointcuts-and-advice.html#d0e1121">Example Pointcuts</a></dt><dt><a href="annotations-pointcuts-and-advice.html#d0e1194">Runtime type matching and context exposure</a></dt><dt><a href="annotations-pointcuts-and-advice.html#d0e1421">Package and Parameter Annotations</a></dt><dt><a href="annotations-pointcuts-and-advice.html#d0e1431">Annotation Inheritance and pointcut matching</a></dt><dt><a href="annotations-pointcuts-and-advice.html#d0e1463">Limitations</a></dt></dl></dd><dt><a href="annotations-decp.html">Using Annotations with declare statements</a></dt><dd><dl><dt><a href="annotations-decp.html#d0e1478">Declare error and declare warning</a></dt><dt><a href="annotations-decp.html#d0e1493">declare parents</a></dt><dt><a href="annotations-decp.html#d0e1541">declare precedence</a></dt></dl></dd><dt><a href="annotations-declare.html">Declare Annotation</a></dt><dt><a href="annotations-itds.html">Inter-type Declarations</a></dt></dl></dd><dt>3. <a href="generics.html">Generics</a></dt><dd><dl><dt><a href="generics.html#generics-inJava5">Generics in Java 5</a></dt><dd><dl><dt><a href="generics.html#d0e1673">Declaring Generic Types</a></dt><dt><a href="generics.html#d0e1804">Using Generic and Parameterized Types</a></dt><dt><a href="generics.html#d0e1948">Subtypes, Supertypes, and Assignability</a></dt><dt><a href="generics.html#d0e2051">Generic Methods and Constructors</a></dt><dt><a href="generics.html#d0e2069">Erasure</a></dt></dl></dd><dt><a href="generics-inAspectJ5.html">Generics in AspectJ 5</a></dt><dd><dl><dt><a href="generics-inAspectJ5.html#d0e2095">Matching generic and parameterized types in type patterns</a></dt><dt><a href="generics-inAspectJ5.html#d0e2295">Signature patterns</a></dt><dt><a href="generics-inAspectJ5.html#d0e2378">Pointcuts</a></dt><dt><a href="generics-inAspectJ5.html#d0e3065">Inter-type Declarations</a></dt><dt><a href="generics-inAspectJ5.html#d0e3186">Declare Parents</a></dt><dt><a href="generics-inAspectJ5.html#d0e3246">Declare Soft</a></dt><dt><a href="generics-inAspectJ5.html#d0e3254">Parameterized Aspects</a></dt></dl></dd></dl></dd><dt>4. <a href="autoboxing.html">Autoboxing and Unboxing</a></dt><dd><dl><dt><a href="autoboxing.html#boxing-inJava5">Autoboxing and Unboxing in Java 5</a></dt><dt><a href="autoboxing-in-aspectj5.html">Autoboxing and Join Point matching in AspectJ 5</a></dt><dt><a href="autoboxing-and-method-dispatch.html">Inter-type method declarations and method dispatch</a></dt></dl></dd><dt>5. <a href="covariance.html">Covariance</a></dt><dd><dl><dt><a href="covariance.html#covariance-inJava5">Covariance in Java 5</a></dt><dt><a href="covariance-and-join-point-matching.html">Covariant methods and Join Point matching</a></dt></dl></dd><dt>6. <a href="varargs.html">Varargs</a></dt><dd><dl><dt><a href="varargs.html#varargs-inJava5">Variable-length Argument Lists in Java 5</a></dt><dd><dl><dt><a href="varargs.html#d0e3620">Calling Methods and Constructors with variable-length arguments</a></dt></dl></dd><dt><a href="varargs-in-pcds.html">Using Variable-length arguments in advice and pointcut expressions</a></dt><dd><dl><dt><a href="varargs-in-pcds.html#d0e3654">Matching signatures based on variable length argument types</a></dt><dt><a href="varargs-in-pcds.html#d0e3756">Exposing variable-length arguments as context in pointcuts and advice</a></dt></dl></dd></dl></dd><dt>7. <a href="enumeratedtypes.html">Enumerated Types</a></dt><dd><dl><dt><a href="enumeratedtypes.html#enums-in-java5">Enumerated Types in Java 5</a></dt><dt><a href="enums-in-aspectj5.html">Enumerated Types in AspectJ 5</a></dt></dl></dd><dt>8. <a href="pertypewithin.html">The pertypewithin Aspect Instantiation Model</a></dt><dt>9. <a href="ataspectj.html">An Annotation Based Development Style</a></dt><dd><dl><dt><a href="ataspectj.html#ataspectj-intro">Introduction</a></dt><dt><a href="ataspectj-aspects.html">Aspect Declarations</a></dt><dt><a href="ataspectj-pcadvice.html">Pointcuts and Advice</a></dt><dd><dl><dt><a href="ataspectj-pcadvice.html#d0e3980">Pointcuts</a></dt><dt><a href="ataspectj-pcadvice.html#d0e4101">Advice</a></dt></dl></dd><dt><a href="ataspectj-itds.html">Inter-type Declarations</a></dt><dt><a href="ataspectj-declare.html">Declare statements</a></dt><dt><a href="ataspectj-aspectof.html">aspectOf() and hasAspect() methods</a></dt></dl></dd><dt>10. <a href="reflection.html">New Reflection Interfaces</a></dt><dd><dl><dt><a href="reflection.html#reflection_api">The Aspect Class</a></dt></dl></dd><dt>11. <a href="miscellaneous.html">Other Changes in AspectJ 5</a></dt><dd><dl><dt><a href="miscellaneous.html#d0e4336">Pointcuts</a></dt><dd><dl><dt><a href="miscellaneous.html#d0e4339">Binding of formals</a></dt><dt><a href="miscellaneous.html#d0e4348">Additional lint warnings</a></dt></dl></dd><dt><a href="declare-soft.html">Declare Soft</a></dt><dt><a href="ch11s03.html">Tools</a></dt><dd><dl><dt><a href="ch11s03.html#d0e4393">Aspectpath</a></dt></dl></dd></dl></dd><dt>12. <a href="ltw.html">Load-Time Weaving</a></dt><dd><dl><dt><a href="ltw.html#ltw-introduction">Introduction</a></dt><dd><dl><dt><a href="ltw.html#d0e4415">Weaving class files more than once</a></dt></dl></dd><dt><a href="ltw-rules.html">Load-time Weaving Requirements</a></dt><dt><a href="ltw-configuration.html">Configuration</a></dt><dd><dl><dt><a href="ltw-configuration.html#d0e4443">Enabling Load-time Weaving</a></dt><dt><a href="ltw-configuration.html#d0e4471">Configuring Load-time Weaving with aop.xml files</a></dt><dt><a href="ltw-configuration.html#d0e4535">Configuring Load-time Weaving with Properties Files</a></dt><dt><a href="ltw-configuration.html#d0e4545">Weaver Options</a></dt></dl></dd><dt><a href="ltw-packaging.html">Runtime Requirements for Load-time Weaving</a></dt><dt><a href="ltw-agents.html">Supported Agents</a></dt><dd><dl><dt><a href="ltw-agents.html#d0e4637">JVMTI</a></dt><dt><a href="ltw-agents.html#d0e4644">JRockit</a></dt></dl></dd></dl></dd><dt>A. <a href="grammar.html">A Grammar for the AspectJ 5 Language</a></dt></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left">&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="jpsigs.html">Next</a></td></tr><tr><td width="40%" align="left">&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;Chapter 1. Join Point Signatures</td></tr></table></div></body></html> \ No newline at end of file
+ </p></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>1. <a href="jpsigs.html">Join Point Signatures</a></dt><dd><dl><dt><a href="jpsigs.html#join-point-matching">Join Point Matching</a></dt><dt><a href="join-point-signatures.html">Join Point Signatures</a></dt><dd><dl><dt><a href="join-point-signatures.html#d0e246">Method call join point signatures</a></dt><dt><a href="join-point-signatures.html#d0e351">Method execution join point signatures</a></dt><dt><a href="join-point-signatures.html#d0e373">Field get and set join point signatures</a></dt></dl></dd><dt><a href="join-point-modifiers.html">Join Point Modifiers</a></dt><dt><a href="join-point-matching-summary.html">Summary of Join Point Matching</a></dt></dl></dd><dt>2. <a href="annotations.html">Annotations</a></dt><dd><dl><dt><a href="annotations.html#annotations-inJava5">Annotations in Java 5</a></dt><dd><dl><dt><a href="annotations.html#d0e578">Using Annotations</a></dt><dt><a href="annotations.html#d0e624">Retention Policies</a></dt><dt><a href="annotations.html#d0e659">Accessing Annotations at Runtime</a></dt><dt><a href="annotations.html#d0e694">Annotation Inheritance</a></dt></dl></dd><dt><a href="annotations-aspectmembers.html">Annotating Aspects</a></dt><dt><a href="annotations-pointcuts-and-advice.html">Join Point Matching based on Annotations</a></dt><dd><dl><dt><a href="annotations-pointcuts-and-advice.html#d0e782">Annotation Patterns</a></dt><dt><a href="annotations-pointcuts-and-advice.html#d0e867">Type Patterns</a></dt><dt><a href="annotations-pointcuts-and-advice.html#signaturePatterns">Signature Patterns</a></dt><dt><a href="annotations-pointcuts-and-advice.html#d0e1121">Example Pointcuts</a></dt><dt><a href="annotations-pointcuts-and-advice.html#d0e1194">Runtime type matching and context exposure</a></dt><dt><a href="annotations-pointcuts-and-advice.html#d0e1421">Package and Parameter Annotations</a></dt><dt><a href="annotations-pointcuts-and-advice.html#d0e1431">Annotation Inheritance and pointcut matching</a></dt><dt><a href="annotations-pointcuts-and-advice.html#d0e1472">Limitations</a></dt></dl></dd><dt><a href="annotations-decp.html">Using Annotations with declare statements</a></dt><dd><dl><dt><a href="annotations-decp.html#d0e1487">Declare error and declare warning</a></dt><dt><a href="annotations-decp.html#d0e1502">declare parents</a></dt><dt><a href="annotations-decp.html#d0e1550">declare precedence</a></dt></dl></dd><dt><a href="annotations-declare.html">Declare Annotation</a></dt><dt><a href="annotations-itds.html">Inter-type Declarations</a></dt></dl></dd><dt>3. <a href="generics.html">Generics</a></dt><dd><dl><dt><a href="generics.html#generics-inJava5">Generics in Java 5</a></dt><dd><dl><dt><a href="generics.html#d0e1682">Declaring Generic Types</a></dt><dt><a href="generics.html#d0e1813">Using Generic and Parameterized Types</a></dt><dt><a href="generics.html#d0e1957">Subtypes, Supertypes, and Assignability</a></dt><dt><a href="generics.html#d0e2060">Generic Methods and Constructors</a></dt><dt><a href="generics.html#d0e2078">Erasure</a></dt></dl></dd><dt><a href="generics-inAspectJ5.html">Generics in AspectJ 5</a></dt><dd><dl><dt><a href="generics-inAspectJ5.html#d0e2104">Matching generic and parameterized types in pointcut expressions</a></dt><dt><a href="generics-inAspectJ5.html#d0e2785">Inter-type Declarations</a></dt><dt><a href="generics-inAspectJ5.html#d0e2898">Declare Parents</a></dt><dt><a href="generics-inAspectJ5.html#d0e2931">Declare Soft</a></dt><dt><a href="generics-inAspectJ5.html#d0e2939">Generic Aspects</a></dt></dl></dd></dl></dd><dt>4. <a href="autoboxing.html">Autoboxing and Unboxing</a></dt><dd><dl><dt><a href="autoboxing.html#boxing-inJava5">Autoboxing and Unboxing in Java 5</a></dt><dt><a href="autoboxing-in-aspectj5.html">Autoboxing and Join Point matching in AspectJ 5</a></dt><dt><a href="autoboxing-and-method-dispatch.html">Inter-type method declarations and method dispatch</a></dt></dl></dd><dt>5. <a href="covariance.html">Covariance</a></dt><dd><dl><dt><a href="covariance.html#covariance-inJava5">Covariance in Java 5</a></dt><dt><a href="covariance-and-join-point-matching.html">Covariant methods and Join Point matching</a></dt></dl></dd><dt>6. <a href="varargs.html">Varargs</a></dt><dd><dl><dt><a href="varargs.html#varargs-inJava5">Variable-length Argument Lists in Java 5</a></dt><dd><dl><dt><a href="varargs.html#d0e3303">Calling Methods and Constructors with variable-length arguments</a></dt></dl></dd><dt><a href="varargs-in-pcds.html">Using Variable-length arguments in advice and pointcut expressions</a></dt><dd><dl><dt><a href="varargs-in-pcds.html#d0e3337">Matching signatures based on variable length argument types</a></dt><dt><a href="varargs-in-pcds.html#d0e3439">Exposing variable-length arguments as context in pointcuts and advice</a></dt></dl></dd></dl></dd><dt>7. <a href="enumeratedtypes.html">Enumerated Types</a></dt><dd><dl><dt><a href="enumeratedtypes.html#enums-in-java5">Enumerated Types in Java 5</a></dt><dt><a href="enums-in-aspectj5.html">Enumerated Types in AspectJ 5</a></dt></dl></dd><dt>8. <a href="pertypewithin.html">The pertypewithin Aspect Instantiation Model</a></dt><dt>9. <a href="ataspectj.html">An Annotation Based Development Style</a></dt><dd><dl><dt><a href="ataspectj.html#ataspectj-intro">Introduction</a></dt><dt><a href="ataspectj-aspects.html">Aspect Declarations</a></dt><dd><dl><dt><a href="ataspectj-aspects.html#d0e3640">Limitations</a></dt></dl></dd><dt><a href="ataspectj-pcadvice.html">Pointcuts and Advice</a></dt><dd><dl><dt><a href="ataspectj-pcadvice.html#d0e3657">Pointcuts</a></dt><dt><a href="ataspectj-pcadvice.html#d0e3796">Advice</a></dt></dl></dd><dt><a href="ataspectj-itds.html">Inter-type Declarations</a></dt><dt><a href="ataspectj-declare.html">Declare statements</a></dt><dt><a href="ataspectj-aspectof.html">aspectOf() and hasAspect() methods</a></dt></dl></dd><dt>10. <a href="reflection.html">New Reflection Interfaces</a></dt><dd><dl><dt><a href="reflection.html#reflection_api">The Aspect Class</a></dt></dl></dd><dt>11. <a href="miscellaneous.html">Other Changes in AspectJ 5</a></dt><dd><dl><dt><a href="miscellaneous.html#d0e4055">Pointcuts</a></dt><dd><dl><dt><a href="miscellaneous.html#d0e4058">Binding of formals</a></dt><dt><a href="miscellaneous.html#d0e4067">Additional lint warnings</a></dt></dl></dd><dt><a href="declare-soft.html">Declare Soft</a></dt><dt><a href="ch11s03.html">Tools</a></dt><dd><dl><dt><a href="ch11s03.html#d0e4112">Aspectpath</a></dt></dl></dd></dl></dd><dt>12. <a href="ltw.html">Load-Time Weaving</a></dt><dd><dl><dt><a href="ltw.html#ltw-introduction">Introduction</a></dt><dd><dl><dt><a href="ltw.html#d0e4134">Weaving class files more than once</a></dt></dl></dd><dt><a href="ltw-rules.html">Load-time Weaving Requirements</a></dt><dt><a href="ltw-configuration.html">Configuration</a></dt><dd><dl><dt><a href="ltw-configuration.html#d0e4162">Enabling Load-time Weaving</a></dt><dt><a href="ltw-configuration.html#d0e4206">Configuring Load-time Weaving with aop.xml files</a></dt><dt><a href="ltw-configuration.html#d0e4277">Weaver Options</a></dt></dl></dd><dt><a href="ltw-specialcases.html">Special cases</a></dt><dt><a href="ltw-packaging.html">Runtime Requirements for Load-time Weaving</a></dt><dt><a href="ltw-agents.html">Supported Agents</a></dt><dd><dl><dt><a href="ltw-agents.html#d0e4412">JVMTI</a></dt><dt><a href="ltw-agents.html#d0e4419">JRockit with Java 1.3/1.4 (use JVMTI on Java 5)</a></dt></dl></dd></dl></dd><dt>A. <a href="grammar.html">A Grammar for the AspectJ 5 Language</a></dt></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left">&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="jpsigs.html">Next</a></td></tr><tr><td width="40%" align="left">&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;Chapter 1. Join Point Signatures</td></tr></table></div></body></html> \ No newline at end of file
diff --git a/org.aspectj.ajde/doc/adk15notebook/ltw-agents.html b/org.aspectj.ajde/doc/adk15notebook/ltw-agents.html
index de0a10cdb..630be5d8b 100755
--- a/org.aspectj.ajde/doc/adk15notebook/ltw-agents.html
+++ b/org.aspectj.ajde/doc/adk15notebook/ltw-agents.html
@@ -1,8 +1,8 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Supported Agents</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="ltw.html" title="Chapter 12. Load-Time Weaving"><link rel="previous" href="ltw-packaging.html" title="Runtime Requirements for Load-time Weaving"><link rel="next" href="grammar.html" title="Appendix A. A Grammar for the AspectJ 5 Language"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Supported Agents</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ltw-packaging.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 12. Load-Time Weaving</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="grammar.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="ltw-agents"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ltw-agents"></a>Supported Agents</h2></div></div><div class="sect2"><a name="d0e4637"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4637"></a>JVMTI</h3></div></div><p> When using JDK 1.5 the JVMTI agent can be used by starting the JVM with the
+ <title>Supported Agents</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="ltw.html" title="Chapter 12. Load-Time Weaving"><link rel="previous" href="ltw-packaging.html" title="Runtime Requirements for Load-time Weaving"><link rel="next" href="grammar.html" title="Appendix A. A Grammar for the AspectJ 5 Language"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Supported Agents</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ltw-packaging.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 12. Load-Time Weaving</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="grammar.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="ltw-agents"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ltw-agents"></a>Supported Agents</h2></div></div><div class="sect2"><a name="d0e4412"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4412"></a>JVMTI</h3></div></div><p> When using Java 5 the JVMTI agent can be used by starting the JVM with the
following option (adapt according to the path to aspectjweaver.jar): </p><pre class="programlisting">
- -javaagent=aspectjweaver.jar
- </pre></div><div class="sect2"><a name="d0e4644"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4644"></a>JRockit</h3></div></div><p> The JRockit agent is configured with the following JVM option: </p><pre class="programlisting">
- -Xmanagement:class=org.aspectj.weaver.tools.JRockitWeavingAgent
+ -javaagent:pathto/aspectjweaver.jar
+ </pre></div><div class="sect2"><a name="d0e4419"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4419"></a>JRockit with Java 1.3/1.4 (use JVMTI on Java 5)</h3></div></div><p> The JRockit agent is configured with the following JVM option: </p><pre class="programlisting">
+ -Xmanagement:class=org.aspectj.weaver.loadtime.JRockitAgent
</pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ltw-packaging.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="grammar.html">Next</a></td></tr><tr><td width="40%" align="left">Runtime Requirements for Load-time Weaving&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="ltw.html">Up</a></td><td width="40%" align="right">&nbsp;Appendix A. A Grammar for the AspectJ 5 Language</td></tr></table></div></body></html> \ No newline at end of file
diff --git a/org.aspectj.ajde/doc/adk15notebook/ltw-configuration.html b/org.aspectj.ajde/doc/adk15notebook/ltw-configuration.html
index 638b585fb..7d8a52d10 100755
--- a/org.aspectj.ajde/doc/adk15notebook/ltw-configuration.html
+++ b/org.aspectj.ajde/doc/adk15notebook/ltw-configuration.html
@@ -1,32 +1,24 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Configuration</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="ltw.html" title="Chapter 12. Load-Time Weaving"><link rel="previous" href="ltw-rules.html" title="Load-time Weaving Requirements"><link rel="next" href="ltw-packaging.html" title="Runtime Requirements for Load-time Weaving"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Configuration</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ltw-rules.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 12. Load-Time Weaving</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ltw-packaging.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="ltw-configuration"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ltw-configuration"></a>Configuration</h2></div></div><p>AspectJ 5 supports a number of mechanisms designed to make load-time weaving as
+ <title>Configuration</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="ltw.html" title="Chapter 12. Load-Time Weaving"><link rel="previous" href="ltw-rules.html" title="Load-time Weaving Requirements"><link rel="next" href="ltw-specialcases.html" title="Special cases"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Configuration</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ltw-rules.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 12. Load-Time Weaving</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ltw-specialcases.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="ltw-configuration"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ltw-configuration"></a>Configuration</h2></div></div><p>AspectJ 5 supports a number of mechanisms designed to make load-time weaving as
easy to use as possibe. The load-time weaving mechanism is chosen through JVM startup options.
Configuration files determine the set of aspects to be used for weaving and which
types will be woven. Additional diagnostic options allow the user to debug the configuration and
- weaving process. </p><div class="sect2"><a name="d0e4443"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4443"></a>Enabling Load-time Weaving</h3></div></div><p> AspectJ 5 supports three different ways of enabling load-time weaving for
+ weaving process. </p><div class="sect2"><a name="d0e4162"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4162"></a>Enabling Load-time Weaving</h3></div></div><p> AspectJ 5 supports several different ways of enabling load-time weaving for
an application: agents, a command-line launch script, and a set of interfaces for
- integration of AspectJ load-time weaving in custom environments. </p><div class="variablelist"><dl><dt><a name="d0e4449"></a><span class="term">Agents</span></dt><dd><p><a name="d0e4452"></a>AspectJ 5 ships with a number of load-time weaving agents that
+ integration of AspectJ load-time weaving in custom environments. </p><div class="variablelist"><dl><dt><a name="d0e4168"></a><span class="term">Agents</span></dt><dd><p><a name="d0e4171"></a>AspectJ 5 ships with a number of load-time weaving agents that
enable load-time weaving. These agents and their configuration
- are execution environment dependent.
- Using Java 5 for example, you can specify the "-javaagent" option
- to the JVM. Configuration for the supported environments is discussed
- later in this chapter. AspectJ 5
- has several agents including those that use JVMTI, and the
- JRockit MAPI. </p></dd><dt><a name="d0e4455"></a><span class="term">Command line</span></dt><dd><p> AspectJ includes a script "aj" that allows programs executed at
- the command line to take advantage of load-time weaving.
- The script is customized when AspectJ is installed depending on the chosen
- JDK. For example, for JDK 1.4 the script uses the
- <tt>-Djava.system.class.loader</tt> system property to replace
- the system class loader with a weaving class loader allowing classes
- loaded from the CLASSPATH to be woven.
- For JDK 1.5 the JVMTI weaving agent is used allowing classes loaded by all
- class loaders to be woven. Versions of the JDK prior to 1.3 are not
- supported by the "aj" mechanism. </p></dd><dt><a name="d0e4465"></a><span class="term">Custom Integration</span></dt><dd><p><a name="d0e4468"></a> A public interface is provided to allow a user written class loader
+ are execution environment dependent. Configuration for the supported environments is discussed
+ later in this chapter.</p><p>
+ Using Java 5 JVMTI you can specify the <tt>-javaagent:pathto/aspectjweaver.jar</tt> option
+ to the JVM.</p><p>
+ Using BEA JRockit and Java 1.3/1.4, the very same behavior can be obtained using BEA JRockit JMAPI features with
+ the <tt>-Xmanagement:class=org.aspectj.weaver.loadtime.JRockitAgent</tt>
+ </p></dd><dt><a name="d0e4200"></a><span class="term">Custom Integration</span></dt><dd><p><a name="d0e4203"></a> A public interface is provided to allow a user written class loader
to instantiate a weaver and weave classes after loading and before
defining them in the JVM. This enables load-time weaving to be supported in
environments where no weaving agent is available. It also allows the
- user to explicity restrict by class loader which classes can be woven. </p></dd></dl></div></div><div class="sect2"><a name="d0e4471"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4471"></a>Configuring Load-time Weaving with aop.xml files</h3></div></div><p>The weaver is configured using one or more <tt>META-INF/aop.xml</tt>
+ user to explicity restrict by class loader which classes can be woven.</p></dd></dl></div></div><div class="sect2"><a name="d0e4206"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4206"></a>Configuring Load-time Weaving with aop.xml files</h3></div></div><p>The weaver is configured using one or more <tt>META-INF/aop.xml</tt>
files located on the class loader search path. Each file may define a list of
concrete aspects to be used for weaving, type patterns describing which types
should woven, and a set of options to be passed to the weaver. In addition AspectJ 5
@@ -35,7 +27,7 @@
may define abstract pointcuts (but not abstract
methods). The following example shows a simple aop.xml file: </p><pre class="programlisting">
&lt;aspectj&gt;
-
+
&lt;aspects&gt;
&lt;!-- declare two existing aspects to the weaver --&gt;
&lt;aspect name="com.MyAspect"/&gt;
@@ -45,14 +37,14 @@
&lt;concrete-aspect name="com.xyz.tracing.MyTracing" extends="tracing.AbstractTracing"&gt;
&lt;pointcut name="tracingScope" expression="within(org.maw.*)"/&gt;
&lt;/concrete-aspect&gt;
-
+
&lt;!-- Of the set of aspects known to the weaver, use aspects matching
the type pattern "com..*" for weaving. --&gt;
&lt;include within="com..*"/&gt;
-
+
&lt;!-- Do not use any aspects with the @CoolAspect annotation for weaving --&gt;
- &lt;exclude within="@CoolAspect *"/&gt;
-
+ &lt;exclude within="@CoolAspect *"/&gt;
+
&lt;/aspects&gt;
&lt;weaver options="-verbose -XlazyTjp"&gt;
@@ -62,10 +54,11 @@
&lt;include within="javax.*"/&gt;
&lt;include within="org.aspectj.*"/&gt;
&lt;include within="(!@NoWeave foo.*) AND foo.*"/&gt;
+ &lt;dump within="somepack.*"/&gt;&lt;!-- will dump weaved classes to the "./_ajdump" folder on disk (for diagnostic purpose) --&gt;
&lt;/weaver&gt;
-
+
&lt;/aspectj&gt;
-
+
</pre><p>
An aop.xml file contains two key sections: "aspects" defines one
or more aspects to the weaver and controls which aspects are to be
@@ -83,6 +76,10 @@
auxiliary aspects where the pointcut definitions themselves can be
considered part of the configuration of the service.
</p><p>
+ <span class="emphasis"><i>
+ Note: concrete-aspect is not available in AspectJ 1.5 M3.
+ </i></span>
+ </p><p>
The aspects element may optionally contain one or more include and
exclude elements (by default, all defined aspects are used for weaving).
Specifying include or exclude elements restricts the set of defined
@@ -99,16 +96,16 @@
and to aop.properties files as described in the next section).
The files are merged in the order they are
found on the search path (regular <tt>getResourceAsStream</tt> lookup)
- according to the following rules: </p><div class="itemizedlist"><ul><li><a name="d0e4496"></a> The set of available aspects is the set of all
+ according to the following rules: </p><div class="itemizedlist"><ul><li><a name="d0e4236"></a> The set of available aspects is the set of all
declared and defined aspects (<tt>aspect</tt> and
<tt>concrete-aspect</tt> elements of the <tt>aspects</tt>
- section).</li><li><a name="d0e4507"></a>The set of aspects used for weaving is the subset of the available
+ section).</li><li><a name="d0e4247"></a>The set of aspects used for weaving is the subset of the available
aspects that are matched by at least one include statement and are not matched
by any exclude statements. If there are no include statements then all non-excluded
- aspects are included.</li><li><a name="d0e4509"></a> The set of types to be woven are those types matched by at
+ aspects are included.</li><li><a name="d0e4249"></a> The set of types to be woven are those types matched by at
least one weaver <tt>include</tt> element and not matched by any
weaver <tt>exclude</tt> element. If there are no weaver include
- statements then all non-excluded types are included.</li><li><a name="d0e4517"></a> The weaver options are derived by taking the union of the
+ statements then all non-excluded types are included.</li><li><a name="d0e4257"></a> The weaver options are derived by taking the union of the
options specified in each of the weaver options attribute specifications. Where an
option takes a value e.g. <tt>-warn:none</tt> the most recently defined value
will be used.</li></ul></div><p>It is not an error for the same aspect to be defined to the weaver in
@@ -121,24 +118,21 @@
</p><p> A <tt>META-INF/aop.xml</tt> file will automatically be generated when
using the <tt>-outjar</tt> option of the AspectJ compiler.
It will simply contain a (possibly empty) set of aspect elements, one for
- each concrete aspect included in the JAR. </p></div><div class="sect2"><a name="d0e4535"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4535"></a>Configuring Load-time Weaving with Properties Files</h3></div></div><p> For memory constrained environments or those without support for XML a simple
- Java Properties file can be used to configure LTW. Just like XML files,
- <tt>META-INF/aop.properties</tt> files are loaded from the class loader
- search path. Everything that can be configured through XML can be configured using a
- Properties file, with the exception of declarative concrete aspects. For example: </p><pre class="programlisting">
- aspects.names=com.MyAspect,com.MyAspect.Inner
- aspects.include=com..*
- aspects.exclude=@CoolAspect
-
- weaver.options=-verbose -XlazyTjp
- weaver.include=javax.* OR org.aspectj.*
- </pre></div><div class="sect2"><a name="d0e4545"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4545"></a>Weaver Options</h3></div></div><p> The table below lists the AspectJ options supported by LTW. All other options
- will be ignored and a warning issued. </p><div class="informaltable" id="d0e4550"><a name="d0e4550"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Option</th><th>Purpose</th></tr></thead><tbody><tr><td><tt>-1.5</tt></td><td>Run the weaver in 1.5 mode (supports autoboxing in
+ each concrete aspect included in the JAR. </p></div><div class="sect2"><a name="d0e4277"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4277"></a>Weaver Options</h3></div></div><p> The table below lists the AspectJ options supported by LTW. All other options
+ will be ignored and a warning issued. </p><div class="informaltable" id="d0e4282"><a name="d0e4282"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Option</th><th>Purpose</th></tr></thead><tbody><tr><td><tt>-verbose</tt></td><td>Issue informational messages about the weaving process. If ever you need to have information
+ when the load time weaving engine is bootstrapped (hence its logger as per <tt>-XmessageHandlerClass:...</tt> not ready yet),
+ you can use the option <tt>-Daj.weaving.verbose=true</tt> on the JVM startup command line. Messages will then be printed
+ on stderr as long as the message handler class is not ready.
+ </td></tr><tr><td><tt>-1.5</tt></td><td>Run the weaver in 1.5 mode (supports autoboxing in
join point matching)</td></tr><tr><td><tt>-XlazyTjp</tt></td><td>Performance optimization for aspects making use
- of thisJoinPoint (non-static parts)</td></tr><tr><td><tt>-Xlint, -Xlint:ignore, ...</tt></td><td>Configure lint messages</td></tr><tr><td><tt>-nowarn, -warn:none</tt></td><td>Suppress warning messages</td></tr><tr><td><tt>-proceedOnError</tt></td><td>Continue weaving even if errors occur (for example,
- "... already woven" errors)</td></tr><tr><td><tt>-verbose</tt></td><td>Issue informational messages about the weaving process</td></tr><tr><td><tt>-Xreweavable</tt></td><td>Produce class files that can subsequently be rewoven</td></tr><tr><td><tt>-XnoInline</tt></td><td>Don't inline around advice.</td></tr><tr><td><tt>-showWeaveInfo</tt></td><td>Issue informational messages whenever the weaver touches a class file</td></tr><tr><td><tt>-XmessageHolderClass:...</tt></td><td>Provide alternative output destination to stdout/stderr for all weaver messages.
+ of thisJoinPoint (non-static parts)</td></tr><tr><td><tt>-Xlintfile:pathToAResource</tt></td><td>Configure lint messages as specified in the given resource (visible from this aop.xml file' classloader)</td></tr><tr><td><tt>-Xlint:default, -Xlint:ignore, ...</tt></td><td>Configure lint messages, refer to documentation for meaningfull values</td></tr><tr><td><tt>-nowarn, -warn:none</tt></td><td>Suppress warning messages</td></tr><tr><td><tt>-proceedOnError</tt></td><td>Continue weaving even if errors occur (for example,
+ "... already woven" errors)</td></tr><tr><td><tt>-Xreweavable</tt></td><td>Produce class files that can subsequently be rewoven</td></tr><tr><td><tt>-XnoInline</tt></td><td>Don't inline around advice.</td></tr><tr><td><tt>-showWeaveInfo</tt></td><td>Issue informational messages whenever the weaver touches a class file</td></tr><tr><td><tt>-XmessageHandlerClass:...</tt></td><td>Provide alternative output destination to stdout/stderr for all weaver messages.
The given value must be the full qualified class name of a class that implements
- <tt>org.aspectj.weaver.loadtime</tt>
+ <tt>org.aspectj.bridge.IMessageHandler</tt>
and that is visible from where the <tt>aop.xml</tt> is packed.
If more than one such options are used,
- the first occurence only is taken into account.</td></tr></tbody></table></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ltw-rules.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ltw-packaging.html">Next</a></td></tr><tr><td width="40%" align="left">Load-time Weaving Requirements&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="ltw.html">Up</a></td><td width="40%" align="right">&nbsp;Runtime Requirements for Load-time Weaving</td></tr></table></div></body></html> \ No newline at end of file
+ the first occurence only is taken into account.
+ You must also be very cautious about using a custom handler since it is likely that it will be invoked
+ (as well as all its third parties) while the weaving is done, which means that f.e. it cannot be weaved
+ by the aspects that are configured within the same deployment unit.
+ </td></tr></tbody></table></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ltw-rules.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ltw-specialcases.html">Next</a></td></tr><tr><td width="40%" align="left">Load-time Weaving Requirements&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="ltw.html">Up</a></td><td width="40%" align="right">&nbsp;Special cases</td></tr></table></div></body></html> \ No newline at end of file
diff --git a/org.aspectj.ajde/doc/adk15notebook/ltw-packaging.html b/org.aspectj.ajde/doc/adk15notebook/ltw-packaging.html
index ac4036b1a..929842ba5 100755
--- a/org.aspectj.ajde/doc/adk15notebook/ltw-packaging.html
+++ b/org.aspectj.ajde/doc/adk15notebook/ltw-packaging.html
@@ -1,5 +1,5 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Runtime Requirements for Load-time Weaving</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="ltw.html" title="Chapter 12. Load-Time Weaving"><link rel="previous" href="ltw-configuration.html" title="Configuration"><link rel="next" href="ltw-agents.html" title="Supported Agents"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Runtime Requirements for Load-time Weaving</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ltw-configuration.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 12. Load-Time Weaving</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ltw-agents.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="ltw-packaging"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ltw-packaging"></a>Runtime Requirements for Load-time Weaving</h2></div></div><p> To use LTW the <tt>aspectjweaver.jar</tt> library must be added to the
+ <title>Runtime Requirements for Load-time Weaving</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="ltw.html" title="Chapter 12. Load-Time Weaving"><link rel="previous" href="ltw-specialcases.html" title="Special cases"><link rel="next" href="ltw-agents.html" title="Supported Agents"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Runtime Requirements for Load-time Weaving</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ltw-specialcases.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 12. Load-Time Weaving</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ltw-agents.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="ltw-packaging"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ltw-packaging"></a>Runtime Requirements for Load-time Weaving</h2></div></div><p> To use LTW the <tt>aspectjweaver.jar</tt> library must be added to the
classpath. This contains the AspectJ 5 runtime, weaver, weaving class loader and
- weaving agents. It also contains the DTD for parsing XML weaving configuration files. </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ltw-configuration.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ltw-agents.html">Next</a></td></tr><tr><td width="40%" align="left">Configuration&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="ltw.html">Up</a></td><td width="40%" align="right">&nbsp;Supported Agents</td></tr></table></div></body></html> \ No newline at end of file
+ weaving agents. It also contains the DTD for parsing XML weaving configuration files. </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ltw-specialcases.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ltw-agents.html">Next</a></td></tr><tr><td width="40%" align="left">Special cases&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="ltw.html">Up</a></td><td width="40%" align="right">&nbsp;Supported Agents</td></tr></table></div></body></html> \ No newline at end of file
diff --git a/org.aspectj.ajde/doc/adk15notebook/ltw-rules.html b/org.aspectj.ajde/doc/adk15notebook/ltw-rules.html
index 37d48a428..09558f9b4 100755
--- a/org.aspectj.ajde/doc/adk15notebook/ltw-rules.html
+++ b/org.aspectj.ajde/doc/adk15notebook/ltw-rules.html
@@ -3,9 +3,9 @@
<title>Load-time Weaving Requirements</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="ltw.html" title="Chapter 12. Load-Time Weaving"><link rel="previous" href="ltw.html" title="Chapter 12. Load-Time Weaving"><link rel="next" href="ltw-configuration.html" title="Configuration"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Load-time Weaving Requirements</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ltw.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 12. Load-Time Weaving</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ltw-configuration.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="ltw-rules"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ltw-rules"></a>Load-time Weaving Requirements</h2></div></div><p> All load-time weaving is done in the context of a class loader, and hence the set of
aspects used for weaving and the types that can be woven are affected by the class
loader delegation model. This ensures that LTW complies with the Java 2 security model.
- The following rules govern the interaction of load-time weaving with class loading: </p><div class="orderedlist"><ol type="1"><li><a name="d0e4432"></a> All aspects to be used for weaving must be defined to the weaver before any
- types to be woven are loaded.</li><li><a name="d0e4434"></a> All abstract and concrete aspects visible to the weaver
+ The following rules govern the interaction of load-time weaving with class loading: </p><div class="orderedlist"><ol type="1"><li><a name="d0e4151"></a> All aspects to be used for weaving must be defined to the weaver before any
+ types to be woven are loaded.</li><li><a name="d0e4153"></a> All abstract and concrete aspects visible to the weaver
are available for extending (abstract aspects) and using for weaving.
A visible aspect is one defined by the
- weaving class loader or one of its parent class loaders.</li><li><a name="d0e4436"></a>A class loader may only weave classes that it defines. It may not weave
+ weaving class loader or one of its parent class loaders.</li><li><a name="d0e4155"></a>A class loader may only weave classes that it defines. It may not weave
classes loaded by a delegate or parent class loader.</li></ol></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ltw.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ltw-configuration.html">Next</a></td></tr><tr><td width="40%" align="left">Chapter 12. Load-Time Weaving&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="ltw.html">Up</a></td><td width="40%" align="right">&nbsp;Configuration</td></tr></table></div></body></html> \ No newline at end of file
diff --git a/org.aspectj.ajde/doc/adk15notebook/ltw-specialcases.html b/org.aspectj.ajde/doc/adk15notebook/ltw-specialcases.html
new file mode 100644
index 000000000..c25eb7c9e
--- /dev/null
+++ b/org.aspectj.ajde/doc/adk15notebook/ltw-specialcases.html
@@ -0,0 +1,13 @@
+<html><head>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ <title>Special cases</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="ltw.html" title="Chapter 12. Load-Time Weaving"><link rel="previous" href="ltw-configuration.html" title="Configuration"><link rel="next" href="ltw-packaging.html" title="Runtime Requirements for Load-time Weaving"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Special cases</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ltw-configuration.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 12. Load-Time Weaving</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ltw-packaging.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="ltw-specialcases"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ltw-specialcases"></a>Special cases</h2></div></div><p>
+ Those classes are not exposed to the LTW infrastructure, no matter
+ the configuration of the <tt>aop.xml</tt> file(s):
+ <div class="itemizedlist"><ul><li><a name="d0e4378"></a>All <tt>org.aspectj.*</tt> classes (and subpackages) - as those are needed by the infrastructure itself</li><li><a name="d0e4383"></a>All <tt>java.*</tt> and <tt>javax.*</tt> classes (and subpackages)</li><li><a name="d0e4391"></a>All <tt>sun.reflect.*</tt> classes - as those are JDK specific classes used when reflective calls occurs</li></ul></div>
+ </p><p>
+ Despite these restrictions, it is perfectly possible to match call join points for calls to these types providing the calling
+ class is exposed to the weaver. Subtypes of these excluded types that are exposed to the weaver may of course be woven.
+ </p><p>
+ Note that dynamic proxy representations are exposed to the LTW infrastructure and are not considered
+ a special case.
+ </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ltw-configuration.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ltw-packaging.html">Next</a></td></tr><tr><td width="40%" align="left">Configuration&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="ltw.html">Up</a></td><td width="40%" align="right">&nbsp;Runtime Requirements for Load-time Weaving</td></tr></table></div></body></html> \ No newline at end of file
diff --git a/org.aspectj.ajde/doc/adk15notebook/ltw.html b/org.aspectj.ajde/doc/adk15notebook/ltw.html
index 810446c68..d6b90994c 100755
--- a/org.aspectj.ajde/doc/adk15notebook/ltw.html
+++ b/org.aspectj.ajde/doc/adk15notebook/ltw.html
@@ -1,21 +1,21 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Chapter 12. Load-Time Weaving</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="previous" href="ch11s03.html" title="Tools"><link rel="next" href="ltw-rules.html" title="Load-time Weaving Requirements"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 12. Load-Time Weaving</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch11s03.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ltw-rules.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="ltw"></a>Chapter 12. Load-Time Weaving</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="ltw.html#ltw-introduction">Introduction</a></dt><dd><dl><dt><a href="ltw.html#d0e4415">Weaving class files more than once</a></dt></dl></dd><dt><a href="ltw-rules.html">Load-time Weaving Requirements</a></dt><dt><a href="ltw-configuration.html">Configuration</a></dt><dd><dl><dt><a href="ltw-configuration.html#d0e4443">Enabling Load-time Weaving</a></dt><dt><a href="ltw-configuration.html#d0e4471">Configuring Load-time Weaving with aop.xml files</a></dt><dt><a href="ltw-configuration.html#d0e4535">Configuring Load-time Weaving with Properties Files</a></dt><dt><a href="ltw-configuration.html#d0e4545">Weaver Options</a></dt></dl></dd><dt><a href="ltw-packaging.html">Runtime Requirements for Load-time Weaving</a></dt><dt><a href="ltw-agents.html">Supported Agents</a></dt><dd><dl><dt><a href="ltw-agents.html#d0e4637">JVMTI</a></dt><dt><a href="ltw-agents.html#d0e4644">JRockit</a></dt></dl></dd></dl></div><div class="sect1"><a name="ltw-introduction"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ltw-introduction"></a>Introduction</h2></div></div><p> The AspectJ 5 weaver takes class files as input and produces class files as output.
+ <title>Chapter 12. Load-Time Weaving</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="previous" href="ch11s03.html" title="Tools"><link rel="next" href="ltw-rules.html" title="Load-time Weaving Requirements"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 12. Load-Time Weaving</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch11s03.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ltw-rules.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="ltw"></a>Chapter 12. Load-Time Weaving</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="ltw.html#ltw-introduction">Introduction</a></dt><dd><dl><dt><a href="ltw.html#d0e4134">Weaving class files more than once</a></dt></dl></dd><dt><a href="ltw-rules.html">Load-time Weaving Requirements</a></dt><dt><a href="ltw-configuration.html">Configuration</a></dt><dd><dl><dt><a href="ltw-configuration.html#d0e4162">Enabling Load-time Weaving</a></dt><dt><a href="ltw-configuration.html#d0e4206">Configuring Load-time Weaving with aop.xml files</a></dt><dt><a href="ltw-configuration.html#d0e4277">Weaver Options</a></dt></dl></dd><dt><a href="ltw-specialcases.html">Special cases</a></dt><dt><a href="ltw-packaging.html">Runtime Requirements for Load-time Weaving</a></dt><dt><a href="ltw-agents.html">Supported Agents</a></dt><dd><dl><dt><a href="ltw-agents.html#d0e4412">JVMTI</a></dt><dt><a href="ltw-agents.html#d0e4419">JRockit with Java 1.3/1.4 (use JVMTI on Java 5)</a></dt></dl></dd></dl></div><div class="sect1"><a name="ltw-introduction"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ltw-introduction"></a>Introduction</h2></div></div><p> The AspectJ 5 weaver takes class files as input and produces class files as output.
The weaving process itself can take place at one of three different times: compile-time,
post-compile time, and load-time. The class files produced by the weaving process (and
hence the run-time behaviour of an application) are the same regardless of the approach
- chosen. </p><div class="itemizedlist"><ul><li><a name="d0e4407"></a> Compile-time weaving is the simplest approach. When you have the source code
+ chosen. </p><div class="itemizedlist"><ul><li><a name="d0e4126"></a> Compile-time weaving is the simplest approach. When you have the source code
for an application, ajc will compile from source and produce woven class files as
output. The invocation of the weaver is integral to the ajc compilation process. The
- aspects themselves may be in source or binary form. </li><li><a name="d0e4409"></a> Post-compile weaving (also sometimes called binary weaving) is used to weave
+ aspects themselves may be in source or binary form. </li><li><a name="d0e4128"></a> Post-compile weaving (also sometimes called binary weaving) is used to weave
existing class files and JAR files. As with compile-time weaving,
- the aspects used for weaving may be in source or binary form. </li><li><a name="d0e4411"></a> Load-time weaving (LTW) is simply binary weaving defered until the point that
+ the aspects used for weaving may be in source or binary form. </li><li><a name="d0e4130"></a> Load-time weaving (LTW) is simply binary weaving defered until the point that
a class loader loads a class file and defines the class to the JVM. To support this,
one or more "weaving class loaders", either provided explicitly by the run-time
environment or enabled through a "weaving agent" are required. </li></ul></div><p> You may also hear the term "run-time weaving". We define this as the weaving of
classes that have already been defined to the JVM (without reloading those
classes). AspectJ 5 does not provide explicit support for run-time weaving although
- simple coding patterns can support dynamically enabling and disabling advice in aspects. </p><div class="sect2"><a name="d0e4415"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4415"></a>Weaving class files more than once</h3></div></div><p> By default a class file that has been woven by the AspectJ compiler cannot
+ simple coding patterns can support dynamically enabling and disabling advice in aspects. </p><div class="sect2"><a name="d0e4134"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4134"></a>Weaving class files more than once</h3></div></div><p> By default a class file that has been woven by the AspectJ compiler cannot
subsequently be rewoven (passed as input to the weaver). If you are developing
AspectJ applications that are to be used in a load-time weaving environment, you
need to specify the <tt>-Xreweavable</tt> compiler option when building
diff --git a/org.aspectj.ajde/doc/adk15notebook/miscellaneous.html b/org.aspectj.ajde/doc/adk15notebook/miscellaneous.html
index c5609b9dd..8fbef4bb1 100755
--- a/org.aspectj.ajde/doc/adk15notebook/miscellaneous.html
+++ b/org.aspectj.ajde/doc/adk15notebook/miscellaneous.html
@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Chapter 11. Other Changes in AspectJ 5</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="previous" href="reflection.html" title="Chapter 10. New Reflection Interfaces"><link rel="next" href="declare-soft.html" title="Declare Soft"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 11. Other Changes in AspectJ 5</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="reflection.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="declare-soft.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="miscellaneous"></a>Chapter 11. Other Changes in AspectJ 5</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="miscellaneous.html#d0e4336">Pointcuts</a></dt><dd><dl><dt><a href="miscellaneous.html#d0e4339">Binding of formals</a></dt><dt><a href="miscellaneous.html#d0e4348">Additional lint warnings</a></dt></dl></dd><dt><a href="declare-soft.html">Declare Soft</a></dt><dt><a href="ch11s03.html">Tools</a></dt><dd><dl><dt><a href="ch11s03.html#d0e4393">Aspectpath</a></dt></dl></dd></dl></div><div class="sect1"><a name="d0e4336"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e4336"></a>Pointcuts</h2></div></div><div class="sect2"><a name="d0e4339"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4339"></a>Binding of formals</h3></div></div><p>
+ <title>Chapter 11. Other Changes in AspectJ 5</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="previous" href="reflection.html" title="Chapter 10. New Reflection Interfaces"><link rel="next" href="declare-soft.html" title="Declare Soft"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 11. Other Changes in AspectJ 5</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="reflection.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="declare-soft.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="miscellaneous"></a>Chapter 11. Other Changes in AspectJ 5</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="miscellaneous.html#d0e4055">Pointcuts</a></dt><dd><dl><dt><a href="miscellaneous.html#d0e4058">Binding of formals</a></dt><dt><a href="miscellaneous.html#d0e4067">Additional lint warnings</a></dt></dl></dd><dt><a href="declare-soft.html">Declare Soft</a></dt><dt><a href="ch11s03.html">Tools</a></dt><dd><dl><dt><a href="ch11s03.html#d0e4112">Aspectpath</a></dt></dl></dd></dl></div><div class="sect1"><a name="d0e4055"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e4055"></a>Pointcuts</h2></div></div><div class="sect2"><a name="d0e4058"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4058"></a>Binding of formals</h3></div></div><p>
AspectJ 5 is more liberal than AspectJ 1.2.1 in accepting pointcut expressions
that bind context variables in more than one location. For example, AspectJ
1.2.1 does not allow:
@@ -13,7 +13,7 @@
must be mutually exclusive. In the above example for instance, no join point
can be both an execution join point and a set join point so the two branches
are mutually exclusive.
- </p></div><div class="sect2"><a name="d0e4348"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4348"></a>Additional lint warnings</h3></div></div><p>
+ </p></div><div class="sect2"><a name="d0e4067"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4067"></a>Additional lint warnings</h3></div></div><p>
Discuss detection of common errors -&gt; warning/error, eg. conjunction of more than one
kind of join point. Differing numbers of args in method signature / args / @args /
@parameters.
diff --git a/org.aspectj.ajde/doc/adk15notebook/pertypewithin.html b/org.aspectj.ajde/doc/adk15notebook/pertypewithin.html
index e07ecd651..33108d4d7 100755
--- a/org.aspectj.ajde/doc/adk15notebook/pertypewithin.html
+++ b/org.aspectj.ajde/doc/adk15notebook/pertypewithin.html
@@ -57,33 +57,12 @@
Then one aspect instance will be created for each type within
<tt>org.xyz..*</tt>. For each aspect instance, the
after returning advice will match only the execution of constructors
- in the type that the aspect is an instance of. The net result is that
+ within the matched per-type-within type. The net result is that
the aspect tracks all known instances of each type within
<tt>org.xyz..*</tt>. To get access to the instances, a
programmer can simply write
<tt>InstanceTracking.aspectOf(org.xyz.SomeType.class).getInstances()</tt>.
</p><p>
- A <tt>pertypewithin</tt> aspect may optionally be declared
- with a single generic type parameter. In this case, for each type
- <tt>T</tt> matched by the type pattern, the aspect instance
- created will be of type <tt>PerTypeWithinAspect&lt;T&gt;</tt>.
- So the previous example could also be written as:
- </p><pre class="programlisting">
- public aspect InstanceTracking&lt;T&gt; pertypewithin(org.xyz..*) {
-
- // use WeakHashMap for auto-garbage collection of keys
- private Map&lt;T, Boolean&gt; instances = new WeakHashMap&lt;T, Boolean&gt;();
-
- after(T t) returning : execution(new(..)) &amp;&amp; this(t) {
- instances.put(t, true);
- }
-
- public Set&lt;T&gt; getInstances() {
- return instances.keySet();
- }
-
- }
- </pre><p>
The <tt>pertypewithin</tt> aspect instantiation model should
be used when the implementation of a crosscutting concern requires that
some state be maintained for each type in a set of types. To maintain
diff --git a/org.aspectj.ajde/doc/adk15notebook/printable.html b/org.aspectj.ajde/doc/adk15notebook/printable.html
index 4cfa376ef..6644b8eaa 100755
--- a/org.aspectj.ajde/doc/adk15notebook/printable.html
+++ b/org.aspectj.ajde/doc/adk15notebook/printable.html
@@ -1,7 +1,7 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>The AspectJTM 5 Development Kit Developer's Notebook</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" id="d0e1"><div class="titlepage"><div><h1 class="title"><a name="d0e1"></a>The AspectJ<sup>TM</sup> 5 Development Kit Developer's Notebook</h1></div><div><h3 class="author">the AspectJ Team</h3></div><div><div class="legalnotice"><p>
- Copyright (c) 2004 Contributors,
+ Copyright (c) 2004, 2005 Contributors,
All rights reserved.
</p></div></div><div><div class="abstract"><p><a name="d0e15"></a><b>Abstract</b></p><p>
This guide describes the changes to the AspectJ language
@@ -18,7 +18,7 @@
have more confidence in the design will be implemented earlier, providing a
framework for user feedback and direction setting on features for which the
use cases are less obvious at time of writing.
- </p></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>1. <a href="#jpsigs">Join Point Signatures</a></dt><dd><dl><dt><a href="#join-point-matching">Join Point Matching</a></dt><dt><a href="#join-point-signatures">Join Point Signatures</a></dt><dd><dl><dt><a href="#d0e246">Method call join point signatures</a></dt><dt><a href="#d0e351">Method execution join point signatures</a></dt><dt><a href="#d0e373">Field get and set join point signatures</a></dt></dl></dd><dt><a href="#join-point-modifiers">Join Point Modifiers</a></dt><dt><a href="#join-point-matching-summary">Summary of Join Point Matching</a></dt></dl></dd><dt>2. <a href="#annotations">Annotations</a></dt><dd><dl><dt><a href="#annotations-inJava5">Annotations in Java 5</a></dt><dd><dl><dt><a href="#d0e578">Using Annotations</a></dt><dt><a href="#d0e624">Retention Policies</a></dt><dt><a href="#d0e659">Accessing Annotations at Runtime</a></dt><dt><a href="#d0e694">Annotation Inheritance</a></dt></dl></dd><dt><a href="#annotations-aspectmembers">Annotating Aspects</a></dt><dt><a href="#annotations-pointcuts-and-advice">Join Point Matching based on Annotations</a></dt><dd><dl><dt><a href="#d0e782">Annotation Patterns</a></dt><dt><a href="#d0e867">Type Patterns</a></dt><dt><a href="#signaturePatterns">Signature Patterns</a></dt><dt><a href="#d0e1121">Example Pointcuts</a></dt><dt><a href="#d0e1194">Runtime type matching and context exposure</a></dt><dt><a href="#d0e1421">Package and Parameter Annotations</a></dt><dt><a href="#d0e1431">Annotation Inheritance and pointcut matching</a></dt><dt><a href="#d0e1463">Limitations</a></dt></dl></dd><dt><a href="#annotations-decp">Using Annotations with declare statements</a></dt><dd><dl><dt><a href="#d0e1478">Declare error and declare warning</a></dt><dt><a href="#d0e1493">declare parents</a></dt><dt><a href="#d0e1541">declare precedence</a></dt></dl></dd><dt><a href="#annotations-declare">Declare Annotation</a></dt><dt><a href="#annotations-itds">Inter-type Declarations</a></dt></dl></dd><dt>3. <a href="#generics">Generics</a></dt><dd><dl><dt><a href="#generics-inJava5">Generics in Java 5</a></dt><dd><dl><dt><a href="#d0e1673">Declaring Generic Types</a></dt><dt><a href="#d0e1804">Using Generic and Parameterized Types</a></dt><dt><a href="#d0e1948">Subtypes, Supertypes, and Assignability</a></dt><dt><a href="#d0e2051">Generic Methods and Constructors</a></dt><dt><a href="#d0e2069">Erasure</a></dt></dl></dd><dt><a href="#generics-inAspectJ5">Generics in AspectJ 5</a></dt><dd><dl><dt><a href="#d0e2095">Matching generic and parameterized types in type patterns</a></dt><dt><a href="#d0e2295">Signature patterns</a></dt><dt><a href="#d0e2378">Pointcuts</a></dt><dt><a href="#d0e3065">Inter-type Declarations</a></dt><dt><a href="#d0e3186">Declare Parents</a></dt><dt><a href="#d0e3246">Declare Soft</a></dt><dt><a href="#d0e3254">Parameterized Aspects</a></dt></dl></dd></dl></dd><dt>4. <a href="#autoboxing">Autoboxing and Unboxing</a></dt><dd><dl><dt><a href="#boxing-inJava5">Autoboxing and Unboxing in Java 5</a></dt><dt><a href="#autoboxing-in-aspectj5">Autoboxing and Join Point matching in AspectJ 5</a></dt><dt><a href="#autoboxing-and-method-dispatch">Inter-type method declarations and method dispatch</a></dt></dl></dd><dt>5. <a href="#covariance">Covariance</a></dt><dd><dl><dt><a href="#covariance-inJava5">Covariance in Java 5</a></dt><dt><a href="#covariance-and-join-point-matching">Covariant methods and Join Point matching</a></dt></dl></dd><dt>6. <a href="#varargs">Varargs</a></dt><dd><dl><dt><a href="#varargs-inJava5">Variable-length Argument Lists in Java 5</a></dt><dd><dl><dt><a href="#d0e3620">Calling Methods and Constructors with variable-length arguments</a></dt></dl></dd><dt><a href="#varargs-in-pcds">Using Variable-length arguments in advice and pointcut expressions</a></dt><dd><dl><dt><a href="#d0e3654">Matching signatures based on variable length argument types</a></dt><dt><a href="#d0e3756">Exposing variable-length arguments as context in pointcuts and advice</a></dt></dl></dd></dl></dd><dt>7. <a href="#enumeratedtypes">Enumerated Types</a></dt><dd><dl><dt><a href="#enums-in-java5">Enumerated Types in Java 5</a></dt><dt><a href="#enums-in-aspectj5">Enumerated Types in AspectJ 5</a></dt></dl></dd><dt>8. <a href="#pertypewithin">The pertypewithin Aspect Instantiation Model</a></dt><dt>9. <a href="#ataspectj">An Annotation Based Development Style</a></dt><dd><dl><dt><a href="#ataspectj-intro">Introduction</a></dt><dt><a href="#ataspectj-aspects">Aspect Declarations</a></dt><dt><a href="#ataspectj-pcadvice">Pointcuts and Advice</a></dt><dd><dl><dt><a href="#d0e3980">Pointcuts</a></dt><dt><a href="#d0e4101">Advice</a></dt></dl></dd><dt><a href="#ataspectj-itds">Inter-type Declarations</a></dt><dt><a href="#ataspectj-declare">Declare statements</a></dt><dt><a href="#ataspectj-aspectof">aspectOf() and hasAspect() methods</a></dt></dl></dd><dt>10. <a href="#reflection">New Reflection Interfaces</a></dt><dd><dl><dt><a href="#reflection_api">The Aspect Class</a></dt></dl></dd><dt>11. <a href="#miscellaneous">Other Changes in AspectJ 5</a></dt><dd><dl><dt><a href="#d0e4336">Pointcuts</a></dt><dd><dl><dt><a href="#d0e4339">Binding of formals</a></dt><dt><a href="#d0e4348">Additional lint warnings</a></dt></dl></dd><dt><a href="#declare-soft">Declare Soft</a></dt><dt><a href="#d0e4390">Tools</a></dt><dd><dl><dt><a href="#d0e4393">Aspectpath</a></dt></dl></dd></dl></dd><dt>12. <a href="#ltw">Load-Time Weaving</a></dt><dd><dl><dt><a href="#ltw-introduction">Introduction</a></dt><dd><dl><dt><a href="#d0e4415">Weaving class files more than once</a></dt></dl></dd><dt><a href="#ltw-rules">Load-time Weaving Requirements</a></dt><dt><a href="#ltw-configuration">Configuration</a></dt><dd><dl><dt><a href="#d0e4443">Enabling Load-time Weaving</a></dt><dt><a href="#d0e4471">Configuring Load-time Weaving with aop.xml files</a></dt><dt><a href="#d0e4535">Configuring Load-time Weaving with Properties Files</a></dt><dt><a href="#d0e4545">Weaver Options</a></dt></dl></dd><dt><a href="#ltw-packaging">Runtime Requirements for Load-time Weaving</a></dt><dt><a href="#ltw-agents">Supported Agents</a></dt><dd><dl><dt><a href="#d0e4637">JVMTI</a></dt><dt><a href="#d0e4644">JRockit</a></dt></dl></dd></dl></dd><dt>A. <a href="#grammar">A Grammar for the AspectJ 5 Language</a></dt></dl></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="jpsigs"></a>Chapter 1. Join Point Signatures</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#join-point-matching">Join Point Matching</a></dt><dt><a href="#join-point-signatures">Join Point Signatures</a></dt><dd><dl><dt><a href="#d0e246">Method call join point signatures</a></dt><dt><a href="#d0e351">Method execution join point signatures</a></dt><dt><a href="#d0e373">Field get and set join point signatures</a></dt></dl></dd><dt><a href="#join-point-modifiers">Join Point Modifiers</a></dt><dt><a href="#join-point-matching-summary">Summary of Join Point Matching</a></dt></dl></div><p>
+ </p></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>1. <a href="#jpsigs">Join Point Signatures</a></dt><dd><dl><dt><a href="#join-point-matching">Join Point Matching</a></dt><dt><a href="#join-point-signatures">Join Point Signatures</a></dt><dd><dl><dt><a href="#d0e246">Method call join point signatures</a></dt><dt><a href="#d0e351">Method execution join point signatures</a></dt><dt><a href="#d0e373">Field get and set join point signatures</a></dt></dl></dd><dt><a href="#join-point-modifiers">Join Point Modifiers</a></dt><dt><a href="#join-point-matching-summary">Summary of Join Point Matching</a></dt></dl></dd><dt>2. <a href="#annotations">Annotations</a></dt><dd><dl><dt><a href="#annotations-inJava5">Annotations in Java 5</a></dt><dd><dl><dt><a href="#d0e578">Using Annotations</a></dt><dt><a href="#d0e624">Retention Policies</a></dt><dt><a href="#d0e659">Accessing Annotations at Runtime</a></dt><dt><a href="#d0e694">Annotation Inheritance</a></dt></dl></dd><dt><a href="#annotations-aspectmembers">Annotating Aspects</a></dt><dt><a href="#annotations-pointcuts-and-advice">Join Point Matching based on Annotations</a></dt><dd><dl><dt><a href="#d0e782">Annotation Patterns</a></dt><dt><a href="#d0e867">Type Patterns</a></dt><dt><a href="#signaturePatterns">Signature Patterns</a></dt><dt><a href="#d0e1121">Example Pointcuts</a></dt><dt><a href="#d0e1194">Runtime type matching and context exposure</a></dt><dt><a href="#d0e1421">Package and Parameter Annotations</a></dt><dt><a href="#d0e1431">Annotation Inheritance and pointcut matching</a></dt><dt><a href="#d0e1472">Limitations</a></dt></dl></dd><dt><a href="#annotations-decp">Using Annotations with declare statements</a></dt><dd><dl><dt><a href="#d0e1487">Declare error and declare warning</a></dt><dt><a href="#d0e1502">declare parents</a></dt><dt><a href="#d0e1550">declare precedence</a></dt></dl></dd><dt><a href="#annotations-declare">Declare Annotation</a></dt><dt><a href="#annotations-itds">Inter-type Declarations</a></dt></dl></dd><dt>3. <a href="#generics">Generics</a></dt><dd><dl><dt><a href="#generics-inJava5">Generics in Java 5</a></dt><dd><dl><dt><a href="#d0e1682">Declaring Generic Types</a></dt><dt><a href="#d0e1813">Using Generic and Parameterized Types</a></dt><dt><a href="#d0e1957">Subtypes, Supertypes, and Assignability</a></dt><dt><a href="#d0e2060">Generic Methods and Constructors</a></dt><dt><a href="#d0e2078">Erasure</a></dt></dl></dd><dt><a href="#generics-inAspectJ5">Generics in AspectJ 5</a></dt><dd><dl><dt><a href="#d0e2104">Matching generic and parameterized types in pointcut expressions</a></dt><dt><a href="#d0e2785">Inter-type Declarations</a></dt><dt><a href="#d0e2898">Declare Parents</a></dt><dt><a href="#d0e2931">Declare Soft</a></dt><dt><a href="#d0e2939">Generic Aspects</a></dt></dl></dd></dl></dd><dt>4. <a href="#autoboxing">Autoboxing and Unboxing</a></dt><dd><dl><dt><a href="#boxing-inJava5">Autoboxing and Unboxing in Java 5</a></dt><dt><a href="#autoboxing-in-aspectj5">Autoboxing and Join Point matching in AspectJ 5</a></dt><dt><a href="#autoboxing-and-method-dispatch">Inter-type method declarations and method dispatch</a></dt></dl></dd><dt>5. <a href="#covariance">Covariance</a></dt><dd><dl><dt><a href="#covariance-inJava5">Covariance in Java 5</a></dt><dt><a href="#covariance-and-join-point-matching">Covariant methods and Join Point matching</a></dt></dl></dd><dt>6. <a href="#varargs">Varargs</a></dt><dd><dl><dt><a href="#varargs-inJava5">Variable-length Argument Lists in Java 5</a></dt><dd><dl><dt><a href="#d0e3303">Calling Methods and Constructors with variable-length arguments</a></dt></dl></dd><dt><a href="#varargs-in-pcds">Using Variable-length arguments in advice and pointcut expressions</a></dt><dd><dl><dt><a href="#d0e3337">Matching signatures based on variable length argument types</a></dt><dt><a href="#d0e3439">Exposing variable-length arguments as context in pointcuts and advice</a></dt></dl></dd></dl></dd><dt>7. <a href="#enumeratedtypes">Enumerated Types</a></dt><dd><dl><dt><a href="#enums-in-java5">Enumerated Types in Java 5</a></dt><dt><a href="#enums-in-aspectj5">Enumerated Types in AspectJ 5</a></dt></dl></dd><dt>8. <a href="#pertypewithin">The pertypewithin Aspect Instantiation Model</a></dt><dt>9. <a href="#ataspectj">An Annotation Based Development Style</a></dt><dd><dl><dt><a href="#ataspectj-intro">Introduction</a></dt><dt><a href="#ataspectj-aspects">Aspect Declarations</a></dt><dd><dl><dt><a href="#d0e3640">Limitations</a></dt></dl></dd><dt><a href="#ataspectj-pcadvice">Pointcuts and Advice</a></dt><dd><dl><dt><a href="#d0e3657">Pointcuts</a></dt><dt><a href="#d0e3796">Advice</a></dt></dl></dd><dt><a href="#ataspectj-itds">Inter-type Declarations</a></dt><dt><a href="#ataspectj-declare">Declare statements</a></dt><dt><a href="#ataspectj-aspectof">aspectOf() and hasAspect() methods</a></dt></dl></dd><dt>10. <a href="#reflection">New Reflection Interfaces</a></dt><dd><dl><dt><a href="#reflection_api">The Aspect Class</a></dt></dl></dd><dt>11. <a href="#miscellaneous">Other Changes in AspectJ 5</a></dt><dd><dl><dt><a href="#d0e4055">Pointcuts</a></dt><dd><dl><dt><a href="#d0e4058">Binding of formals</a></dt><dt><a href="#d0e4067">Additional lint warnings</a></dt></dl></dd><dt><a href="#declare-soft">Declare Soft</a></dt><dt><a href="#d0e4109">Tools</a></dt><dd><dl><dt><a href="#d0e4112">Aspectpath</a></dt></dl></dd></dl></dd><dt>12. <a href="#ltw">Load-Time Weaving</a></dt><dd><dl><dt><a href="#ltw-introduction">Introduction</a></dt><dd><dl><dt><a href="#d0e4134">Weaving class files more than once</a></dt></dl></dd><dt><a href="#ltw-rules">Load-time Weaving Requirements</a></dt><dt><a href="#ltw-configuration">Configuration</a></dt><dd><dl><dt><a href="#d0e4162">Enabling Load-time Weaving</a></dt><dt><a href="#d0e4206">Configuring Load-time Weaving with aop.xml files</a></dt><dt><a href="#d0e4277">Weaver Options</a></dt></dl></dd><dt><a href="#ltw-specialcases">Special cases</a></dt><dt><a href="#ltw-packaging">Runtime Requirements for Load-time Weaving</a></dt><dt><a href="#ltw-agents">Supported Agents</a></dt><dd><dl><dt><a href="#d0e4412">JVMTI</a></dt><dt><a href="#d0e4419">JRockit with Java 1.3/1.4 (use JVMTI on Java 5)</a></dt></dl></dd></dl></dd><dt>A. <a href="#grammar">A Grammar for the AspectJ 5 Language</a></dt></dl></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="jpsigs"></a>Chapter 1. Join Point Signatures</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#join-point-matching">Join Point Matching</a></dt><dt><a href="#join-point-signatures">Join Point Signatures</a></dt><dd><dl><dt><a href="#d0e246">Method call join point signatures</a></dt><dt><a href="#d0e351">Method execution join point signatures</a></dt><dt><a href="#d0e373">Field get and set join point signatures</a></dt></dl></dd><dt><a href="#join-point-modifiers">Join Point Modifiers</a></dt><dt><a href="#join-point-matching-summary">Summary of Join Point Matching</a></dt></dl></div><p>
Many of the extensions to the AspectJ language to address the new features of
Java 5 are derived from a simple set of principles for join point
matching. In this section, we outline these principles as a foundation
@@ -242,7 +242,7 @@
calls <tt>t.m("hello")</tt> and <tt>s.m("hello")</tt>.
It does not match the call <tt>p.m("hello")</tt> since the
signature pattern does not match any signature for the call join point
- of m in P.</p></div></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="annotations"></a>Chapter 2. Annotations</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#annotations-inJava5">Annotations in Java 5</a></dt><dd><dl><dt><a href="#d0e578">Using Annotations</a></dt><dt><a href="#d0e624">Retention Policies</a></dt><dt><a href="#d0e659">Accessing Annotations at Runtime</a></dt><dt><a href="#d0e694">Annotation Inheritance</a></dt></dl></dd><dt><a href="#annotations-aspectmembers">Annotating Aspects</a></dt><dt><a href="#annotations-pointcuts-and-advice">Join Point Matching based on Annotations</a></dt><dd><dl><dt><a href="#d0e782">Annotation Patterns</a></dt><dt><a href="#d0e867">Type Patterns</a></dt><dt><a href="#signaturePatterns">Signature Patterns</a></dt><dt><a href="#d0e1121">Example Pointcuts</a></dt><dt><a href="#d0e1194">Runtime type matching and context exposure</a></dt><dt><a href="#d0e1421">Package and Parameter Annotations</a></dt><dt><a href="#d0e1431">Annotation Inheritance and pointcut matching</a></dt><dt><a href="#d0e1463">Limitations</a></dt></dl></dd><dt><a href="#annotations-decp">Using Annotations with declare statements</a></dt><dd><dl><dt><a href="#d0e1478">Declare error and declare warning</a></dt><dt><a href="#d0e1493">declare parents</a></dt><dt><a href="#d0e1541">declare precedence</a></dt></dl></dd><dt><a href="#annotations-declare">Declare Annotation</a></dt><dt><a href="#annotations-itds">Inter-type Declarations</a></dt></dl></div><div class="sect1"><a name="annotations-inJava5"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="annotations-inJava5"></a>Annotations in Java 5</h2></div></div><p>
+ of m in P.</p></div></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="annotations"></a>Chapter 2. Annotations</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#annotations-inJava5">Annotations in Java 5</a></dt><dd><dl><dt><a href="#d0e578">Using Annotations</a></dt><dt><a href="#d0e624">Retention Policies</a></dt><dt><a href="#d0e659">Accessing Annotations at Runtime</a></dt><dt><a href="#d0e694">Annotation Inheritance</a></dt></dl></dd><dt><a href="#annotations-aspectmembers">Annotating Aspects</a></dt><dt><a href="#annotations-pointcuts-and-advice">Join Point Matching based on Annotations</a></dt><dd><dl><dt><a href="#d0e782">Annotation Patterns</a></dt><dt><a href="#d0e867">Type Patterns</a></dt><dt><a href="#signaturePatterns">Signature Patterns</a></dt><dt><a href="#d0e1121">Example Pointcuts</a></dt><dt><a href="#d0e1194">Runtime type matching and context exposure</a></dt><dt><a href="#d0e1421">Package and Parameter Annotations</a></dt><dt><a href="#d0e1431">Annotation Inheritance and pointcut matching</a></dt><dt><a href="#d0e1472">Limitations</a></dt></dl></dd><dt><a href="#annotations-decp">Using Annotations with declare statements</a></dt><dd><dl><dt><a href="#d0e1487">Declare error and declare warning</a></dt><dt><a href="#d0e1502">declare parents</a></dt><dt><a href="#d0e1550">declare precedence</a></dt></dl></dd><dt><a href="#annotations-declare">Declare Annotation</a></dt><dt><a href="#annotations-itds">Inter-type Declarations</a></dt></dl></div><div class="sect1"><a name="annotations-inJava5"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="annotations-inJava5"></a>Annotations in Java 5</h2></div></div><p>
This section provides the essential information about annotations in
Java 5 needed to understand how annotations are treated in AspectJ 5.
For a full introduction to annotations in Java, please see the
@@ -818,20 +818,24 @@
aspect X {
- pointcut annotatedMethodCall() :
- call(@SomeAnnotation * C1.aMethod());
+ pointcut annotatedC2MethodCall() :
+ call(@SomeAnnotation * C2.aMethod());
- pointcut c1MethodCall() :
- call(* C1.aMethod());
+ pointcut annotatedMethodCall() :
+ call(@SomeAnnotation * aMethod());
}
</pre><p>
- The pointcut <tt>annotatedMethodCall</tt> will match the call
- to <tt>c1.aMethod()</tt>, but not the call to
- <tt>c2.aMethod()</tt>.
+ The pointcut <tt>annotatedC2MethodCall</tt> will not match anything
+ since the definition of <tt>aMethod</tt> in <tt>C2</tt>
+ does not have the annotation.
</p><p>
The pointcut <tt>c1MethodCall</tt> matches both
- <tt>c1.aMethod()</tt> and <tt>c2.aMethod()</tt>.
- </p></div><div class="sect2"><a name="d0e1463"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1463"></a>Limitations</h3></div></div><p>
+ <tt>c1.aMethod()</tt> and <tt>c2.aMethod()</tt>. The call
+ to <tt>c2.aMethod</tt> is matched because the call join point has
+ multiple signatures (<tt>@SomeAnnotation C1.aMethod()</tt> and
+ <tt>C2.aMethod()</tt>), and the former of those signatures is
+ exactly matched by the pattern.
+ </p></div><div class="sect2"><a name="d0e1472"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1472"></a>Limitations</h3></div></div><p>
It would be useful to be able to match join points based on
annotation values, rather than merely the presence of a
class-file retention annotation of a given type. This facility may be supported in a future version of AspectJ, by expanding the
@@ -839,7 +843,7 @@
annotations with runtime retention can be done by exposing the annotation value
as a pointcut parameter and then using an <tt>if</tt> pointcut expression
to test the value.
- </p></div></div><div class="sect1"><a name="annotations-decp"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="annotations-decp"></a>Using Annotations with declare statements</h2></div></div><div class="sect2"><a name="d0e1478"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1478"></a>Declare error and declare warning</h3></div></div><p>
+ </p></div></div><div class="sect1"><a name="annotations-decp"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="annotations-decp"></a>Using Annotations with declare statements</h2></div></div><div class="sect2"><a name="d0e1487"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1487"></a>Declare error and declare warning</h3></div></div><p>
Since pointcut expressions in AspectJ 5 support join point matching based
on annotations, this facility can be exploited when writing
<tt>declare warning</tt> and <tt>declare error</tt>
@@ -852,7 +856,7 @@
declare error : call(* org.xyz.model.*.*(..)) &amp;&amp;
!@within(Trusted)
: "Untrusted code should not call the model classes directly";
- </pre></div><div class="sect2"><a name="d0e1493"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1493"></a>declare parents</h3></div></div><p>
+ </pre></div><div class="sect2"><a name="d0e1502"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1502"></a>declare parents</h3></div></div><p>
The general form of a <tt>declare parents</tt> statement is:
</p><pre class="programlisting">
declare parents : TypePattern extends Type;
@@ -862,10 +866,10 @@
specification, it is now possible to match types based on the presence
of annotations <span class="emphasis"><i>with either class-file or runtime retention</i></span>.
For example:
- </p><div class="variablelist"><dl><dt><a name="d0e1509"></a><span class="term">declare parents : (@Secured *) implements SecuredObject;</span></dt><dd><p><a name="d0e1512"></a>
+ </p><div class="variablelist"><dl><dt><a name="d0e1518"></a><span class="term">declare parents : (@Secured *) implements SecuredObject;</span></dt><dd><p><a name="d0e1521"></a>
All types with the <tt>@Secured</tt> annotation
implement the <tt>SecuredObject</tt> inteface.
- </p></dd><dt><a name="d0e1521"></a><span class="term">declare parents : (@Secured BankAccount+) implements SecuredObject;</span></dt><dd><p><a name="d0e1524"></a>
+ </p></dd><dt><a name="d0e1530"></a><span class="term">declare parents : (@Secured BankAccount+) implements SecuredObject;</span></dt><dd><p><a name="d0e1533"></a>
The subset of types drawn from the <tt>BankAccount</tt> type and any subtype of
<tt>BankAccount</tt>, where the
<tt>@Secured</tt> annotation is present, implement the
@@ -874,14 +878,14 @@
statement. If an annotation type is named explicitly as the target of a
declare parents statement, a compilation error will result. If an annotation
type is matched by a non-explicit type pattern used in a declare parents
- statement it will be ignored (and an XLint warning issued).</p></div><div class="sect2"><a name="d0e1541"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1541"></a>declare precedence</h3></div></div><p>
+ statement it will be ignored (and an XLint warning issued).</p></div><div class="sect2"><a name="d0e1550"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1550"></a>declare precedence</h3></div></div><p>
The general form of a declare precedence statement is:
</p><pre class="programlisting">
declare precedence : TypePatList;
</pre><p>
AspectJ 5 allows the type patterns in the list to include annotation information
as part of the pattern specification. For example:
- </p><div class="variablelist"><dl><dt><a name="d0e1551"></a><span class="term">declare precedence : (@Security *),*;</span></dt><dd><p><a name="d0e1554"></a>
+ </p><div class="variablelist"><dl><dt><a name="d0e1560"></a><span class="term">declare precedence : (@Security *),*;</span></dt><dd><p><a name="d0e1563"></a>
All aspects with the <tt>@Security</tt> annotation
take precedence over any other aspects in the system. (Or, more
informally, all security-related aspects take precedence).
@@ -899,24 +903,24 @@
MethodPattern |
ConstructorPattern |
FieldPattern
- </pre><p>The following examples illustrate the use of <tt>declare annotation</tt>.</p><div class="variablelist"><dl><dt><a name="d0e1611"></a><span class="term">declare @type : org.xyz.model..* : @BusinessDomain ;</span></dt><dd><p><a name="d0e1614"></a>
+ </pre><p>The following examples illustrate the use of <tt>declare annotation</tt>.</p><div class="variablelist"><dl><dt><a name="d0e1620"></a><span class="term">declare @type : org.xyz.model..* : @BusinessDomain ;</span></dt><dd><p><a name="d0e1623"></a>
All types defined in a package with the prefix <tt>org.xyz.model</tt>
have the <tt>@BusinessDomain</tt> annotation.
- </p></dd><dt><a name="d0e1623"></a><span class="term">declare @method : public * BankAccount+.*(..) : @Secured(role="supervisor")</span></dt><dd><p><a name="d0e1626"></a>
+ </p></dd><dt><a name="d0e1632"></a><span class="term">declare @method : public * BankAccount+.*(..) : @Secured(role="supervisor")</span></dt><dd><p><a name="d0e1635"></a>
All public methods in <tt>BankAccount</tt> and its subtypes have the
annotation <tt>@Secured(role="supervisor")</tt>.
- </p></dd><dt><a name="d0e1635"></a><span class="term">declare @constructor : BankAccount+.new(..) : @Secured(role="supervisor")</span></dt><dd><p><a name="d0e1638"></a>
+ </p></dd><dt><a name="d0e1644"></a><span class="term">declare @constructor : BankAccount+.new(..) : @Secured(role="supervisor")</span></dt><dd><p><a name="d0e1647"></a>
All constructors in <tt>BankAccount</tt> and its subtypes have the
annotation <tt>@Secured(role="supervisor")</tt>.
- </p></dd><dt><a name="d0e1647"></a><span class="term">declare @field : * DAO+.* : @Persisted;</span></dt><dd><p><a name="d0e1650"></a>
+ </p></dd><dt><a name="d0e1656"></a><span class="term">declare @field : * DAO+.* : @Persisted;</span></dt><dd><p><a name="d0e1659"></a>
All fields defined in <tt>DAO</tt> or its subtypes have the
<tt>@Persisted</tt> annotation.
- </p></dd></dl></div></div><div class="sect1"><a name="annotations-itds"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="annotations-itds"></a>Inter-type Declarations</h2></div></div><p>An annotation type may not be the target of an inter-type declaration.</p></div></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="generics"></a>Chapter 3. Generics</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#generics-inJava5">Generics in Java 5</a></dt><dd><dl><dt><a href="#d0e1673">Declaring Generic Types</a></dt><dt><a href="#d0e1804">Using Generic and Parameterized Types</a></dt><dt><a href="#d0e1948">Subtypes, Supertypes, and Assignability</a></dt><dt><a href="#d0e2051">Generic Methods and Constructors</a></dt><dt><a href="#d0e2069">Erasure</a></dt></dl></dd><dt><a href="#generics-inAspectJ5">Generics in AspectJ 5</a></dt><dd><dl><dt><a href="#d0e2095">Matching generic and parameterized types in type patterns</a></dt><dt><a href="#d0e2295">Signature patterns</a></dt><dt><a href="#d0e2378">Pointcuts</a></dt><dt><a href="#d0e3065">Inter-type Declarations</a></dt><dt><a href="#d0e3186">Declare Parents</a></dt><dt><a href="#d0e3246">Declare Soft</a></dt><dt><a href="#d0e3254">Parameterized Aspects</a></dt></dl></dd></dl></div><div class="sect1"><a name="generics-inJava5"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="generics-inJava5"></a>Generics in Java 5</h2></div></div><p>
+ </p></dd></dl></div></div><div class="sect1"><a name="annotations-itds"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="annotations-itds"></a>Inter-type Declarations</h2></div></div><p>An annotation type may not be the target of an inter-type declaration.</p></div></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="generics"></a>Chapter 3. Generics</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#generics-inJava5">Generics in Java 5</a></dt><dd><dl><dt><a href="#d0e1682">Declaring Generic Types</a></dt><dt><a href="#d0e1813">Using Generic and Parameterized Types</a></dt><dt><a href="#d0e1957">Subtypes, Supertypes, and Assignability</a></dt><dt><a href="#d0e2060">Generic Methods and Constructors</a></dt><dt><a href="#d0e2078">Erasure</a></dt></dl></dd><dt><a href="#generics-inAspectJ5">Generics in AspectJ 5</a></dt><dd><dl><dt><a href="#d0e2104">Matching generic and parameterized types in pointcut expressions</a></dt><dt><a href="#d0e2785">Inter-type Declarations</a></dt><dt><a href="#d0e2898">Declare Parents</a></dt><dt><a href="#d0e2931">Declare Soft</a></dt><dt><a href="#d0e2939">Generic Aspects</a></dt></dl></dd></dl></div><div class="sect1"><a name="generics-inJava5"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="generics-inJava5"></a>Generics in Java 5</h2></div></div><p>
This section provides the essential information about generics in
Java 5 needed to understand how generics are treated in AspectJ 5.
For a full introduction to generics in Java, please see the
documentation for the Java 5 SDK.
- </p><div class="sect2"><a name="d0e1673"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1673"></a>Declaring Generic Types</h3></div></div><p>
+ </p><div class="sect2"><a name="d0e1682"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1682"></a>Declaring Generic Types</h3></div></div><p>
A generic type is declared with one or more type parameters following the type name.
By convention formal type parameters are named using a single letter, though this is not required.
A simple generic list type
@@ -939,15 +943,15 @@
all of its type parameters (for example, <tt>List&lt;String&gt;</tt> or <tt>List&lt;Food&gt;</tt>).
</p><p>A generic type may be declared with multiple type parameters. In addition to simple type parameter names, type
parameter declarations can also constrain the set of types allowed by using the <tt>extends</tt>
- keyword. Some examples follow:</p><div class="variablelist"><dl><dt><a name="d0e1711"></a><span class="term">class Foo&lt;T&gt; {...}</span></dt><dd><p><a name="d0e1714"></a>A class <tt>Foo</tt> with one type parameter, <tt>T</tt>.
- </p></dd><dt><a name="d0e1723"></a><span class="term">class Foo&lt;T,S&gt; {...}</span></dt><dd><p><a name="d0e1726"></a>A class <tt>Foo</tt> with two type parameters, <tt>T</tt> and <tt>S</tt>.
- </p></dd><dt><a name="d0e1738"></a><span class="term">class Foo&lt;T extends Number&gt; {...}</span></dt><dd><p><a name="d0e1741"></a>A class <tt>Foo</tt> with one type parameter <tt>T</tt>, where <tt>T</tt> must be
+ keyword. Some examples follow:</p><div class="variablelist"><dl><dt><a name="d0e1720"></a><span class="term">class Foo&lt;T&gt; {...}</span></dt><dd><p><a name="d0e1723"></a>A class <tt>Foo</tt> with one type parameter, <tt>T</tt>.
+ </p></dd><dt><a name="d0e1732"></a><span class="term">class Foo&lt;T,S&gt; {...}</span></dt><dd><p><a name="d0e1735"></a>A class <tt>Foo</tt> with two type parameters, <tt>T</tt> and <tt>S</tt>.
+ </p></dd><dt><a name="d0e1747"></a><span class="term">class Foo&lt;T extends Number&gt; {...}</span></dt><dd><p><a name="d0e1750"></a>A class <tt>Foo</tt> with one type parameter <tt>T</tt>, where <tt>T</tt> must be
instantiated as the type <tt>Number</tt> or a subtype of <tt>Number</tt>.
- </p></dd><dt><a name="d0e1759"></a><span class="term">class Foo&lt;T, S extends T&gt; {...}</span></dt><dd><p><a name="d0e1762"></a>A class <tt>Foo</tt> with two type parameters, <tt>T</tt> and <tt>S</tt>. <tt>Foo</tt>
+ </p></dd><dt><a name="d0e1768"></a><span class="term">class Foo&lt;T, S extends T&gt; {...}</span></dt><dd><p><a name="d0e1771"></a>A class <tt>Foo</tt> with two type parameters, <tt>T</tt> and <tt>S</tt>. <tt>Foo</tt>
must be instantiated with a type <tt>S</tt> that is a subtype of the type specified for parameter <tt>T</tt>.
- </p></dd><dt><a name="d0e1783"></a><span class="term">class Foo&lt;T extends Number &amp; Comparable&gt; {...}</span></dt><dd><p><a name="d0e1786"></a>A class <tt>Foo</tt> with one type parameter, <tt>T</tt>. <tt>Foo</tt>
+ </p></dd><dt><a name="d0e1792"></a><span class="term">class Foo&lt;T extends Number &amp; Comparable&gt; {...}</span></dt><dd><p><a name="d0e1795"></a>A class <tt>Foo</tt> with one type parameter, <tt>T</tt>. <tt>Foo</tt>
must be instantiated with a type that is a subtype of <tt>Number</tt> and that implements <tt>Comparable</tt>.
- </p></dd></dl></div></div><div class="sect2"><a name="d0e1804"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1804"></a>Using Generic and Parameterized Types</h3></div></div><p>You declare a variable (or a method/constructor argument) of a parameterized type by specifying a concrete type specfication for each type parameter in
+ </p></dd></dl></div></div><div class="sect2"><a name="d0e1813"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1813"></a>Using Generic and Parameterized Types</h3></div></div><p>You declare a variable (or a method/constructor argument) of a parameterized type by specifying a concrete type specfication for each type parameter in
the generic type. The following example declares a list of strings and a list of numbers:</p><pre class="programlisting">
List&lt;String&gt; strings;
List&lt;Number&gt; numbers;
@@ -964,30 +968,30 @@
When declaring parameterized types, the <tt>?</tt> wildcard may be used, which stands for "some type".
The <tt>extends</tt> and <tt>super</tt> keywords may be used in conjunction with the wildcard
to provide upper and lower bounds on the types that may satisfy the type constraints. For example:
- </p><div class="variablelist"><dl><dt><a name="d0e1838"></a><span class="term">List&lt;?&gt;</span></dt><dd><p><a name="d0e1841"></a>A list containing elements of some type, the type of the elements in the list is unknown.
- </p></dd><dt><a name="d0e1844"></a><span class="term">List&lt;? extends Number&gt;</span></dt><dd><p><a name="d0e1847"></a>A list containing elements of some type that extends Number, the exact type of the elements in the list is unknown.
- </p></dd><dt><a name="d0e1850"></a><span class="term">List&lt;? super Double&gt;</span></dt><dd><p><a name="d0e1853"></a>A list containing elements of some type that is a super-type of Double, the exact type of the elements in the list is unknown.
+ </p><div class="variablelist"><dl><dt><a name="d0e1847"></a><span class="term">List&lt;?&gt;</span></dt><dd><p><a name="d0e1850"></a>A list containing elements of some type, the type of the elements in the list is unknown.
+ </p></dd><dt><a name="d0e1853"></a><span class="term">List&lt;? extends Number&gt;</span></dt><dd><p><a name="d0e1856"></a>A list containing elements of some type that extends Number, the exact type of the elements in the list is unknown.
+ </p></dd><dt><a name="d0e1859"></a><span class="term">List&lt;? super Double&gt;</span></dt><dd><p><a name="d0e1862"></a>A list containing elements of some type that is a super-type of Double, the exact type of the elements in the list is unknown.
</p></dd></dl></div><p>
A generic type may be extended as any other type. Given a generic type <tt>Foo&lt;T&gt;</tt> then
a subtype <tt>Goo</tt> may be declared in one of the following ways:
- </p><div class="variablelist"><dl><dt><a name="d0e1865"></a><span class="term">class Goo extends Foo</span></dt><dd><p><a name="d0e1868"></a>Here <tt>Foo</tt> is used as a raw type, and the appropriate warning messages will be
+ </p><div class="variablelist"><dl><dt><a name="d0e1874"></a><span class="term">class Goo extends Foo</span></dt><dd><p><a name="d0e1877"></a>Here <tt>Foo</tt> is used as a raw type, and the appropriate warning messages will be
issued by the compiler on attempting to invoke methods in <tt>Foo</tt>.
- </p></dd><dt><a name="d0e1877"></a><span class="term">class Goo&lt;E&gt; extends Foo</span></dt><dd><p><a name="d0e1880"></a><tt>Goo</tt> is a generic type, but the super-type <tt>Foo</tt> is used as a raw
+ </p></dd><dt><a name="d0e1886"></a><span class="term">class Goo&lt;E&gt; extends Foo</span></dt><dd><p><a name="d0e1889"></a><tt>Goo</tt> is a generic type, but the super-type <tt>Foo</tt> is used as a raw
type and the appropriate warning messages will be
issued by the compiler on attempting to invoke methods defined by <tt>Foo</tt>.
- </p></dd><dt><a name="d0e1891"></a><span class="term">class Goo&lt;E&gt; extends Foo&lt;E&gt;</span></dt><dd><p><a name="d0e1894"></a>This is the most usual form. <tt>Goo</tt> is a generic type with one parameter that extends
+ </p></dd><dt><a name="d0e1900"></a><span class="term">class Goo&lt;E&gt; extends Foo&lt;E&gt;</span></dt><dd><p><a name="d0e1903"></a>This is the most usual form. <tt>Goo</tt> is a generic type with one parameter that extends
the generic type <tt>Foo</tt> with that same parameter. So <tt>Goo&lt;String&lt;</tt> is
a subclass of <tt>Foo&lt;String&gt;</tt>.
- </p></dd><dt><a name="d0e1909"></a><span class="term">class Goo&lt;E,F&gt; extends Foo&lt;E&gt;</span></dt><dd><p><a name="d0e1912"></a><tt>Goo</tt> is a generic type with two parameters that extends
+ </p></dd><dt><a name="d0e1918"></a><span class="term">class Goo&lt;E,F&gt; extends Foo&lt;E&gt;</span></dt><dd><p><a name="d0e1921"></a><tt>Goo</tt> is a generic type with two parameters that extends
the generic type <tt>Foo</tt> with the first type parameter of <tt>Goo</tt> being used
to parameterize <tt>Foo</tt>. So <tt>Goo&lt;String,Integer&lt;</tt> is
a subclass of <tt>Foo&lt;String&gt;</tt>.
- </p></dd><dt><a name="d0e1932"></a><span class="term">class Goo extends Foo&lt;String&gt;</span></dt><dd><p><a name="d0e1935"></a><tt>Goo</tt> is a type that extends
+ </p></dd><dt><a name="d0e1941"></a><span class="term">class Goo extends Foo&lt;String&gt;</span></dt><dd><p><a name="d0e1944"></a><tt>Goo</tt> is a type that extends
the parameterized type <tt>Foo&lt;String&gt;</tt>.
</p></dd></dl></div><p>A generic type may implement one or more generic interfaces, following the type binding
rules given above. A type may also implement one or more parameterized interfaces (for example,
<tt>class X implements List&lt;String&gt;</tt>, however a type may not at the same time
- be a subtype of two interface types which are different parameterizations of the same interface.</p></div><div class="sect2"><a name="d0e1948"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1948"></a>Subtypes, Supertypes, and Assignability</h3></div></div><p>
+ be a subtype of two interface types which are different parameterizations of the same interface.</p></div><div class="sect2"><a name="d0e1957"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1957"></a>Subtypes, Supertypes, and Assignability</h3></div></div><p>
The supertype of a generic type <tt>C</tt> is the type given in the extends clause of
<tt>C</tt>, or <tt>Object</tt> if no extends clause is present. Given the type declaration
</p><pre class="programlisting">
@@ -1012,7 +1016,7 @@
<tt>Tm</tt> falls within the bounds of the wildcard. For example, <tt>List&lt;String&gt;</tt>
can be assigned to a variable of type <tt>Collection&lt;?&gt;</tt>, and <tt>List&lt;Double&gt;</tt>
can be assigned to a variable of type <tt>List&lt;? extends Number&gt;</tt>.
- </p></div><div class="sect2"><a name="d0e2051"></a><div class="titlepage"><div><h3 class="title"><a name="d0e2051"></a>Generic Methods and Constructors</h3></div></div><p>
+ </p></div><div class="sect2"><a name="d0e2060"></a><div class="titlepage"><div><h3 class="title"><a name="d0e2060"></a>Generic Methods and Constructors</h3></div></div><p>
A static method may be declared with one or more type parameters as in the following declaration:
</p><pre class="programlisting">
static &lt;T&gt; T first(List&lt;T&gt; ts) { ... }
@@ -1023,7 +1027,7 @@
Non-static methods may also be declared with one or more type parameters in a similar fashion:
</p><pre class="programlisting">
&lt;T extends Number&gt; T max(T t1, T t2) { ... }
- </pre><p>The same technique can be used to declare a generic constructor.</p></div><div class="sect2"><a name="d0e2069"></a><div class="titlepage"><div><h3 class="title"><a name="d0e2069"></a>Erasure</h3></div></div><p>Generics in Java are implemented using a technique called <span class="emphasis"><i>erasure</i></span>. All
+ </pre><p>The same technique can be used to declare a generic constructor.</p></div><div class="sect2"><a name="d0e2078"></a><div class="titlepage"><div><h3 class="title"><a name="d0e2078"></a>Erasure</h3></div></div><p>Generics in Java are implemented using a technique called <span class="emphasis"><i>erasure</i></span>. All
type parameter information is erased from the run-time type system. Asking an object of a parameterized
type for its class will return the class object for the raw type (eg. <tt>List</tt> for an object
declared to be of type <tt>List&lt;String&gt;</tt>. A consequence of this is that you cannot at
@@ -1032,453 +1036,383 @@
legal AspectJ 5 progam. In addition, AspectJ 5 provides support for generic and parameterized types in pointcuts, inter-type
declarations, and declare statements. Parameterized types may freely be used within aspect members, and support is
also provided for generic <span class="emphasis"><i>abstract</i></span> aspects.
- </p><div class="sect2"><a name="d0e2095"></a><div class="titlepage"><div><h3 class="title"><a name="d0e2095"></a>Matching generic and parameterized types in type patterns</h3></div></div><p>
- The foundation of AspectJ's support for generic and parameterized types in aspect declarations is the extension of type
- pattern matching to allow matching against generic and parameterized types.
- </p><p>
- The type pattern <tt>"Foo"</tt> matches all types named <tt>Foo</tt>, whether they
- be simple types, generic types, or parameterized types. So for example, <tt>Foo</tt>,
- <tt>Foo&lt;T&gt;</tt>, and <tt>Foo&lt;String&gt;</tt>will all be matched.
- </p><p>
- AspectJ 5 also extends the specification of type patterns to allow explicit matching of generic and parameterized
- types by including one or more type parameter patterns inside angle braces (<tt>&lt; &gt;</tt>) immediately
- after the type pattern. For example, <tt>List&lt;String&gt;</tt>
- </p><pre class="programlisting">
- TypePattern := SimpleTypePattern |
- '!' TypePattern |
- '(' AnnotationPattern? TypePattern ')'
- TypePattern '&amp;&amp;' TypePattern |
- TypePattern '||' TypePattern |
- TypePattern '&lt;' TypeParameterPatternList '&gt;'
-
- TypeParameterPatternList ::= TypeParameterPattern (',' TypeParameterPattern)*
-
- TypeParameterPattern ::= TypePattern |
- '?' TypeBoundPattern?
-
- TypeBoundPattern ::= 'extends' TypePattern AdditionalBoundPatternList? |
- 'super' TypePattern AdditionalBoundPatternList?
-
- AdditionalBoundPatternList ::= AdditionalBoundPattern AdditionalBoundPatternList |
- AdditionalBoundPattern
-
- AdditionalBoundPattern ::= '&amp;' TypePattern
-
- </pre><p>
- A simple identifier (such as <tt>String</tt>) occuring in a type parameter list will be treated as a type name unless
- a type variable of that name is in scope (declaring type variables is covered later). The type pattern <tt>List&lt;E&gt;</tt>
- will result in an "invalid absolute type name" warning if no type <tt>E</tt> is in scope (declared in the default package, or
- imported in the compilation unit) and no declaration of <tt>E</tt> as a type variable is in scope either.
- </p><p>Some simple examples of type patterns follow:</p><div class="variablelist"><dl><dt><a name="d0e2144"></a><span class="term">List&lt;String&gt;</span></dt><dd><p><a name="d0e2147"></a>Matches the parameterized type <tt>List&lt;String&gt;</tt>
- </p></dd><dt><a name="d0e2153"></a><span class="term">List&lt;? extends Number&gt;</span></dt><dd><p><a name="d0e2156"></a>Matches the parameterized type <tt>List&lt;? extends Number&gt;</tt>
- </p></dd><dt><a name="d0e2162"></a><span class="term">List&lt;E&gt;</span></dt><dd><p><a name="d0e2165"></a>Outside of a scope in which <tt>E</tt>is defined as a type variable, this pattern matches the
- parameterized type <tt>List&lt;E&gt;</tt>. If <tt>E</tt> is not
- a type then an <tt>invalidAbsoluteTypeName</tt> xlint warning will be issued.
- </p><p>In a scope in which
- <tt>E</tt> is defined as a type variable, this pattern matches the generic type <tt>List&lt;E&gt;</tt>.
- The type parameter name does not have to match the name used in the declaration of <tt>List</tt>,
- but the bounds must match. This pattern <span class="emphasis"><i>also</i></span> matches any parameterization of <tt>List</tt>
- that satisfies the bounds of the type variable (for example, <tt>List&lt;String&gt;</tt>).
- </p></dd></dl></div><p>
- The <tt>*</tt>, <tt>+</tt>, and <tt>..</tt> wildcards may be used in type patterns
- matching against generic and parameterized types (just as in any other type pattern). The <tt>+</tt>
- wildcard matches all subtypes. Recalling the discussion on subtypes and supertypes in the previous section, note
- that the pattern <tt>List&lt;Number&gt;+</tt> will match <tt>List&lt;Number&gt;</tt> and
- <tt>LinkedList&lt;Number&gt;</tt>, but not <tt>List&lt;Double&gt;</tt>. To match lists of
- any number type use the pattern <tt>List&lt;Number+&gt;</tt> which will match
- <tt>List&lt;Number&gt;</tt>, <tt>List&lt;Double&gt;</tt>, <tt>List&lt;Float&gt;</tt>
- and so on.
- </p><p>
- The generics wildcard <tt>?</tt> is considered part of the signature of a parameterized type, and
- is <span class="emphasis"><i>not</i></span> used as an AspectJ wildcard in type matching. For example:
- </p><div class="variablelist"><dl><dt><a name="d0e2247"></a><span class="term">List&lt;*&gt;</span></dt><dd><p><a name="d0e2250"></a>Matches any generic or parameterized <tt>List</tt>type (<tt>List&lt;String&gt;</tt>,
- <tt>List&lt;Integer&gt;</tt> and so on) with a single type parameter.
- </p></dd><dt><a name="d0e2262"></a><span class="term">List&lt;?&gt;</span></dt><dd><p><a name="d0e2265"></a>Matches the parameterized type <tt>List&lt;?&gt;</tt> (and does
- <span class="emphasis"><i>not</i></span> match <tt>List&lt;String&gt;</tt>,
- <tt>List&lt;Integer&gt;</tt> and so on)
- </p></dd><dt><a name="d0e2280"></a><span class="term">List&lt;? extends Number+&gt;</span></dt><dd><p><a name="d0e2283"></a>Matches <tt>List&lt;? extends Number&gt;</tt>, <tt>List&lt;? extends Double&gt;</tt>,
- and so on, but does not match <tt>List&lt;Double&gt;</tt>.
- </p></dd></dl></div></div><div class="sect2"><a name="d0e2295"></a><div class="titlepage"><div><h3 class="title"><a name="d0e2295"></a>Signature patterns</h3></div></div><p>
- Now that we understand how to write type patterns that match generic and parameterized types, it is time to look at
- how these can be utilized to match member declarations by using signature patterns.
- </p><p>To match members declared in generic types and making use of type variables defined in those types (for
- example <tt>interface Foo&lt;T&gt; { public T doSomething(); }</tt> use a signature pattern of the form:</p><pre class="programlisting">
- X Foo&lt;X&gt;.doSomething()
- </pre><p>
- This assumes a scope in which <tt>X</tt> is declared as a type variable. As with type patterns, the name
- of the type variable does not have to match the name used in the member declaration, but the bounds must match.
- For example, if the interface was declared as <tt>Foo&lt;T extends Number&gt;</tt> then the signature
- pattern would be: <tt>X Foo&lt;X extends Number&gt;.doSomething()</tt>.
- </p><div class="variablelist"><dl><dt><a name="d0e2319"></a><span class="term">T Util&lt;T extends Number,S&gt;.someFunction(List&lt;S&gt;)</span></dt><dd><p><a name="d0e2322"></a>Matches the method <tt>someFunction</tt> in a generic type <tt>Util</tt> with
- two type parameters, the first type parameter having an upper bound of <tt>Number</tt>.
- </p></dd><dt><a name="d0e2334"></a><span class="term">LinkedList&lt;E&gt;.new()</span></dt><dd><p><a name="d0e2337"></a>Matches the no-argument constructor of the generic type <tt>LinkedList</tt>.
- </p></dd></dl></div><p>
- Matching a field with a generic type works in the same way. For example:
- </p><pre class="programlisting">
- T *&lt;T&gt;.*
- </pre><p>Matches a field of the type of type parameter <tt>T</tt> in any generic type with a single
- unbounded type parameter (the pattern<tt>*&lt;T&gt;</tt>). The field may be of any name.
- </p><p>Matching of members of parameterized types is straightforward. For example,
- <tt>void List&lt;String&gt;.add(String)</tt> matches the add method in the
- parameterized type <tt>List&lt;String&gt;</tt>.
- </p><p>
- To match a generic <span class="emphasis"><i>method</i></span> the generic method type variable
- declarations become part of the signature pattern. For example:
- </p><pre class="programlisting">
- &lt;T&gt; List&lt;T&gt; *.favourites(List&lt;T&gt;)
- </pre><p>matches a generic method <tt>favourites</tt> declared in any type. To match a
- static generic method simply include the <tt>static</tt> modifier in the type pattern.</p></div><div class="sect2"><a name="d0e2378"></a><div class="titlepage"><div><h3 class="title"><a name="d0e2378"></a>Pointcuts</h3></div></div><p>
- In this section we discuss how type patterns and signature patterns matching on generic and
- parameterized types, methods, and constructors can be used in pointcut expressions.
- We distinguish between pointcuts that match based on static type information, and pointcuts
- that match based on runtime type information (<tt>this, target, args</tt>).
- </p><p>
- First however we need to address the notion of type variables and scopes. There is a
- convention in Java, but no requirement, that type variables are named with a single letter.
- Likewise it is rare, but perfectly legal, to declare a type with a single character name. Given the
- type pattern <tt>List&lt;Strng&gt;</tt>, is this a mis-spelling of the
- parameterized type pattern <tt>List&lt;String&gt;</tt> or is it a generic type pattern
- with one unbounded type variable <tt>Strng</tt>?. Alternatively, given the
- type pattern <tt>List&lt;E&gt;</tt>, if the type <tt>E</tt> cannot be found,
- is this a missing import statement or an implied type variable? There is no way for AspectJ
- to disambiguate in these situations without an explicit declaration of type variable names. If
- <tt>E</tt> is defined as a type variable, and <tt>Strng</tt> is not, then both
- declarations can be correctly interpreted.
- </p><div class="sect3"><a name="d0e2409"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2409"></a>Type Variables in Pointcut Expressions</h4></div></div><p>The type variables in scope for a pointcut primitive are declared in a type variable
- list immediately following the pointcut desginator keyword. For example:</p><pre class="programlisting">
- call&lt;T&gt;(* Foo&lt;T&gt;.*(T))
- </pre><p>matches a call to a method with any name (<tt>*</tt>) declared
- by a generic type <tt>Foo</tt> with one unbounded type parameter. The method
- takes one argument which is of the type of the type variable.</p><p>In contrast, the pointcut</p><pre class="programlisting">
- call(* Foo&lt;T&gt;.*(T))
- </pre><p>matches a call to a method with any name that takes an argument of
- type <tt>T</tt>, where the target of the call is declared as the parameterized
- type <tt>Foo&lt;T&gt;</tt>. If there is no type <tt>T</tt> in scope, an
- "invalid absolute type name (T)" warning will be issued.</p><p>
- The type variables declaration following a pointcut designator permits only simple identifiers
- (e.g. <tt>&lt;S,T&gt;</tt> and not <tt>&lt;S extends Number&gt;</tt>).
- </p><p>A type variable declaration list can appear following any pointcut designator except
- for <tt>handler</tt> (Java 5 does
- not permit a generic class to be a direct or indirect subtype of <tt>Throwable</tt>
- - see JLS 8.1.2), the dynamic pointcuts <tt>this, target, args, if, cflow, cflowbelow</tt>,
- and the annotation pointcut designators
- (<tt>@args, @this, @within</tt> and so on).</p></div><div class="sect3"><a name="d0e2461"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2461"></a>Initialization and execution pointcuts</h4></div></div><p>
- Recall that there is only ever one type for a generic type (e.g. <tt>List&lt;E&gt;</tt>)
- regardless of how many different parameterizations of that type (e.g.
- <tt>List&lt;String&gt;</tt>, <tt>List&lt;Double&gt;</tt>) are used within a
- program. For join points that occur within a type, such as execution join points, it therefore only
- makes sense to talk about execution join points for the generic type. Given the generic type
- </p><pre class="programlisting">
- public class Foo&lt;T&gt; {
+ </p><div class="sect2"><a name="d0e2104"></a><div class="titlepage"><div><h3 class="title"><a name="d0e2104"></a>Matching generic and parameterized types in pointcut expressions</h3></div></div><p>
+ The simplest way to work with generic and parameterized types in pointcut expressions and type patterns
+ is simply to use the raw type name. For example, the type pattern <tt>List</tt> will match
+ the generic type <tt>List&lt;E&gt;</tt> and any parameterization of that type
+ (<tt>List&lt;String&gt;, List&lt;?&gt;, List&lt;? extends Number&gt;</tt> and so on. This
+ ensures that pointcuts written in existing code that is not generics-aware will continue to work as
+ expected in AspectJ 5. It is also the recommended way to match against generic and parameterized types
+ in AspectJ 5 unless you explicitly wish to narrow matches to certain parameterizations of a generic type.
+ </p><p>Generic methods and constructors, and members defined in generic types, may use type variables
+ as part of their signature. For example:</p><pre class="programlisting">
+ public class Utils {
- T doSomething(T toSomeT) {
- return T;
- }
-
- }
- </pre><p>
- then
- </p><div class="variablelist"><dl><dt><a name="d0e2480"></a><span class="term">execution&lt;T&gt;(T Foo&lt;T&gt;.doSomething(..))</span></dt><dd><p><a name="d0e2483"></a>matches the execution of the <tt>doSomething</tt> method in
- <tt>Foo</tt>.
- </p></dd><dt><a name="d0e2492"></a><span class="term">execution(* Foo.doSomething(..))</span></dt><dd><p><a name="d0e2495"></a>also matches the execution of the <tt>doSomething</tt> method in
- <tt>Foo</tt>.
- </p></dd><dt><a name="d0e2504"></a><span class="term">execution(T Foo.doSomething(..))</span></dt><dd><p><a name="d0e2507"></a>results in an "invalid absolute type name (T)" warning since <tt>T</tt> is
- interpreted as a type, not a type variable.
- </p></dd><dt><a name="d0e2513"></a><span class="term">execution(String Foo&lt;String&gt;.doSomething(..))</span></dt><dd><p><a name="d0e2516"></a>results in a compilation error "no execution join points for parameterized type
- Foo&lt;String&gt;, use a generic signature instead".
- </p></dd></dl></div><p>
- Given the type declaration
- </p><pre class="programlisting">
- public class Bar&lt;N extends Number&gt; {
+ /** static generic method */
+ static &lt;T&gt; T first(List&lt;T&gt; ts) { ... }
- N doSomething(N toSomeN) {
- return N;
- }
+ /** instance generic method */
+ &lt;T extends Number&gt; T max(T t1, T t2) { ... }
+
+ }
- }
- </pre><p>
- then
- </p><div class="variablelist"><dl><dt><a name="d0e2526"></a><span class="term">execution&lt;T&gt;(T Bar&lt;T&gt;.doSomething(..))</span></dt><dd><p><a name="d0e2529"></a>does not match the execution of <tt>Bar.doSomething</tt> since
- the bounds of the type parameter <tt>T</tt> in the pointcut expression do
- not match the bounds of the type parameter <tt>N</tt> in the type declaration.
- </p></dd><dt><a name="d0e2541"></a><span class="term">execution&lt;T&gt;(T Bar&lt;T extends Number&gt;.doSomething(..))</span></dt><dd><p><a name="d0e2544"></a>matches the execution of the <tt>doSomething</tt> method in
- <tt>Bar</tt>.
- </p></dd><dt><a name="d0e2553"></a><span class="term">execution&lt;T extends Number&gt;(T Bar&lt;T&gt;.doSomething(..))</span></dt><dd><p><a name="d0e2556"></a>results in a compilation error, since type variable bounds must be specified as part
- of the declaring type pattern, and not in the type variable list.
- </p></dd></dl></div><p>
- If a type implements a <span class="emphasis"><i>parameterized</i></span> interface, then
- execution join points exist and can be matched for the parameterized interface operations within
- the implementing type. For example, given the pair of types:
- </p><pre class="programlisting">
- public interface Greatest&lt;T&gt; {
- T greatest(List&lt;T&gt; ts);
- }
-
- public class NumberOperations implements Greatest&lt;Number&gt; {
- public Number greatest(List&lt;Number&gt; numbers) {
- //...
- }
- }
- </pre><p>
- then
- </p><pre class="programlisting">
- execution(* Greatest&lt;Number&gt;.*(..))
+ public class G&lt;T&gt; {
+
+ // field with parameterized type
+ T myData;
+
+ // method with parameterized return type
+ public List&lt;T&gt; getAllDataItems() {...}
+
+ }
</pre><p>
- will match the execution of the <tt>greatest</tt> method declared in
- <tt>NumberOperations</tt>. However, it <span class="emphasis"><i>does not</i></span>
- match the execution of <tt>greatest</tt> in the program below:
- </p><pre class="programlisting">
- public interface Greatest&lt;T&gt; {
- T greatest(List&lt;T&gt; ts);
- }
-
- public class NumberOperations&lt;N extends Number&gt; implements Greatest&lt;N&gt; {
- public N greatest(List&lt;N&gt; numbers) {
- //...
- }
- }
-
- // in some fragment of code...
- NumberOperations&lt;Number&gt; numOps = new NumberOperations&lt;Number&gt;();
- numOps.greatest(numList);
- </pre><p>Since there is only one generic type, <tt>NumberOperations</tt>,
- which implements a generic interface. Either of the pointcut expressions
- <tt>execution&lt;T&gt;(* Greatest&lt;T&gt;&gt;.*(..))</tt> or
- <tt>execution&lt;T&gt;(* Greatest&lt;T extends Number&gt;&gt;.*(..))</tt> will
- match the execution of <tt>greatest</tt> in this example. Recall from
- chapter <a href="#jpsigs">Join Point Signatures</a> that a kinded pointcut primitive matches a join point if
- it exactly matches one of the signatures of the join point. The signatures of the
- execution join point for <tt>greatest</tt> in the example above are:</p><div class="variablelist"><dl><dt><a name="d0e2606"></a><span class="term">public N Greatest&lt;N&gt;.greatest(List&lt;N&gt;)</span></dt><dd><p><a name="d0e2609"></a>from the declaration in the <tt>Greatest</tt> interface, and
- </p></dd><dt><a name="d0e2615"></a><span class="term">public N Greatest&lt;N extends Number&gt;.greatest(List&lt;N&gt;)</span></dt><dd><p><a name="d0e2618"></a>from the additional bounds restriction of <tt>N</tt> in the
- declaration of <tt>NumberOperations</tt>
- </p></dd></dl></div><p>
- Join points for <tt>staticinitialization</tt>,<tt>initialization</tt> and
- <tt>preinitialization</tt>
- only ever exist on a generic type (an interface cannot define a constructor). The expression
- <tt>initialization&lt;T&gt;(Foo&lt;T&gt;.new(..))</tt> which match any initialization
- join point for the generic type <tt>Foo&lt;T&gt;</tt>, and
- <tt>staticinitialization&lt;T&gt;(Foo&lt;T&gt;)</tt> matches the static initialization
- of that same type.
- </p><p>
- The expression <tt>staticinitialization(List&lt;String&gt;)</tt> will result in a
- compilation error: there is no static initialization join point for the parameterized type
- <tt>List&lt;String&gt;</tt>. However, the expression
- <tt>staticinitialization(List&lt;String&gt;+)</tt> <span class="emphasis"><i>is</i></span>
- legal, and will match the static initialization of any type that
- <tt>implements List&lt;String&gt;</tt>. The expression
- <tt>staticinitialization&lt;T&gt;(List&lt;T&gt;+)</tt> will match the static
- initialization join point of any type that either extends or implements the generic
- type <tt>List&lt;T&gt;</tt> or implements any parameterization of that
- interface.
- </p></div><div class="sect3"><a name="d0e2670"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2670"></a>Static scoping: within and withincode</h4></div></div><p>The <tt>within</tt> and <tt>withincode</tt>
- pointcut designators both match the
- execution of join points that occur within a type or a member of a type respectively. Therefore
- the same considerations with respect to there only being <tt>one</tt> type for
- a generic type regardless of how many parameterizations of that type are used in a program
- apply.
- </p><p>The <tt>within</tt> pointcut designator can never be used in conjunction
- with a simple parameterized type. So
- </p><div class="variablelist"><dl><dt><a name="d0e2690"></a><span class="term">within&lt;T&gt;(Foo&lt;T&gt;)</span></dt><dd><p><a name="d0e2693"></a>matches all join points occurring within the generic type <tt>Foo&lt;T&gt;</tt>,
- and
- </p></dd><dt><a name="d0e2699"></a><span class="term">within(Foo&lt;String&gt;)</span></dt><dd><p><a name="d0e2702"></a>results in a compilation error since there is no concept of a join point within a
- parameterized type, but
- </p></dd><dt><a name="d0e2705"></a><span class="term">within(Foo&lt;String&gt;+)</span></dt><dd><p><a name="d0e2708"></a>matches any join point occurring within a type that
- <tt>implements Foo&lt;String&gt;</tt>.
- </p></dd></dl></div><p>The <tt>withincode</tt> designator is likewise normally used with a
- generic type, but can be used with a parameterized interface type to match join points
- arising from code lexically within the implementation of the interface methods in a type
- that implements the parameterized interface.
- </p><div class="variablelist"><dl><dt><a name="d0e2720"></a><span class="term">withincode&lt;T&gt;(* Foo&lt;T&gt;.*(..))</span></dt><dd><p><a name="d0e2723"></a>matches all join points arising from code lexically within a method of the
- generic type <tt>Foo&lt;T&gt;</tt>
- </p></dd><dt><a name="d0e2729"></a><span class="term">withincode(* Foo&lt;String&gt;.*(..))</span></dt><dd><p><a name="d0e2732"></a>results in a compilation error if <tt>Foo</tt> is not an interface. If
- <tt>Foo</tt> is an interface then it matches all join points arising from
- code lexically within the implementation of the interface methods in a type that
- implements <tt>Foo&lt;String&gt;</tt>.
- </p></dd><dt><a name="d0e2744"></a><span class="term">withincode(* Foo&lt;String&gt;+.*(..))</span></dt><dd><p><a name="d0e2747"></a>matches any join point occurring within a method of a type that
- <tt>implements Foo&lt;String&gt;</tt>.
- </p></dd></dl></div></div><div class="sect3"><a name="d0e2753"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2753"></a>Call, get and set pointcuts</h4></div></div><p>
- The <tt>call, get,</tt> and <tt>set</tt> join points can occur on the client
- side (ie. outside of the type owning the member being called, accessed, or updated) or
- within the type that owns the target member. The following short program demonstrates this:
- </p><pre class="programlisting">
- public class Foo&lt;T&gt; {
-
- public T timeFor;
-
- public Foo&lt;T&gt;(T aCuppa) {
- timeFor = aCuppa; // set-site A
+ AspectJ 5 does not allow the use of type variables in pointcut expressions and type patterns. Instead, members that
+ use type parameters as part of their signature are matched by their <span class="emphasis"><i>erasure</i></span>. Java 5 defines the
+ rules for determing the erasure of a type as follows.
+ </p><p>Let <tt>|T|</tt> represent the erasure of some type <tt>T</tt>. Then:</p><table class="simplelist" border="0" summary="Simple list"><tr><td>The erasure of a parameterized type <tt>T&lt;T1,...,Tn&gt;</tt> is <tt>|T|</tt>.
+ For example, the erasure of <tt>List&lt;String&gt;</tt> is <tt>List</tt>.</td></tr><tr><td>The erasure of a nested type <tt>T.C</tt> is <tt>|T|.C</tt>. For example,
+ the erasure of the nested type <tt>Foo&lt;T&gt;.Bar</tt> is <tt>Foo.Bar</tt>.</td></tr><tr><td>The erasure of an array type <tt>T[]</tt> is <tt>|T|[]</tt>. For example,
+ the erasure of <tt>List&lt;String&gt;[]</tt> is <tt>List[]</tt>.</td></tr><tr><td>The erasure of a type variable is its leftmost bound. For example, the erasure of a
+ type variable <tt>P</tt> is <tt>Object</tt>, and the erasure of a type
+ variable <tt>N extends Number</tt> is <tt>Number</tt>.</td></tr><tr><td>The erasure of every other type is the type itself</td></tr></table><p>Applying these rules to the earlier examples, we find that the methods defined in <tt>Utils</tt>
+ can be matched by a signature pattern matching <tt>static Object Utils.first(List)</tt> and
+ <tt>Number Utils.max(Number, Number)</tt> respectively. The members of the generic type
+ <tt>G</tt> can be matched by a signature pattern matching <tt>Object G.myData</tt> and
+ <tt>public List G.getAllDataItems()</tt> respectively.</p><div class="sect3"><a name="d0e2215"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2215"></a>Restricting matching using parameterized types</h4></div></div><p>Pointcut matching can be further restricted to match only given parameterizations of parameter types (methods and constructors), return
+ types (methods) and field types (fields). This is achieved by specifying a parameterized type pattern at the appropriate point
+ in the signature pattern. For example, given the class <tt>Foo</tt>:</p><pre class="programlisting">
+ public class Foo {
+
+ List&lt;String&gt; myStrings;
+ List&lt;Float&gt; myFloats;
+
+ public List&lt;String&gt; getStrings() { return myStrings; }
+ public List&lt;Float&gt; getFloats() { return myFloats; }
+
+ public void addStrings(List&lt;String&gt; evenMoreStrings) {
+ myStrings.addAll(evenMoreStrings);
+ }
+
}
-
- public void doThis(T t) {
- doThat(t); // call-site A
- }
-
- public void doThat(T t) {
- return;
+ </pre><p>Then a <tt>get</tt> join point for the field <tt>myStrings</tt> can be matched by the
+ pointcut <tt>get(List Foo.myStrings)</tt> and by the pointcut <tt>get(List&lt;String&gt; Foo.myStrings)</tt>,
+ but <span class="emphasis"><i>not</i></span> by the pointcut <tt>get(List&lt;Number&gt; *)</tt>.</p><p>A <tt>get</tt> join point for the field <tt>myFloats</tt> can be matched by the
+ pointcut <tt>get(List Foo.myFloats)</tt>, the pointcut <tt>get(List&lt;Float&gt; *)</tt>,
+ and the pointcut <tt>get(List&lt;Number+&gt; *)</tt>. This last example shows how AspectJ type
+ patterns can be used to match type parameters types just like any other type. The pointcut
+ <tt>get(List&lt;Double&gt; *)</tt> does <span class="emphasis"><i>not</i></span> match.</p><p>The execution of the methods <tt>getStrings</tt> and <tt>getFloats</tt> can be
+ matched by the pointcut expression <tt>execution(List get*(..))</tt>, and the pointcut
+ expression <tt>execution(List&lt;*&gt; get*(..))</tt>, but only <tt>getStrings</tt>
+ is matched by <tt>execution(List&lt;String&gt; get*(..))</tt> and only <tt>getFloats</tt>
+ is matched by <tt>execution(List&lt;Number+&gt; get*(..))</tt></p><p>A call to the method <tt>addStrings</tt> can be matched by the pointcut expression
+ <tt>call(* addStrings(List))</tt> and by the expression <tt>call(* addStrings(List&lt;String&gt;))</tt>,
+ but <span class="emphasis"><i>not</i></span> by the expression <tt>call(* addStrings(List&lt;Number&gt;))</tt>.
+ </p><p>Remember that any type variable reference in a generic member is
+ <span class="emphasis"><i>always</i></span> matched by its erasure. Thus given the following
+ example:</p><pre class="programlisting">
+ class G&lt;T&gt; {
+
+ List&lt;T&gt; foo(List&lt;String ls) { return null; }
+
}
+ </pre><p>The execution of <tt>foo</tt> can be matched by
+ <tt>execution(List foo(List))</tt>,
+ <tt>execution(List foo(List&lt;String&gt;&gt;))</tt>, and
+ <tt>execution(* foo(List&lt;String&lt;))</tt>but
+ <span class="emphasis"><i>not</i></span> by <tt>execution(List&lt;Object&gt; foo(List&lt;String&gt;&gt;)</tt>
+ since the erasure of <tt>List&lt;T&gt;</tt> is <tt>List</tt>
+ and not <tt>List&lt;Object&gt;</tt>.
+ </p></div><div class="sect3"><a name="d0e2348"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2348"></a>Generic wildcards and signature matching</h4></div></div><p>
+ When it comes to signature matching, a type parameterized using a generic wildcard is a distinct type.
+ For example, <tt>List&lt;?&gt;</tt> is a very different type to <tt>List&lt;String&gt;</tt>,
+ even though a variable of type <tt>List&lt;String&gt;</tt> can be assigned to a variable of
+ type <tt>List&lt;?&gt;</tt>. Given the methods:
+ </p><pre class="programlisting">
+ class C {
+
+ public void foo(List&lt;? extends Number&gt; listOfSomeNumberType) {}
- }
-
- public class Main {
- public static void main(String[] args) {
- Foo&lt;String&gt; foos = new Foo&lt;String&gt;();
- foos.doThis("b"); //call-site B
- foos.doThat("c"); // call-site C
- foos.timeFor = "a cuppa"; // set-site B
+ public void bar(List&lt;?&gt; listOfSomeType) {}
+
+ public void goo(List&lt;Double&gt; listOfDoubles) {}
+
}
- }
+ </pre><div class="variablelist"><dl><dt><a name="d0e2369"></a><span class="term">execution(* C.*(List))</span></dt><dd><p><a name="d0e2372"></a>Matches an execution join point for any of the three methods.
+ </p></dd><dt><a name="d0e2375"></a><span class="term">execution(* C.*(List&lt;? extends Number&gt;))</span></dt><dd><p><a name="d0e2378"></a>matches only the
+ execution of <tt>foo</tt>, and <span class="emphasis"><i>not</i></span> the execution
+ of <tt>goo</tt> since <tt>List&lt;? extends Number&gt;</tt> and
+ <tt>List&lt;Double&gt;</tt> are distinct types.
+ </p></dd><dt><a name="d0e2396"></a><span class="term">execution(* C.*(List&lt;?&gt;))</span></dt><dd><p><a name="d0e2399"></a>matches only the execution of <tt>bar</tt>.
+ </p></dd><dt><a name="d0e2405"></a><span class="term">execution(* C.*(List&lt;? extends Object+&gt;))</span></dt><dd><p><a name="d0e2408"></a>matches both the execution of <tt>foo</tt> and the execution of <tt>bar</tt>
+ since the upper bound of <tt>List&lt;?&gt;</tt> is implicitly <tt>Object</tt>.
+ </p></dd></dl></div></div><div class="sect3"><a name="d0e2423"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2423"></a>Treatment of bridge methods</h4></div></div><p>Under certain circumstances a Java 5 compiler is required to create <span class="emphasis"><i>bridge
+ methods</i></span> that support the compilation of programs using raw types. Consider the types</p><pre class="programlisting">
+ class Generic&lt;T&gt; {
+
+ public T foo(T someObject) {
+ return someObject;
+ }
+
+ }
+
+ class SubGeneric&lt;N extends Number&gt; extends Generic&lt;N&gt; {
+
+ public N foo(N someNumber) {
+ return someNumber;
+ }
+
+ }
+ </pre><p>The class <tt>SubGeneric</tt> extends <tt>Generic</tt>
+ and overrides the method <tt>foo</tt>. Since the upper bound of the type variable
+ <tt>N</tt> in <tt>SubGeneric</tt> is different to the upper bound of
+ the type variable <tt>T</tt> in <tt>Generic</tt>, the method <tt>foo</tt>
+ in <tt>SubGeneric</tt> has a different erasure to the method <tt>foo</tt>
+ in <tt>Generic</tt>. This is an example of a case where a Java 5 compiler will create
+ a <span class="emphasis"><i>bridge method</i></span> in <tt>SubGeneric</tt>. Although you never see it,
+ the bridge method will look something like this:</p><pre class="programlisting">
+ public Object foo(Object arg) {
+ Number n = (Number) arg; // "bridge" to the signature defined in this type
+ return foo(n);
+ }
+ </pre><p>Bridge methods are synthetic artefacts generated as a result of a particular compilation strategy and
+ have no execution join points in AspectJ 5. So the pointcut <tt>execution(Object SubGeneric.foo(Object))</tt>
+ does not match anything. (The pointcut <tt>execution(Object Generic.foo(Object))</tt> matches the
+ execution of <tt>foo</tt> in both <tt>Generic</tt> and <tt>SubGeneric</tt> since
+ both are implementations of <tt>Generic.foo</tt>).
+ </p><p>It <span class="emphasis"><i>is</i></span> possible to <span class="emphasis"><i>call</i></span> a bridge method as the following short
+ code snippet demonstrates. Such a call <span class="emphasis"><i>does</i></span> result in a call join point for the call to
+ the method.
+ </p><pre class="programlisting">
+ SubGeneric rawType = new SubGeneric();
+ rawType.foo("hi"); // call to bridge method (will result in a runtime failure in this case)
+ Object n = new Integer(5);
+ rawType.foo(n); // call to bridge method that would succeed at runtime
+ </pre></div><div class="sect3"><a name="d0e2510"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2510"></a>Runtime type matching with this(), target() and args()</h4></div></div><p>The <tt>this()</tt>, <tt>target()</tt>, and
+ <tt>args()</tt> pointcut expressions all match based on the runtime
+ type of their arguments. Because Java 5 implements generics using erasure, it is not
+ possible to ask at runtime whether an object is an instance of a given parameterization of a type
+ (only whether or not it is an instance of the erasure of that parameterized type). Therefore
+ AspectJ 5 does not support the use of parameterized types with the <tt>this()</tt> and
+ <tt>target()</tt> pointcuts. Parameterized types may however be used in conjunction with
+ <tt>args()</tt>. Consider the following class
+ </p><pre class="programlisting">
+ public class C {
+
+ public void foo(List&lt;String&gt; listOfStrings) {}
+
+ public void bar(List&lt;Double&gt; listOfDoubles) {}
+
+ public void goo(List&lt;? extends Number&gt; listOfSomeNumberType) {}
+
+ }
+ </pre><div class="variablelist"><dl><dt><a name="d0e2537"></a><span class="term">args(List)</span></dt><dd><p><a name="d0e2540"></a>will match an execution or call join point for any of
+ these methods
+ </p></dd><dt><a name="d0e2543"></a><span class="term">args(List&lt;String&gt;)</span></dt><dd><p><a name="d0e2546"></a>will match an execution
+ or call join point for <tt>foo</tt>.
+ </p></dd><dt><a name="d0e2552"></a><span class="term">args(List&lt;Double&gt;)</span></dt><dd><p><a name="d0e2555"></a>matches an execution or call join point for <tt>bar</tt>, and <span class="emphasis"><i>may</i></span> match
+ at an execution or call join point for <tt>goo</tt> since it is legitimate to pass an
+ object of type <tt>List&lt;Double&gt;</tt> to a method expecting a <tt>List&lt;? extends Number&gt;</tt>.
+ </p><p>
+ In this situation a runtime test would normally be applied to ascertain whether or not the argument
+ was indeed an instance of the required type. However, in the case of parameterized types such a test is not
+ possible and therefore AspectJ 5 considers this a match, but issues an <span class="emphasis"><i>unchecked</i></span> warning.
+ For example, compiling the aspect <tt>A</tt> below with the class <tt>C</tt> produces the
+ compilation warning: "unchecked match of List&lt;Double&gt; with List&lt;? extends Number&gt; when argument is
+ an instance of List at join point method-execution(void C.goo(List&lt;? extends Number&gt;)) [Xlint:uncheckedArgument]";
+ </p></dd></dl></div><pre class="programlisting">
+ public aspect A {
+
+ before(List&lt;Double&gt; listOfDoubles) : execution(* C.*(..)) &amp;&amp; args(listOfDoubles) {
+ for (Double d : listOfDoubles) {
+ // do something
+ }
+ }
+
+ }
+ </pre><p>Like all Lint messages, the <tt>uncheckedArgument</tt> warning can be
+ configured in severity from the default warning level to error or even ignore if preferred.
+ In addition, AspectJ 5 offers the annotation <tt>@SuppressAjWarnings</tt> which is
+ the AspectJ equivalent of Java's <tt>@SuppressWarnings</tt> annotation. If the
+ advice is annotated with <tt>@SuppressWarnings</tt> then <span class="emphasis"><i>all</i></span>
+ lint warnings issued during matching of pointcut associated with the advice will be
+ suppressed. To suppress just an <tt>uncheckedArgument</tt> warning, use the
+ annotation <tt>@SuppressWarnings("uncheckedArgument")</tt> as in the following
+ examples:
+ </p><pre class="programlisting">
+ import org.aspectj.lang.annotation.SuppressAjWarnings
+ public aspect A {
+
+ @SuppressAjWarnings // will not see *any* lint warnings for this advice
+ before(List&lt;Double&gt; listOfDoubles) : execution(* C.*(..)) &amp;&amp; args(listOfDoubles) {
+ for (Double d : listOfDoubles) {
+ // do something
+ }
+ }
+
+ @SuppressAjWarnings("uncheckedArgument") // will not see *any* lint warnings for this advice
+ before(List&lt;Double&gt; listOfDoubles) : execution(* C.*(..)) &amp;&amp; args(listOfDoubles) {
+ for (Double d : listOfDoubles) {
+ // do something
+ }
+ }
+
+ }
</pre><p>
- We have annotated the three method call sites as call-site A, call-site B, and call-site C.
- Call-site A is situated within the generic type <tt>Foo&lt;T&gt;</tt> and the call
- join point has signature <tt>public void Foo&lt;T&gt;doThat(T)</tt>. The join point
- arising from call-site B is a client-side call join point and has the signatures
- <tt>public void Foo&lt;String&gt;doThis(String)</tt> (from the static type of
- <tt>foos</tt>) <span class="emphasis"><i>and</i></span>
- <tt>public void Foo&lt;T&gt;doThis(T)</tt>. Likewise the call join point arising from
- call-site C has the signatures
- <tt>public void Foo&lt;String&gt;doThat(String)</tt> (from the static type of
- <tt>foos</tt>) <span class="emphasis"><i>and</i></span>
- <tt>public void Foo&lt;T&gt;doThat(T)</tt>. A call pointcut expression matches if the
- signature pattern exactly matches one of the signatures of the call join point.
- </p><p>
- The signatures for get and set join points works in a similar fashion. At set-site A in the above
- example, the set join point has signature <tt>public T Foo&lt;T&gt;.timeFor</tt>. At
- set-site B the set join point has signatures <tt>public T Foo&lt;T&gt;.timeFor</tt> and
- <tt>public String Foo&lt;String&gt;.timeFor</tt>. A get or set pointcut expression
- matches if the signature pattern exactly matches one of the signatures of the join point.
- </p>
+ The safest way to deal with <tt>uncheckedArgument</tt> warnings however is to restrict the pointcut
+ to match only at those join points where the argument is guaranteed to match. This is achieved by combining
+ <tt>args</tt> with a <tt>call</tt> or <tt>execution</tt> signature matching
+ pointcut. In the following example the advice will match the execution of <tt>bar</tt> but not
+ of <tt>goo</tt> since the signature of <tt>goo</tt> is not matched by the execution pointcut
+ expression.
+ </p><pre class="programlisting">
+ public aspect A {
+
+ before(List&lt;Double&gt; listOfDoubles) : execution(* C.*(List&lt;Double&gt;)) &amp;&amp; args(listOfDoubles) {
+ for (Double d : listOfDoubles) {
+ // do something
+ }
+ }
+
+ }
+ </pre><p>Generic wildcards can be used in args type patterns, and matching follows regular Java 5 assignability rules. For
+ example, <tt>args(List&lt;?&gt;)</tt> will match a list argument of any type, and
+ <tt>args(List&lt;? extends Number&gt;)</tt> will match an argument of type
+ <tt>List&lt;Number&gt;, List&lt;Double&gt;, List&lt;Float&gt;</tt> and so on. Where a match cannot be
+ fully statically determined, the compiler will once more issue an <tt>uncheckedArgument</tt> warning.
+ </p><p>Consider the following program:</p><pre class="programlisting">
+ public class C {
+
+ public static void main(String[] args) {
+ C c = new C();
+ List&lt;String&gt; ls = new ArrayList&lt;String&gt;();
+ List&lt;Double&gt; ld = new ArrayList&lt;Double&gt;();
+ c.foo("hi");
+ c.foo(ls);
+ c.foo(ld);
+ }
- Some examples follow:
+ public void foo(Object anObject) {}
+ }
+
+ aspect A {
+ before(List&lt;? extends Number&gt; aListOfSomeNumberType)
+ : call(* foo(..)) &amp;&amp; args(aListOfSomeNumberType) {
+ // process list...
+ }
+ }
+ </pre><p>From the signature of <tt>foo</tt> all we know is that the runtime argument will be an instance of
+ <tt>Object</tt>.Compiling this program gives the unchecked argument warning:
+ "unchecked match of List&lt;? extends Number&gt; with List when argument is
+ an instance of List at join point method-execution(void C.foo(Object)) [Xlint:uncheckedArgument]".
+ The advice will not execute at the call join point for <tt>c.foo("hi")</tt> since <tt>String</tt>
+ is not an instance of <tt>List</tt>. The advice <span class="emphasis"><i>will</i></span> execute at the call join points
+ for <tt>c.foo(ls)</tt> and <tt>c.foo(ld)</tt> since in both cases the argument is an instance of
+ <tt>List</tt>.
+ </p><p>Combine a wildcard argument type with a signature pattern to avoid unchecked argument matches. In the example
+ below we use the signature pattern <tt>List&lt;Number+&gt;</tt> to match a call to any method taking
+ a <tt>List&lt;Number&gt;, List&lt;Double&gt;, List&lt;Float&gt;</tt> and so on. In addition the
+ signature pattern <tt>List&lt;? extends Number+&gt;</tt> can be used to match a call to a method
+ declared to take a <tt>List&lt;? extends Number&gt;</tt>, <tt>List&lt;? extends Double&gt;</tt>
+ and so on. Taken together, these restrict matching to only
+ those join points at which the argument is guaranteed to be an instance of <tt>List&lt;? extends Number&gt;</tt>.</p><pre class="programlisting">
+ aspect A {
+ before(List&lt;? extends Number&gt; aListOfSomeNumberType)
+ : (call(* foo(List&lt;Number+&gt;)) || call(* foo(List&lt;? extends Number+&gt;)))
+ &amp;&amp; args(aListOfSomeNumberType) {
+ // process list...
+ }
+ }
+ </pre></div><div class="sect3"><a name="d0e2706"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2706"></a>Binding return values in after returning advice</h4></div></div><p>
+ After returning advice can be used to bind the return value from a matched join point. AspectJ 5 supports the use of
+ a parameterized type in the returning clause, with matching following the same rules as described for args. For
+ example, the following aspect matches the execution of any method returning a <tt>List</tt>, and makes
+ the returned list available to the body of the advice.
+ </p><pre class="programlisting">
+ public aspect A {
- <div class="variablelist"><dl><dt><a name="d0e2811"></a><span class="term">call(* List&lt;?&gt;.*(..))</span></dt><dd><p><a name="d0e2814"></a>matches a call to any method of a <tt>List&lt;?&gt;</tt> (a call where the
- target is declared to be a <tt>List&lt;?&gt;</tt>). For example:
+ pointcut executionOfAnyMethodReturningAList() : execution(List *(..));
+
+ after() returning(List&lt;?&gt; listOfSomeType) : executionOfAnyMethodReturningAList() {
+ for (Object element : listOfSomeType) {
+ // process element...
+ }
+ }
+
+ }
+ </pre><p>The pointcut uses the raw type pattern <tt>List</tt>, and hence it
+ matches methods returning any kind of list (<tt>List&lt;String&gt;, List&lt;Double&gt;</tt>,
+ and so on. We've chosen to bind the returned list as the parameterized type
+ <tt>List&lt;?&gt;</tt> in the advice since Java's type checking will now ensure
+ that we only perform safe operations on the list.</p><p>Given the class</p><pre class="programlisting">
+ public class C {
+
+ public List&lt;String&gt; foo(List&lt;String&gt; listOfStrings) {...}
+
+ public List&lt;Double&gt; bar(List&lt;Double&gt; listOfDoubles) {...}
+
+ public List&lt;? extends Number&gt; goo(List&lt;? extends Number&gt; listOfSomeNumberType) {...}
+
+ }
+ </pre><p>The advice in the aspect below will run after the execution of <tt>bar</tt>
+ and bind the return value. It will also run after the execution of <tt>goo</tt> and
+ bind the return value, but gives an <tt>uncheckedArgument</tt> warning during
+ compilation. It does <span class="emphasis"><i>not</i></span> run after the execution of <tt>foo</tt>.
+ </p><pre class="programlisting">
+ public aspect Returning {
+
+ after() returning(List&lt;Double&gt; listOfDoubles) : execution(* C.*(..)) {
+ for(Double d : listOfDoubles) {
+ // process double...
+ }
+ }
+
+ }
+ </pre><p>As with <tt>args</tt> you can guarantee that after returning advice only
+ executes on lists <span class="emphasis"><i>statically determinable</i></span> to be of the right
+ type by specifying a return type pattern in the associated pointcut. The
+ <tt>@SuppressAjWarnings</tt> annotation can also be used if desired.</p></div><div class="sect3"><a name="d0e2762"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2762"></a>Declaring pointcuts inside generic types</h4></div></div><p><span class="emphasis"><i>This language feature will not be supported until AspectJ 5 M4.</i></span></p><p>Pointcuts can be declared in both classes and aspects. A pointcut declared in a generic
+ type may use the type variables of the type in which it is declared. All references to
+ a pointcut declared in a generic type from outside of that type must be via a parameterized type reference,
+ and not a raw type reference.</p><p>Consider the generic type <tt>Generic</tt> with a pointcut <tt>foo</tt>:
</p><pre class="programlisting">
- int countItems(List&lt;?&gt; anyList) {
- return anyList.size(); // matched by call(* List&lt;?&gt;.*(..))
- }
- </pre></dd><dt><a name="d0e2825"></a><span class="term">call&lt;T&gt;(* List&lt;T&gt;.*(..))</span></dt><dd><p><a name="d0e2828"></a>matches any call to an operation defined in the generic type
- <tt>List&lt;E&gt;</tt>. This includes calls made to <tt>List&lt;String&gt;</tt>,
- <tt>List&lt;Number&gt;</tt>, <tt>List&lt;? super Foo&gt;</tt> and so on.
- </p></dd><dt><a name="d0e2843"></a><span class="term">get&lt;T&gt;(T *&lt;T extends Account&gt;.*)</span></dt><dd><p><a name="d0e2846"></a>matches the get of any field defined in a generic type with one type parameter that has
- an upper bound of <tt>Account</tt>. The field has the type of the type parameter, and
- can be of any name. This pointcut expression matches both gets of the field within the
- declaring type, and also gets on parameterized instances of the type.
- </p></dd><dt><a name="d0e2852"></a><span class="term">set(Account Foo&lt;Account&gt;.*Account)</span></dt><dd><p><a name="d0e2855"></a>matches the set of a field of type <tt>Account</tt> where the target
- is of type <tt>Foo&lt;Account&gt;</tt> and the field name ends with "Account". Does not
- match sets of any "*Account" field occurring within the <tt>Foo</tt> type itself.
- </p></dd><dt><a name="d0e2867"></a><span class="term">call(* List&lt;? extends Number&gt;.add(..))</span></dt><dd><p><a name="d0e2870"></a>matches any call to add an element to a list of type <tt>List&lt;? extends Number&gt;</tt>.
- Does not match calls to add elements to lists of type <tt>List&lt;Number&gt;</tt> or
- <tt>List&lt;Double&gt;</tt> as these are distinct types.
- </p></dd><dt><a name="d0e2882"></a><span class="term">call(* List&lt;Number+&gt;.add(..))</span></dt><dd><p><a name="d0e2885"></a>matches any call to add an element to a list of type <tt> Number</tt> or
- any subclass of <tt>Number</tt>. For example, <tt>List&lt;Number&gt;,
- List&lt;Double&gt; List&lt;Float&gt;</tt>.
- Does not match calls to add elements to lists of type <tt>List&lt;? extends Number&gt;</tt>
- as this is a distinct type.
- </p></dd></dl></div></div><div class="sect3"><a name="d0e2900"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2900"></a>Handler</h4></div></div><p>
- The Java Language Specification states that a generic class may not be a direct or indirect
- subclass of <tt>Throwable</tt>. Therefore it is a compilation error to use a generic
- or parameterized type pattern in a <tt>handler</tt> pointcut expression.
- </p></div><div class="sect3"><a name="d0e2911"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2911"></a>Runtime type matching: this, target and args</h4></div></div><p>
- Java 5 generics are implemented using a technique known an <span class="emphasis"><i>erasure</i></span>.
- In particular, what gets "erased" is the ability to find out the parameterized runtime type
- of an instance of a generic type. You can ask if something is an <tt>instanceof List</tt>,
- but not if something is an <tt>instanceof List&lt;String&gt;</tt>
- </p><p>
- The <tt>this, target</tt> and <tt>args</tt> pointcut designators all match
- based on the runtime type of the appropriate object (this, target, or argument) at a join point.
- To match any parameterization of a generic type, simply use the raw type (type variables are
- not permitted with these designators). For example:
- </p><div class="variablelist"><dl><dt><a name="d0e2934"></a><span class="term">target(List)</span></dt><dd><p><a name="d0e2937"></a>matches any call to an instance of <tt>List</tt> (including
- <tt>List&lt;String&gt;, List&lt;Number&gt;</tt>, and so on.
- </p></dd><dt><a name="d0e2946"></a><span class="term">args (List)</span></dt><dd><p><a name="d0e2949"></a>matches any join point with a single argument that is an instance of
- <tt>List</tt>.
- </p></dd></dl></div><p>
- To match specific parameterizations of a generic type, simply use the type that you require
- the relevant object to be an instance of inside the pointcut expression. For example:
- <tt>target(List&lt;String&gt;)</tt>.
- </p><p>
- Recall that runtime tests to determine whether an object is an instance of a parameterized
- type are not possible due to erasure. Therefore AspectJ matching behaviour with
- parameterized types for <tt>this, target</tt> and <tt>args</tt> is as follows.
- </p><table class="simplelist" border="0" summary="Simple list"><tr><td>If it can be statically determined that a given object will always be an instance
- of the required type, then the pointcut expressions matches. For example, given a variable
- <tt>bankAccounts</tt>
- of type <tt>Set&lt;BankAccount&gt;</tt> and the pointcut expression
- <tt>target(Set&lt;BankAccount&gt;)</tt> then any call made to
- <tt>bankAccounts</tt> will be matched.</td></tr><tr><td>If it can be statically determined that a given object can never be an
- instance of the required type, then the pointcut expression does not match. The
- expression <tt>target(List&lt;String&gt;)</tt>will never match a call made
- using a variable of type <tt>List&lt;Number&gt;</tt> (it is not possible for
- a type to implement two different parameterizations of the same interface).</td></tr><tr><td>If an object <span class="emphasis"><i>might</i></span> be an instance of the required
- type in some circumstances but not in others, then since it is not possible to perform
- the runtime test, AspectJ deems the pointcut expression to match, but issues an
- unchecked warning. This is analogous to the behaviour of the Java compiler when
- converting between raw and parameterized types. Given a variable of type
- <tt>List&lt;? extends Number&gt;</tt> and a call join point with
- target pointcut expression <tt>target(List&lt;Double&gt;)</tt> then
- the expression matches but with an unchecked warning. The warning can be suppressed
- by annotating the associated advice with either <tt>@SuppressAjWarnings</tt>
- or <tt>@SuppressAjWarnings("unchecked")</tt>.</td></tr></table><p>
- When using a parameterized type with the
- <tt>this</tt> pointcut designator then a joinpoint is unambiguously
- matched if and only if one or more of the following conditions hold:
- </p><table class="simplelist" border="0" summary="Simple list"><tr><td>the runtime type of the <tt>this</tt> object extends or
- implements the parameterized type. For example,
- <tt>class Foo implements List&lt;String&gt;</tt> will match
- <tt>this(List&lt;String&gt;)</tt>.</td></tr><tr><td>
- The parameterized "this" type is given using a generics wildcard in the pointcut
- expression, and the bounds of
- the generic runtime type of <tt>this</tt> are such that all valid parameterizations
- are matched by the wildcard. For example, the pointcut expression
- <tt>this(List&lt;? extends Number&gt;)</tt> will match a <tt>this</tt>
- object of type <tt>class Foo&lt;N extends Number&gt; implements List&lt;N&gt;</tt>,
- but not an object of type <tt>class Foo&lt;N&gt; implements List&lt;N&gt;</tt>.
- </td></tr></table><p>
- You've already seen some examples of using the generic wildcard <tt>?</tt>
- in parameterized type patterns. Since <tt>this, target</tt> and
- <tt>args</tt> match using an instance of test, the generic wildcard can be useful in
- specifying an acceptable range of parameterized types to match. When used in the binding
- form, the same restrictions on operations permitted on the bound variable apply as when a
- method declares a parameter with a wildcard type. For example, in the advice below, it is
- a compilation error to attemp to add an element into the list <tt>aList</tt>.
- </p><pre class="programlisting">
- before(List&lt;? extends Number&gt; aList) :
- execution(* org.xyz.Foo.*(..)) &amp;&amp; args(aList) {
- aList.add(new Double(5.0d)); // Compilation error on this line
- }
- </pre></div><div class="sect3"><a name="d0e3058"></a><div class="titlepage"><div><h4 class="title"><a name="d0e3058"></a>Declaring pointcuts in generic classes</h4></div></div><p>
- AspectJ permits pointcuts to be declared in classes as well as aspects. A pointcut defined
- inside a generic class may not use the type variables of the class in the pointcut expression
- (just as static members of a generic class may not use type variables).
- For example:
- </p><pre class="programlisting">
- public class Foo&lt;T extends Number&gt; {
-
- ...
-
- // Not allowed - uses T in the pointcut expression
- public pointcut fooOperationCall(T t) :
- call(* Foo&lt;T&gt;.*(T)) &amp;&amp; args(t);
-
-
- // permitted, but recommended to use an alternate variable name in the local
- // type variable declaration - e.g. execution&lt;S&gt;(...)
- public pointcut fooExecution(Number n) :
- execution&lt;T&gt;(* Foo&lt;T&gt;.*(T)) &amp;&amp; args(n);
- }
- </pre></div></div><div class="sect2"><a name="d0e3065"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3065"></a>Inter-type Declarations</h3></div></div><p>
- AspectJ 5 allows type parameters to be used in inter-type declarations - either for declaring generic
- methods and constructors, or for declaring members on generic types. The syntax for declaring generic
- methods and constructors follows the regular AspectJ convention of simply qualifying the member name with
- the target type.
- </p><div class="variablelist"><dl><dt><a name="d0e3071"></a><span class="term">&lt;T extends Number&gt; T Utils.max(T first, T second) {...}</span></dt><dd><p><a name="d0e3074"></a>Declares a generic instance method <tt>max</tt> on the class <tt>Util</tt>.
+ public class Generic&lt;T&gt; {
+
+ /**
+ * matches the execution of any implementation of a method defined for T
+ */
+ public pointcut foo() : execution(* T.*(..));
+
+ }
+ </pre><p>Such a pointcut must be refered to using a parameterized reference as shown
+ below.</p><pre class="programlisting">
+ public aspect A {
+
+ // runs before the execution of any implementation of a method defined for MyClass
+ before() : Generic&lt;MyClass&gt;.foo() {
+ // ...
+ }
+
+ // runs before the execution of any implementation of a method defined for YourClass
+ before() : Generic&lt;YourClass&gt;.foo() {
+ // ...
+ }
+
+ // results in a compilation error - raw type reference
+ before() : Generic.foo() { }
+
+ }
+ </pre></div></div><div class="sect2"><a name="d0e2785"></a><div class="titlepage"><div><h3 class="title"><a name="d0e2785"></a>Inter-type Declarations</h3></div></div><p>
+ AspectJ 5 supports the inter-type declaration of generic methods, and of members on
+ generic types. For generic methods, the syntax is exactly as for a regular method
+ declaration, with the addition of the target type specification:
+ </p><div class="variablelist"><dl><dt><a name="d0e2791"></a><span class="term">&lt;T extends Number&gt; T Utils.max(T first, T second) {...}</span></dt><dd><p><a name="d0e2794"></a>Declares a generic instance method <tt>max</tt> on the class <tt>Util</tt>.
The <tt>max</tt> method takes two arguments, <tt>first</tt> and <tt>second</tt> which must
both be of the same type (and that type must be Number or a subtype of Number) and returns an instance
of that type.
- </p></dd><dt><a name="d0e3092"></a><span class="term">static &lt;E&gt; E Utils.first(List&lt;E&gt; elements) {...}</span></dt><dd><p><a name="d0e3095"></a>Declares a static generic method <tt>first</tt> on the class <tt>Util</tt>.
+ </p></dd><dt><a name="d0e2812"></a><span class="term">static &lt;E&gt; E Utils.first(List&lt;E&gt; elements) {...}</span></dt><dd><p><a name="d0e2815"></a>Declares a static generic method <tt>first</tt> on the class <tt>Util</tt>.
The <tt>first</tt> method takes a list of elements of some type, and returns an instance
of that type.
- </p></dd><dt><a name="d0e3107"></a><span class="term">&lt;T&gt; Sorter.new(List&lt;T&gt; elements,Comparator&lt;? super T&gt; comparator) {...}</span></dt><dd><p><a name="d0e3110"></a>Declares a constructor on the class <tt>Sorter</tt>.
+ </p></dd><dt><a name="d0e2827"></a><span class="term">&lt;T&gt; Sorter.new(List&lt;T&gt; elements,Comparator&lt;? super T&gt; comparator) {...}</span></dt><dd><p><a name="d0e2830"></a>Declares a constructor on the class <tt>Sorter</tt>.
The constructor takes a list of elements of some type, and a comparator that can compare instances
of the element type.
</p></dd></dl></div><p>
@@ -1487,63 +1421,30 @@
must match the number of type parameters in
the generic type declaration. Type parameter <span class="emphasis"><i>names</i></span> do not have to match.
For example, given the generic type <tt>Foo&lt;T,S extends Number&gt;</tt> then:
- </p><div class="variablelist"><dl><dt><a name="d0e3125"></a><span class="term">String Foo.getName() {...}</span></dt><dd><p><a name="d0e3128"></a>Declares a <tt>getName</tt> method on behalf of the raw type <tt>Foo</tt>. It is
+ </p><div class="variablelist"><dl><dt><a name="d0e2845"></a><span class="term">String Foo.getName() {...}</span></dt><dd><p><a name="d0e2848"></a>Declares a <tt>getName</tt> method on behalf of the type <tt>Foo</tt>. It is
not possible to refer to the type parameters of Foo in such a declaration.
- </p></dd><dt><a name="d0e3137"></a><span class="term">R Foo&lt;Q, R&gt;.getMagnitude() {...}</span></dt><dd><p><a name="d0e3140"></a>Declares a method <tt>getMagnitude</tt> on the generic class <tt>Foo</tt>.
+ </p></dd><dt><a name="d0e2857"></a><span class="term">public R Foo&lt;Q, R&gt;.getMagnitude() {...}</span></dt><dd><p><a name="d0e2860"></a>Declares a method <tt>getMagnitude</tt> on the generic class <tt>Foo</tt>.
The method returns an instance of the type substituted for the second type parameter in an invocation
- of <tt>Foo</tt>.
- </p></dd><dt><a name="d0e3152"></a><span class="term">R Foo&lt;Q, R extends Number&gt;.getMagnitude() {...}</span></dt><dd><p><a name="d0e3155"></a>Results in a compilation error since a bounds specification is not allowed in this
+ of <tt>Foo</tt> If <tt>Foo</tt> is declared as
+ <tt>Foo&lt;T,N extends Number&gt; {...}</tt> then this inter-type declaration is
+ equivalent to the declaration of a method <tt>public N getMagnitude()</tt>
+ within the body of <tt>Foo</tt>.
+ </p></dd><dt><a name="d0e2884"></a><span class="term">R Foo&lt;Q, R extends Number&gt;.getMagnitude() {...}</span></dt><dd><p><a name="d0e2887"></a>Results in a compilation error since a bounds specification is not allowed in this
form of an inter-type declaration (the bounds are determined from the declaration of the
target type).
</p></dd></dl></div><p>A parameterized type may not be the target of an inter-type declaration. This is because
there is only one type (the generic type) regardless of how many different invocations (parameterizations) of
that generic type are made in a program. Therefore it does not make sense to try and declare a member
- on behalf of (say) <tt>Foo&lt;String&gt;</tt>, you can only declare members on the generic
- type <tt>Foo&lt;T&gt;</tt>.
- </p><p>
- If an inter-type member is declared inside a generic aspect, then the type parameter names from the
- aspect declaration may be used in the signature specification of the inter-type declaration, but
- <span class="emphasis"><i>not</i></span> as type parameter names for a generic target type. In other words the example
- that follows is legal:
- </p><pre class="programlisting">
- public abstract aspect A&lt;T&gt; {
-
- private T Foo.data;
-
- public T Foo.getData(T defaultValue) {
- return (this.data != null ? data : defaultValue);
- }
-
- }
- </pre><p>
- Whereas the following example is not allowed and will report an error that a parameterized type may not be the
- target of an inter-type declaration (since when the type parameter <tt>T</tt> in the aspect is subsituted with
- say, <tt>String</tt>, then the target of the inter-type declaration becomes <tt>Goo&lt;String&gt;</tt>).
- </p><pre class="programlisting">
- public abstract aspect A&lt;T&gt; {
-
- private T Goo&lt;T&gt;.data;
-
- public T Goo&lt;T&gt;.getData(T defaultValue) {
- return (this.data != null ? data : defaultValue);
- }
-
- }
- </pre></div><div class="sect2"><a name="d0e3186"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3186"></a>Declare Parents</h3></div></div><p>Both generic and parameterized types can be used as the parent type in a <tt>declare parents</tt>
+ on behalf of (say) <tt>Bar&lt;String&gt;</tt>, you can only declare members on the generic
+ type <tt>Bar&lt;T&gt;</tt>.
+ </p></div><div class="sect2"><a name="d0e2898"></a><div class="titlepage"><div><h3 class="title"><a name="d0e2898"></a>Declare Parents</h3></div></div><p>Both generic and parameterized types can be used as the parent type in a <tt>declare parents</tt>
statement (as long as the resulting type hierarchy would be well-formed in accordance with Java's sub-typing
- rules). Generic types may also be used as the target type of a <tt>declare parents</tt> statement:
- a type variable list follows the <tt>parents</tt> keyword in these cases to declare the
- type variables in scope.
- Some examples follow:</p><div class="variablelist"><dl><dt><a name="d0e3201"></a><span class="term">declare parents: Foo implements List&lt;String&gt;</span></dt><dd><p><a name="d0e3204"></a>The <tt>Foo</tt> type implements the <tt>List&lt;String&gt;</tt> interface. If
+ rules). Generic types may also be used as the target type of a <tt>declare parents</tt> statement.</p><div class="variablelist"><dl><dt><a name="d0e2910"></a><span class="term">declare parents: Foo implements List&lt;String&gt;</span></dt><dd><p><a name="d0e2913"></a>The <tt>Foo</tt> type implements the <tt>List&lt;String&gt;</tt> interface. If
<tt>Foo</tt> already implements some other parameterization of the <tt>List</tt>
interface (for example, <tt>List&lt;Integer&gt;</tt> then a compilation error will result since a
type cannot implement multiple parameterizations of the same generic interface type.
- </p></dd><dt><a name="d0e3222"></a><span class="term">declare parents &lt;T&gt;: org.xyz..*&lt;T&gt; extends Base&lt;T&gt;</span></dt><dd><p><a name="d0e3225"></a>All generic types declared in a package beginning with <tt>org.xyz</tt> and with a
- single unbounded type parameter, extend the generic type <tt>Base&lt;T&gt;</tt>.
- </p></dd><dt><a name="d0e3234"></a><span class="term">declare parents &lt;T&gt;: org.xyz..*&lt;T&gt; extends Base&lt;S&gt;</span></dt><dd><p><a name="d0e3237"></a>Results in a compilation error (unless <tt>S</tt> is a type) since <tt>S</tt> is
- not bound in the type pattern.
- </p></dd></dl></div></div><div class="sect2"><a name="d0e3246"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3246"></a>Declare Soft</h3></div></div><p>It is an error to use a generic or parameterized type as the softened exception type in a declare soft statement. Java 5 does
- not permit a generic class to be a direct or indirect subtype of <tt>Throwable</tt> (JLS 8.1.2).</p></div><div class="sect2"><a name="d0e3254"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3254"></a>Parameterized Aspects</h3></div></div><p>
+ </p></dd></dl></div></div><div class="sect2"><a name="d0e2931"></a><div class="titlepage"><div><h3 class="title"><a name="d0e2931"></a>Declare Soft</h3></div></div><p>It is an error to use a generic or parameterized type as the softened exception type in a declare soft statement. Java 5 does
+ not permit a generic class to be a direct or indirect subtype of <tt>Throwable</tt> (JLS 8.1.2).</p></div><div class="sect2"><a name="d0e2939"></a><div class="titlepage"><div><h3 class="title"><a name="d0e2939"></a>Generic Aspects</h3></div></div><p><span class="emphasis"><i>This feature will not be fully implemented until AspectJ5 M4.</i></span></p><p>
AspectJ 5 allows an <span class="emphasis"><i>abstract</i></span> aspect to be declared as a generic type. Any concrete
aspect extending a generic abstract aspect must extend a parameterized version of the abstract aspect.
Wildcards are not permitted in this parameterization.
@@ -1551,81 +1452,107 @@
public abstract aspect ParentChildRelationship&lt;P,C&gt; {
...
}
- </pre><p>then</p><div class="variablelist"><dl><dt><a name="d0e3269"></a><span class="term">public aspect FilesInFolders extends ParentChildRelationship&lt;Folder,File&gt; {...</span></dt><dd><p><a name="d0e3272"></a>declares a concrete sub-aspect, <tt>FilesInFolders</tt> which extends the
+ </pre><p>then</p><div class="variablelist"><dl><dt><a name="d0e2957"></a><span class="term">public aspect FilesInFolders extends ParentChildRelationship&lt;Folder,File&gt; {...</span></dt><dd><p><a name="d0e2960"></a>declares a concrete sub-aspect, <tt>FilesInFolders</tt> which extends the
parameterized abstract aspect <tt>ParentChildRelationship&lt;Folder,File&gt;</tt>.
- </p></dd><dt><a name="d0e3281"></a><span class="term">public aspect FilesInFolders extends ParentChildRelationship {...</span></dt><dd><p><a name="d0e3284"></a>results in a compilation error since the <tt>ParentChildRelationship</tt> aspect must
+ </p></dd><dt><a name="d0e2969"></a><span class="term">public aspect FilesInFolders extends ParentChildRelationship {...</span></dt><dd><p><a name="d0e2972"></a>results in a compilation error since the <tt>ParentChildRelationship</tt> aspect must
be fully parameterized.
- </p></dd><dt><a name="d0e3290"></a><span class="term">public aspect ThingsInFolders&lt;T&gt; extends ParentChildRelationship&lt;Folder,T&gt;</span></dt><dd><p><a name="d0e3293"></a>results in a compilation error since concrete aspects may not have type parameters.
- </p></dd><dt><a name="d0e3296"></a><span class="term">public abstract aspect ThingsInFolders&lt;T&gt; extends ParentChildRelationship&lt;Folder,T&gt;</span></dt><dd><p><a name="d0e3299"></a>declares a sub-aspect of <tt>ParentChildRelationship</tt> in which <tt>Folder</tt>
+ </p></dd><dt><a name="d0e2978"></a><span class="term">public aspect ThingsInFolders&lt;T&gt; extends ParentChildRelationship&lt;Folder,T&gt;</span></dt><dd><p><a name="d0e2981"></a>results in a compilation error since concrete aspects may not have type parameters.
+ </p></dd><dt><a name="d0e2984"></a><span class="term">public abstract aspect ThingsInFolders&lt;T&gt; extends ParentChildRelationship&lt;Folder,T&gt;</span></dt><dd><p><a name="d0e2987"></a>declares a sub-aspect of <tt>ParentChildRelationship</tt> in which <tt>Folder</tt>
plays the role of parent (is bound to the type variable <tt>P</tt>).
- </p></dd></dl></div><p>An exception to the rule that concrete aspects may not be generic is a pertypewithin aspect, which
- may be declared with a single unbounded type parameter. This is discussed in the chapter on <a href="#pertypewithin">pertypewithin</a>.</p><p>The type parameter variables from a generic aspect declaration may be used in place of a type within any
- member of the aspect. For example, we can declare a <tt>ParentChildRelationship</tt> aspect to
+ </p></dd></dl></div><p>The type parameter variables from a generic aspect declaration may be used in place of a type within any
+ member of the aspect, <span class="emphasis"><i>except for within inter-type declarations</i></span>.
+ For example, we can declare a <tt>ParentChildRelationship</tt> aspect to
manage the bi-directional relationship between parent and child nodes as follows:
</p><pre class="programlisting">
- public abstract aspect ParentChildRelationship&lt;P,C&gt; {
-
- /**
- * Parents contain a list of children
- */
- private List&lt;C&gt; P.children;
-
- /**
- * Each child has a parent
- */
- private P C.parent;
-
- /**
- * Parents provide access to their children
- */
- public List&lt;C&gt; P.getChildren() {
- return Collections.unmodifiableList(children);
- }
-
- /**
- * A child provides access to its parent
- */
- public P C.getParent() {
- return parent;
+ /**
+ * a generic aspect, we've used descriptive role names for the type variables
+ * (Parent and Child) but you could use anything of course
+ */
+ public abstract aspect ParentChildRelationship&lt;Parent,Child&gt; {
+
+ /** generic interface implemented by parents */
+ interface ParentHasChildren&lt;C extends ChildHasParent&gt;{
+ List&lt;C&gt; getChildren();
+ void addChild(C child);
+ void removeChild(C child);
+ }
+
+ /** generic interface implemented by children */
+ interface ChildHasParent&lt;P extends ParentHasChildren&gt;{
+ P getParent();
+ void setParent(P parent);
+ }
+
+ /** ensure the parent type implements ParentHasChildren&lt;child type&gt; */
+ declare parents: Parent implements ParentHasChildren&lt;Child&gt;;
+
+ /** ensure the child type implements ChildHasParent&lt;parent type&gt; */
+ declare parents: Child implements ChildHasParent&lt;Parent&gt;;
+
+ // Inter-type declarations made on the *generic* interface types to provide
+ // default implementations.
+
+ /** list of children maintained by parent */
+ private List&lt;C&gt; ParentHasChildren&lt;C&gt;.children;
+
+ /** reference to parent maintained by child */
+ private P ChildHasParent&lt;P&gt;.parent;
+
+ /** Default implementation of getChildren for the generic type ParentHasChildren */
+ public List&lt;C&gt; ParentHasChildren&lt;C&gt;.getChildren() {
+ return Collections.unmodifiableList(children);
+ }
+
+ /** Default implementation of getParent for the generic type ChildHasParent */
+ public P ChildHasParent&lt;P&gt;.getParent() {
+ return parent;
+ }
+
+ /**
+ * Default implementation of addChild, ensures that parent of child is
+ * also updated.
+ */
+ public void ParentHasChildren&lt;C&gt;.addChild(C child) {
+ if (child.parent != null) {
+ child.parent.removeChild(child);
+ }
+ children.add(child);
+ child.parent = this;
+ }
+
+ /**
+ * Default implementation of removeChild, ensures that parent of
+ * child is also updated.
+ */
+ public void ParentHasChildren&lt;C&gt;.removeChild(C child) {
+ if (children.remove(child)) {
+ child.parent = null;
}
+ }
+
+ /**
+ * Default implementation of setParent for the generic type ChildHasParent.
+ * Ensures that this child is added to the children of the parent too.
+ */
+ public void ChildHasParent&lt;P&gt;.setParent(P parent) {
+ parent.addChild(this);
+ }
+
+ /**
+ * Matches at an addChild join point for the parent type P and child type C
+ */
+ public pointcut addingChild(Parent p, Child c) :
+ execution(* Parent.addChild(Child)) &amp;&amp; this(p) &amp;&amp; args(c);
- /**
- * ensure bi-directional navigation on adding a child
- */
- public void P.addChild(C child) {
- if (child.parent != null) {
- child.parent.removeChild(child);
- }
- children.add(child);
- child.parent = this;
- }
-
- /**
- * ensure bi-directional navigation on removing a child
- */
- public void P.removeChild(C child) {
- if (children.remove(child)) {
- child.parent = null;
- }
- }
+ /**
+ * Matches at a removeChild join point for the parent type P and child type C
+ */
+ public pointcut removingChild(Parent p, Child c) :
+ execution(* Parent.removeChild(C)) &amp;&amp; this(p) &amp;&amp; args(c);
- /**
- * ensure bi-directional navigation on setting parent
- */
- public void C.setParent(P parent) {
- parent.addChild(this);
- }
-
- public pointcut addingChild(P p, C c) :
- execution(* P.addChild(C)) &amp;&amp; this(p) &amp;&amp; args(c);
-
- public pointcut removingChild(P p, C c) :
- execution(* P.removeChild(C)) &amp;&amp; this(p) &amp;&amp; args(c);
- }
+ }
+
</pre><p>
- Note in the above example how the type parameters <tt>P</tt> and <tt>C</tt> can be
- used in inter-type declarations, pointcut expressions, and any other member of the aspect type.
- </p><p>
The example aspect captures the protocol for managing a bi-directional parent-child relationship between
any two types playing the role of parent and child. In a compiler implementation managing an abstract syntax
tree (AST) in which AST nodes may contain other AST nodes we could declare the concrete aspect:
@@ -1640,57 +1567,58 @@
</pre><p>
As a result of this declaration, <tt>ASTNode</tt> gains members:
</p><table class="simplelist" border="0" summary="Simple list"><tr><td><tt>List&lt;ASTNode&gt; children</tt></td></tr><tr><td><tt>ASTNode parent</tt></td></tr><tr><td><tt>List&lt;ASTNode&gt;getChildren()</tt></td></tr><tr><td><tt>ASTNode getParent()</tt></td></tr><tr><td><tt>void addChild(ASTNode child)</tt></td></tr><tr><td><tt>void removeChild(ASTNode child)</tt></td></tr><tr><td><tt>void setParent(ASTNode parent)</tt></td></tr></table><p>
- In a system managing files and folders, we could declare the concrete aspect:
+ In a system managing orders, we could declare the concrete aspect:
</p><pre class="programlisting">
- public aspect FilesInFolders extends ParentChildRelationship&lt;Folder,File&gt; {
+ public aspect OrderItemsInOrders extends ParentChildRelationship&lt;Order,OrderItem&gt; {
}
</pre><p>
- As a result of this declaration, <tt>Folder</tt> gains members:
- </p><table class="simplelist" border="0" summary="Simple list"><tr><td><tt>List&lt;File&gt; children</tt></td></tr><tr><td><tt>List&lt;File&gt; getChildren()</tt></td></tr><tr><td><tt>void addChild(File child)</tt></td></tr><tr><td><tt>void removeChild(File child)</tt></td></tr></table><p>and <tt>File</tt> gains members:</p><table class="simplelist" border="0" summary="Simple list"><tr><td><tt>Folder parent</tt></td></tr><tr><td><tt>Folder getParent()</tt></td></tr><tr><td><tt>void setParent(Folder parent)</tt></td></tr></table><p>When used in this way, the type parameters in a generic abstract aspect declare
- <span class="emphasis"><i>roles</i></span>, and the parameterization of the abstract aspect in the <tt>extends</tt>
- clause binds types to those roles. This is a case where you may consider departing from the standard practice
- of using a single letter to represent a type parameter, and instead use a role name. It makes no difference
- to the compiler which option you choose of course.</p><pre class="programlisting">
- public abstract aspect ParentChildRelationship&lt;Parent,Child&gt; {
-
- /**
- * Parents contain a list of children
- */
- private List&lt;Child&gt; Parent.children;
-
- /**
- * Each child has a parent
- */
- private Parent Child.parent;
-
- /**
- * Parents provide access to their children
- */
- public List&lt;Children&gt; Parent.getChildren() {
- return Collections.unmodifiableList(children);
- }
-
- /**
- * A child provides access to its parent
- */
- public Parent Children.getParent() {
- return parent;
- }
-
- /**
- * ensure bi-directional navigation on adding a child
- */
- public void Parent.addChild(Child child) {
- if (child.parent != null) {
- child.parent.removeChild(child);
- }
- children.add(child);
- child.parent = this;
- }
-
- ...
- </pre></div></div></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="autoboxing"></a>Chapter 4. Autoboxing and Unboxing</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#boxing-inJava5">Autoboxing and Unboxing in Java 5</a></dt><dt><a href="#autoboxing-in-aspectj5">Autoboxing and Join Point matching in AspectJ 5</a></dt><dt><a href="#autoboxing-and-method-dispatch">Inter-type method declarations and method dispatch</a></dt></dl></div><div class="sect1"><a name="boxing-inJava5"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="boxing-inJava5"></a>Autoboxing and Unboxing in Java 5</h2></div></div><p>
+ As a result of this declaration, <tt>Order</tt> gains members:
+ </p><table class="simplelist" border="0" summary="Simple list"><tr><td><tt>List&lt;OrderItem&gt; children</tt></td></tr><tr><td><tt>List&lt;OrderItem&gt; getChildren()</tt></td></tr><tr><td><tt>void addChild(OrderItem child)</tt></td></tr><tr><td><tt>void removeChild(OrderItem child)</tt></td></tr></table><p>and <tt>OrderItem</tt> gains members:</p><table class="simplelist" border="0" summary="Simple list"><tr><td><tt>Order parent</tt></td></tr><tr><td><tt>Order getParent()</tt></td></tr><tr><td><tt>void setParent(Order parent)</tt></td></tr></table><p>A second example of an abstract aspect, this time for handling exceptions in a uniform
+ manner, is shown below:</p><pre class="programlisting">
+ abstract aspect ExceptionHandling&lt;T extends Throwable&gt; {
+
+ /**
+ * method to be implemented by sub-aspects to handle thrown exceptions
+ */
+ protected abstract void onException(T anException);
+
+ /**
+ * to be defined by sub-aspects to specify the scope of exception handling
+ */
+ protected abstract pointcut inExceptionHandlingScope();
+
+ /**
+ * soften T within the scope of the aspect
+ */
+ declare soft: T : inExceptionHandlingScope();
+
+ /**
+ * bind an exception thrown in scope and pass it to the handler
+ */
+ after() throwing (T anException) : inExceptionHandlingScope() {
+ onException(anException);
+ }
+
+ }
+ </pre><p>Notice how the type variable <tt>T extends Throwable</tt> allows the
+ components of the aspect to be designed to work together in a type-safe manner. The
+ following concrete sub-aspect shows how the abstract aspect might be extended to
+ handle <tt>IOExceptions</tt>.</p><pre class="programlisting">
+ public aspect IOExceptionHandling extends ExceptionHandling&lt;IOException&gt;{
+
+ protected pointcut inExceptionHandlingScope() :
+ call(* doIO*(..)) &amp;&amp; within(org.xyz..*);
+
+ /**
+ * called whenever an IOException is thrown in scope.
+ */
+ protected void onException(IOException ex) {
+ System.err.println("handled exception: " + ex.getMessage());
+ throw new MyDomainException(ex);
+ }
+ }
+ </pre></div></div></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="autoboxing"></a>Chapter 4. Autoboxing and Unboxing</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#boxing-inJava5">Autoboxing and Unboxing in Java 5</a></dt><dt><a href="#autoboxing-in-aspectj5">Autoboxing and Join Point matching in AspectJ 5</a></dt><dt><a href="#autoboxing-and-method-dispatch">Inter-type method declarations and method dispatch</a></dt></dl></div><div class="sect1"><a name="boxing-inJava5"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="boxing-inJava5"></a>Autoboxing and Unboxing in Java 5</h2></div></div><p>
Java 5 (and hence AspectJ 1.5) supports automatic conversion of
primitive types (int, float, double etc.) to their object equivalents
(Integer, Float, Double,...) in assignments and method and constructor
@@ -1713,7 +1641,7 @@
AspectJ 5 applies autoboxing and unboxing in determining argument matching.
In other words, <tt>args(Integer)</tt> will match any join
point at which there is a single argument of type <tt>Integer</tt>
- or of type <tt>int</tt>.</p><div class="itemizedlist"><ul><li><a name="d0e3458"></a>args(Integer) and args(int) are equivalent</li><li><a name="d0e3460"></a>args(Float) and args(float) are equivalent</li><li><a name="d0e3462"></a>args(Double) and args(double) are equivalent</li><li><a name="d0e3464"></a>args(Short) and args(short) are equivalent</li><li><a name="d0e3466"></a>args(Byte) and args(byte) are equivalent</li><li><a name="d0e3468"></a>args(Long) and args(long) are equivalent</li><li><a name="d0e3470"></a>args(Boolean) and args(boolean) are equivalent</li></ul></div><p>
+ or of type <tt>int</tt>.</p><div class="itemizedlist"><ul><li><a name="d0e3141"></a>args(Integer) and args(int) are equivalent</li><li><a name="d0e3143"></a>args(Float) and args(float) are equivalent</li><li><a name="d0e3145"></a>args(Double) and args(double) are equivalent</li><li><a name="d0e3147"></a>args(Short) and args(short) are equivalent</li><li><a name="d0e3149"></a>args(Byte) and args(byte) are equivalent</li><li><a name="d0e3151"></a>args(Long) and args(long) are equivalent</li><li><a name="d0e3153"></a>args(Boolean) and args(boolean) are equivalent</li></ul></div><p>
Autoboxing and unboxing are also applied when binding pointcut or
advice parameters, for example:
</p><pre class="programlisting">
@@ -1724,10 +1652,10 @@
}
</pre></div><div class="sect1"><a name="autoboxing-and-method-dispatch"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="autoboxing-and-method-dispatch"></a>Inter-type method declarations and method dispatch</h2></div></div><p>Autoboxing, unboxing, and also varargs all affect the method
dispatch algorithm used in Java 5. In AspectJ 5, the target method
- of a call is selected according to the following algorithm:</p><div class="orderedlist"><ol type="1"><li><a name="d0e3482"></a>Attempt to locate a matching method or inter-type declared
+ of a call is selected according to the following algorithm:</p><div class="orderedlist"><ol type="1"><li><a name="d0e3165"></a>Attempt to locate a matching method or inter-type declared
method without considering
- autoboxing, unboxing, or vararg invocations.</li><li><a name="d0e3484"></a>If no match is found, try again considering autoboxing
- and unboxing.</li><li><a name="d0e3486"></a>Finally try again considering both autoboxing, unboxing,
+ autoboxing, unboxing, or vararg invocations.</li><li><a name="d0e3167"></a>If no match is found, try again considering autoboxing
+ and unboxing.</li><li><a name="d0e3169"></a>Finally try again considering both autoboxing, unboxing,
and varargs.</li></ol></div><p>One consequence is that a directly matching inter-type declared
method will take precedence over a method declared locally in the
target class but that only matches via autoboxing.</p></div></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="covariance"></a>Chapter 5. Covariance</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#covariance-inJava5">Covariance in Java 5</a></dt><dt><a href="#covariance-and-join-point-matching">Covariant methods and Join Point matching</a></dt></dl></div><div class="sect1"><a name="covariance-inJava5"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="covariance-inJava5"></a>Covariance in Java 5</h2></div></div><p>
@@ -1759,29 +1687,29 @@
</p><pre class="programlisting">
A A.whoAreYou()
B B.whoAreYou()
- </pre><p>Following the join point matching rules given in <a href="#jpsigs">Join Point Signatures</a>,</p><div class="variablelist"><dl><dt><a name="d0e3540"></a><span class="term">call(* whoAreYou())</span></dt><dd><p><a name="d0e3543"></a>Matches both calls, (since each call join point has at least
+ </pre><p>Following the join point matching rules given in <a href="#jpsigs">Join Point Signatures</a>,</p><div class="variablelist"><dl><dt><a name="d0e3223"></a><span class="term">call(* whoAreYou())</span></dt><dd><p><a name="d0e3226"></a>Matches both calls, (since each call join point has at least
one matching signature).
- </p></dd><dt><a name="d0e3546"></a><span class="term">call(* A.whoAreYou())</span></dt><dd><p><a name="d0e3549"></a>Matches both calls, (since each call join point has at least
+ </p></dd><dt><a name="d0e3229"></a><span class="term">call(* A.whoAreYou())</span></dt><dd><p><a name="d0e3232"></a>Matches both calls, (since each call join point has at least
one matching signature).
- </p></dd><dt><a name="d0e3552"></a><span class="term">call(A whoAreYou())</span></dt><dd><p><a name="d0e3555"></a>Matches both calls, (since each call join point has at least
+ </p></dd><dt><a name="d0e3235"></a><span class="term">call(A whoAreYou())</span></dt><dd><p><a name="d0e3238"></a>Matches both calls, (since each call join point has at least
one matching signature).
- </p></dd><dt><a name="d0e3558"></a><span class="term">call(A B.whoAreYou())</span></dt><dd><p><a name="d0e3561"></a>Does not match anything - neither of the call join points
+ </p></dd><dt><a name="d0e3241"></a><span class="term">call(A B.whoAreYou())</span></dt><dd><p><a name="d0e3244"></a>Does not match anything - neither of the call join points
has a signature matched by this pattern. A lint warning is
given for the call <tt>a.whoAreYou()</tt> ("does not match
because declaring type is A, if match required use target(B)").
- </p></dd><dt><a name="d0e3567"></a><span class="term">call(A+ B.whoAreYou())</span></dt><dd><p><a name="d0e3570"></a>Matches the call to <tt>b.whoAreYou()</tt> since
+ </p></dd><dt><a name="d0e3250"></a><span class="term">call(A+ B.whoAreYou())</span></dt><dd><p><a name="d0e3253"></a>Matches the call to <tt>b.whoAreYou()</tt> since
the signature pattern matches the signature <tt>B B.whoAreYou()</tt>.
A lint warning is given for the call <tt>a.whoAreYou()</tt> ("does not match
because declaring type is A, if match required use target(B)").
- </p></dd><dt><a name="d0e3582"></a><span class="term">call(B A.whoAreYou())</span></dt><dd><p><a name="d0e3585"></a>Does not match anything since neither join point has a
+ </p></dd><dt><a name="d0e3265"></a><span class="term">call(B A.whoAreYou())</span></dt><dd><p><a name="d0e3268"></a>Does not match anything since neither join point has a
signature matched by this pattern.
- </p></dd><dt><a name="d0e3588"></a><span class="term">call(B whoAreYou())</span></dt><dd><p><a name="d0e3591"></a>Matches the call to <tt>b.whoAreYou()</tt> only.
- </p></dd><dt><a name="d0e3597"></a><span class="term">call(B B.whoAreYou())</span></dt><dd><p><a name="d0e3600"></a>Matches the call to <tt>b.whoAreYou()</tt> only.
+ </p></dd><dt><a name="d0e3271"></a><span class="term">call(B whoAreYou())</span></dt><dd><p><a name="d0e3274"></a>Matches the call to <tt>b.whoAreYou()</tt> only.
+ </p></dd><dt><a name="d0e3280"></a><span class="term">call(B B.whoAreYou())</span></dt><dd><p><a name="d0e3283"></a>Matches the call to <tt>b.whoAreYou()</tt> only.
</p></dd></dl></div><p>The rule for signature matching at call and execution join points
is unchanged from AspectJ 1.2: a call or execution pointcut matches if
the signature pattern matches at least one of the signatures of the
join point, and if the modifiers of the method or constructor are matched
- by any modifier pattern or annotation pattern that may be present.</p></div></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="varargs"></a>Chapter 6. Varargs</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#varargs-inJava5">Variable-length Argument Lists in Java 5</a></dt><dd><dl><dt><a href="#d0e3620">Calling Methods and Constructors with variable-length arguments</a></dt></dl></dd><dt><a href="#varargs-in-pcds">Using Variable-length arguments in advice and pointcut expressions</a></dt><dd><dl><dt><a href="#d0e3654">Matching signatures based on variable length argument types</a></dt><dt><a href="#d0e3756">Exposing variable-length arguments as context in pointcuts and advice</a></dt></dl></dd></dl></div><div class="sect1"><a name="varargs-inJava5"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="varargs-inJava5"></a>Variable-length Argument Lists in Java 5</h2></div></div><p>
+ by any modifier pattern or annotation pattern that may be present.</p></div></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="varargs"></a>Chapter 6. Varargs</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#varargs-inJava5">Variable-length Argument Lists in Java 5</a></dt><dd><dl><dt><a href="#d0e3303">Calling Methods and Constructors with variable-length arguments</a></dt></dl></dd><dt><a href="#varargs-in-pcds">Using Variable-length arguments in advice and pointcut expressions</a></dt><dd><dl><dt><a href="#d0e3337">Matching signatures based on variable length argument types</a></dt><dt><a href="#d0e3439">Exposing variable-length arguments as context in pointcuts and advice</a></dt></dl></dd></dl></div><div class="sect1"><a name="varargs-inJava5"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="varargs-inJava5"></a>Variable-length Argument Lists in Java 5</h2></div></div><p>
Java 5 (and hence AspectJ 5) allows you to specify methods that take a
variable number of arguments of a specified type. This is achieved using
an ellipsis (...) in the method signature as shown:
@@ -1791,7 +1719,7 @@
</pre><p>
A method or constructor may take at most one variable length argument, and
this must always be the last declared argument in the signature.
- </p><div class="sect2"><a name="d0e3620"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3620"></a>Calling Methods and Constructors with variable-length arguments</h3></div></div><p>
+ </p><div class="sect2"><a name="d0e3303"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3303"></a>Calling Methods and Constructors with variable-length arguments</h3></div></div><p>
A <span class="emphasis"><i>varargs</i></span> method may be called with zero or more arguments
in the variable argument position. For example, given the definition of
<tt>foo</tt> above, the following calls are all legal:
@@ -1815,7 +1743,7 @@
outlined in the previous section.</p><p>
AspectJ 5 also allows variable length arguments to be matched by pointcut expressions and
bound as formals in advice.
- </p><div class="sect2"><a name="d0e3654"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3654"></a>Matching signatures based on variable length argument types</h3></div></div><p>
+ </p><div class="sect2"><a name="d0e3337"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3337"></a>Matching signatures based on variable length argument types</h3></div></div><p>
Recall from the definition of signature patterns given in the chapter on
annotations (<a href="#signaturePatterns">Signature Patterns</a>), that <tt>MethodPattern</tt>
and <tt>ConstructorPattern</tt> are extended to allow a <tt>varargs</tt>
@@ -1834,14 +1762,14 @@
<tt>execution</tt>, <tt>initialization</tt>,
<tt>preinitialization</tt>, and <tt>withincode</tt>
pointcut designators. Some examples of usage follow:
- </p><div class="variablelist"><dl><dt><a name="d0e3690"></a><span class="term">call(* org.xyz.*.*(int, String...))</span></dt><dd><p><a name="d0e3693"></a>
+ </p><div class="variablelist"><dl><dt><a name="d0e3373"></a><span class="term">call(* org.xyz.*.*(int, String...))</span></dt><dd><p><a name="d0e3376"></a>
Matches a call join point for a call to a method defined in the
<tt>org.xyz</tt> package, taking an <tt>int</tt>
and a <tt>String vararg</tt>.
- </p></dd><dt><a name="d0e3705"></a><span class="term">execution(* org.xyz.*.*(Integer...))</span></dt><dd><p><a name="d0e3708"></a>
+ </p></dd><dt><a name="d0e3388"></a><span class="term">execution(* org.xyz.*.*(Integer...))</span></dt><dd><p><a name="d0e3391"></a>
Matches an execution join point for the execution of a method defined in the
<tt>org.xyz</tt> package, taking an <tt>Integer vararg</tt>.
- </p></dd><dt><a name="d0e3717"></a><span class="term">initialization(org.xyz.*.new((Foo || Goo)...))</span></dt><dd><p><a name="d0e3720"></a>
+ </p></dd><dt><a name="d0e3400"></a><span class="term">initialization(org.xyz.*.new((Foo || Goo)...))</span></dt><dd><p><a name="d0e3403"></a>
Matches the initialization join point for the construction of an
object in the <tt>org.xyz</tt> package via a constructor
taking either a variable number of <tt>Foo</tt> parameters or
@@ -1857,7 +1785,7 @@
for <tt>foo</tt>, but not <tt>bar</tt>. The pointcut
<tt>execution(* *.*(String[]))</tt> matches the execution join point
for <tt>bar</tt> but not <tt>foo</tt>.
- </p></div><div class="sect2"><a name="d0e3756"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3756"></a>Exposing variable-length arguments as context in pointcuts and advice</h3></div></div><p>
+ </p></div><div class="sect2"><a name="d0e3439"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3439"></a>Exposing variable-length arguments as context in pointcuts and advice</h3></div></div><p>
When a varargs parameter is used within the body of a method, it has
an array type, as discussed in the introduction to this section. We follow the
same convention when binding a varargs parameter via the <tt>args</tt>
@@ -1899,12 +1827,12 @@
AspectJ 5 supports the declaration of enumerated types just as Java 5
does. Because of the special restrictions Java 5 places around enumerated
types, AspectJ makes the following additional restrictions:
- </p><div class="itemizedlist"><ul><li><a name="d0e3829"></a>You cannot use declare parents to change the super type of
- an enum.</li><li><a name="d0e3831"></a>You cannot use declare parents to declare java.lang.Enum as
- the parent of any type.</li><li><a name="d0e3833"></a>You cannot make inter-type constructor declarations on an
- enum.</li><li><a name="d0e3835"></a>You cannot extend the set of values in an enum via any
- ITD-like construct.</li><li><a name="d0e3837"></a>You cannot make inter-type method or field declarations on
- an enum.</li><li><a name="d0e3839"></a>You cannot use declare parents to make an enum type implement
+ </p><div class="itemizedlist"><ul><li><a name="d0e3512"></a>You cannot use declare parents to change the super type of
+ an enum.</li><li><a name="d0e3514"></a>You cannot use declare parents to declare java.lang.Enum as
+ the parent of any type.</li><li><a name="d0e3516"></a>You cannot make inter-type constructor declarations on an
+ enum.</li><li><a name="d0e3518"></a>You cannot extend the set of values in an enum via any
+ ITD-like construct.</li><li><a name="d0e3520"></a>You cannot make inter-type method or field declarations on
+ an enum.</li><li><a name="d0e3522"></a>You cannot use declare parents to make an enum type implement
an interface.</li></ul></div><p>In theory, the last of these two items <span class="emphasis"><i>could</i></span>
be supported. However, AspectJ 5 follows the simple rule that <span class="emphasis"><i>
an enum type cannot be the target of an inter-type declaration or declare
@@ -1969,33 +1897,12 @@
Then one aspect instance will be created for each type within
<tt>org.xyz..*</tt>. For each aspect instance, the
after returning advice will match only the execution of constructors
- in the type that the aspect is an instance of. The net result is that
+ within the matched per-type-within type. The net result is that
the aspect tracks all known instances of each type within
<tt>org.xyz..*</tt>. To get access to the instances, a
programmer can simply write
<tt>InstanceTracking.aspectOf(org.xyz.SomeType.class).getInstances()</tt>.
</p><p>
- A <tt>pertypewithin</tt> aspect may optionally be declared
- with a single generic type parameter. In this case, for each type
- <tt>T</tt> matched by the type pattern, the aspect instance
- created will be of type <tt>PerTypeWithinAspect&lt;T&gt;</tt>.
- So the previous example could also be written as:
- </p><pre class="programlisting">
- public aspect InstanceTracking&lt;T&gt; pertypewithin(org.xyz..*) {
-
- // use WeakHashMap for auto-garbage collection of keys
- private Map&lt;T, Boolean&gt; instances = new WeakHashMap&lt;T, Boolean&gt;();
-
- after(T t) returning : execution(new(..)) &amp;&amp; this(t) {
- instances.put(t, true);
- }
-
- public Set&lt;T&gt; getInstances() {
- return instances.keySet();
- }
-
- }
- </pre><p>
The <tt>pertypewithin</tt> aspect instantiation model should
be used when the implementation of a crosscutting concern requires that
some state be maintained for each type in a set of types. To maintain
@@ -2003,7 +1910,7 @@
field. Examples of usage include instance tracking, profiling, and the
implementation of a common tracing idiom that uses one Logger per
traced class.
- </p></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="ataspectj"></a>Chapter 9. An Annotation Based Development Style</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#ataspectj-intro">Introduction</a></dt><dt><a href="#ataspectj-aspects">Aspect Declarations</a></dt><dt><a href="#ataspectj-pcadvice">Pointcuts and Advice</a></dt><dd><dl><dt><a href="#d0e3980">Pointcuts</a></dt><dt><a href="#d0e4101">Advice</a></dt></dl></dd><dt><a href="#ataspectj-itds">Inter-type Declarations</a></dt><dt><a href="#ataspectj-declare">Declare statements</a></dt><dt><a href="#ataspectj-aspectof">aspectOf() and hasAspect() methods</a></dt></dl></div><div class="sect1"><a name="ataspectj-intro"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ataspectj-intro"></a>Introduction</h2></div></div><p>In addition to the familiar AspectJ code-based style of aspect
+ </p></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="ataspectj"></a>Chapter 9. An Annotation Based Development Style</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#ataspectj-intro">Introduction</a></dt><dt><a href="#ataspectj-aspects">Aspect Declarations</a></dt><dd><dl><dt><a href="#d0e3640">Limitations</a></dt></dl></dd><dt><a href="#ataspectj-pcadvice">Pointcuts and Advice</a></dt><dd><dl><dt><a href="#d0e3657">Pointcuts</a></dt><dt><a href="#d0e3796">Advice</a></dt></dl></dd><dt><a href="#ataspectj-itds">Inter-type Declarations</a></dt><dt><a href="#ataspectj-declare">Declare statements</a></dt><dt><a href="#ataspectj-aspectof">aspectOf() and hasAspect() methods</a></dt></dl></div><div class="sect1"><a name="ataspectj-intro"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ataspectj-intro"></a>Introduction</h2></div></div><p>In addition to the familiar AspectJ code-based style of aspect
declaration, AspectJ 5 also supports an annotation-based style of
aspect declaration. We informally call the set of annotations that
support this development style the "@AspectJ" annotations.</p><p>
@@ -2033,23 +1940,21 @@
</pre><p>And since issingleton() is the default aspect instantiation model it is equivalent to:</p><pre class="programlisting">
@Aspect("issingleton()")
public class Foo {}
- </pre><p>Privileged aspects are not supported by the annotation style</p><p>To specify an aspect an aspect instantiation model (the default is
+ </pre><p>To specify an aspect an aspect instantiation model (the default is
singleton), provide the perclause as the
<tt>@Aspect</tt> value.
For example:
</p><pre class="programlisting">
@Aspect("perthis(execution(* abc..*(..)))")
public class Foo {}
-
- is equivalent to...
-
+ </pre><p>is equivalent to...</p><pre class="programlisting">
public aspect Foo perthis(execution(* abc..*(..))) {}
- </pre></div><div class="sect1"><a name="ataspectj-pcadvice"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ataspectj-pcadvice"></a>Pointcuts and Advice</h2></div></div><p>
+ </pre><div class="sect2"><a name="d0e3640"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3640"></a>Limitations</h3></div></div><p>Privileged aspects are not supported by the annotation style.</p></div></div><div class="sect1"><a name="ataspectj-pcadvice"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ataspectj-pcadvice"></a>Pointcuts and Advice</h2></div></div><p>
Pointcut and advice declarations can be made using the
<tt>Pointcut, Before, After, AfterReturning, AfterThrowing,</tt>
and
<tt>Around</tt> annotations.
- </p><div class="sect2"><a name="d0e3980"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3980"></a>Pointcuts</h3></div></div><p>
+ </p><div class="sect2"><a name="d0e3657"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3657"></a>Pointcuts</h3></div></div><p>
Pointcuts are specified using the
<tt>org.aspectj.lang.annotation.Pointcut</tt> annotation
on a method declaration. The method should have a
@@ -2065,31 +1970,23 @@
<tt>args(), target(), this(), @args(), @target(), @this(), @annotation())</tt> in the
pointcut, then they must appear in the method signature.
</p><p>
- There is one special case to the general rule for when you use
- <tt>if()</tt> pointcut
- as detailled in the next section.
- </p><p>A simple example:</p><pre class="programlisting">
+ The <tt>if()</tt> pointcut is treated specially and is discussed in a later section.
+ </p><p>Here is a simple example of a pointcut declaration in both code and @AspectJ styles:</p><pre class="programlisting">
@Pointcut("call(* *.*(..))")
void anyCall() {}
-
- is equivalent to...
-
+ </pre><p>is equivalent to...</p><pre class="programlisting">
pointcut anyCall() : call(* *.*(..));
- </pre><p>An example with formal bindings:</p><pre class="programlisting">
+ </pre><p>When binding arguments, simply declare the arguments as normal in the annotated method:</p><pre class="programlisting">
@Pointcut("call(* *.*(int)) &amp;&amp; args(i) &amp;&amp; target(callee)")
void someCall(int i, Foo callee) {}
-
- is equivalent to...
-
+ </pre><p>is equivalent to...</p><pre class="programlisting">
pointcut anyCall(int i, Foo callee) : call(* *.*(int)) &amp;&amp; args(i) &amp;&amp; target(callee);
</pre><p>An example with modifiers (it is also good to remember that Java 5 annotations are not inherited):</p><pre class="programlisting">
@Pointcut("")
protected abstract void anyCall();
-
- is equivalent to...
-
+ </pre><p>is equivalent to...</p><pre class="programlisting">
protected abstract pointcut anyCall();
- </pre><p>
+ </pre><div class="sect3"><a name="d0e3708"></a><div class="titlepage"><div><h4 class="title"><a name="d0e3708"></a>Type references inside @AspectJ annotations</h4></div></div><p>
Using the code style, types referenced in pointcut expressions are
resolved with respect to the imported types in the compilation unit.
When using the annotation style, types referenced in pointcut
@@ -2097,7 +1994,7 @@
to be fully qualified if they are not by default visible to the
declaring type (outside of the declaring package and
<tt>java.lang</tt>). This
- to not apply to type patterns with wildcards, which are always resolved
+ does not apply to type patterns with wildcards, which are always resolved
in a global scope.
</p><p>
Consider the following compilation unit:
@@ -2130,41 +2027,40 @@
void anyUtilityCall() {}
}
- </pre><p>The
- <tt>value</tt> attribute of the
- <tt>Pointcut</tt> declaration may contain any valid
- AspectJ pointcut declaration - though <tt>if()</tt> pointcut is a special case explained below.
- </p><p>The special case for the <tt>if()</tt> pointcut.</p><p>In code style, it is possible to use the <tt>if(...)</tt> poincut to implement
- conditional pointcut whose residual if form will be evaluated at runtime. The <tt>if(...)</tt>
+ </pre></div><div class="sect3"><a name="d0e3724"></a><div class="titlepage"><div><h4 class="title"><a name="d0e3724"></a>if() pointcut expressions</h4></div></div><p>In code style, it is possible to use the <tt>if(...)</tt> poincut to define
+ a conditional pointcut expression which will be evaluated at runtime for each candidate join point.
+ The <tt>if(...)</tt>
body can be any valid Java boolean expression, and can use any exposed formal, as well as the join point forms
<tt>thisJoinPoint, thisJoinPointStaticPart and thisJoinPointEnclosingStaticPart</tt>.
</p><p>
When using the annotation style, it would be really a pain to write a valid Java expression within
the annotation value so the syntax differs sligthly, whilst providing the very same
- semantics and runtime behaviour. Take the following examples:
+ semantics and runtime behaviour. An <tt>if()</tt> pointcut expression can be
+ declared in an <tt>@Pointcut</tt>, but must either an empty body, or be one
+ of the expression <tt>if(true)</tt> or <tt>if(false)</tt>. The annotated
+ method must be public, static, and return a boolean. The body of the method contains the
+ condition to be evaluated. For example:
</p><pre class="programlisting">
@Pointcut("call(* *.*(int)) &amp;&amp; args(i) &amp;&amp; if()")
public static boolean someCallWithIfTest(int i) {
return i &gt; 0;
}
-
- is equivalent to...
-
+ </pre><p>is equivalent to...</p><pre class="programlisting">
pointcut someCallWithIfTest(int i) : call(* *.*(int)) &amp;&amp; args(i) &amp;&amp; if(i &gt; 0);
</pre><p> and the following is also a valid form:</p><pre class="programlisting">
static int COUNT = 0;
@Pointcut("call(* *.*(int)) &amp;&amp; args(i) &amp;&amp; if()")
public static boolean someCallWithIfTest(int i, JoinPoint jp, JoinPoint.EnclosingStaticPart esjp) {
- // can call any kind of method (though this method is a static one)
+ // any legal Java expression...
return i &gt; 0
&amp;&amp; jp.getSignature().getName.startsWith("doo")
&amp;&amp; esjp.getSignature().getName().startsWith("test")
&amp;&amp; COUNT++ &lt; 10;
}
- @Before("someCallWithIfTest(arg0, jp, enc)") // see how the pointcut is referenced: we obey its exact signature
- public void beforeAdviceWithRuntimeTest(int arg0, JoinPoint jp, JoinPoint.EnclosingStaticPart enc) {
+ @Before("someCallWithIfTest(anInt, jp, enc)")
+ public void beforeAdviceWithRuntimeTest(int anInt, JoinPoint jp, JoinPoint.EnclosingStaticPart enc) {
//...
}
@@ -2178,15 +2074,15 @@
</pre><p>
It is thus possible with the annotation style to use the <tt>if()</tt> pointcut
only within an <tt>@Pointcut</tt> expression. The <tt>if()</tt> must not contain any
- body. The so annotated <tt>@Pointcut</tt> method must then be of the form <tt>public static boolean</tt>
+ body. The annotated <tt>@Pointcut</tt> method must then be of the form <tt>public static boolean</tt>
and can use formal bindings as usual.
- Extra <span class="emphasis"><i>implicit</i></span> (thus unbound) arguments of type JoinPoint, JoinPoint.StaticPart and JoinPoint.EnclosingStaticPart can also be used
- (they can't for regular pointcut without <tt>if()</tt> form).
+ Extra <span class="emphasis"><i>implicit</i></span> arguments of type JoinPoint, JoinPoint.StaticPart and JoinPoint.EnclosingStaticPart can also be used
+ (this is not permitted for regular annotated pointcuts not using the <tt>if()</tt> form).
</p><p>
The special forms <tt>if(true)</tt> and <tt>if(false)</tt> can be used in a more
general way and don't imply that the pointcut method must have a body.
You can thus write <tt>@Before("somePoincut() &amp;&amp; if(false)")</tt>.
- </p></div><div class="sect2"><a name="d0e4101"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4101"></a>Advice</h3></div></div><p>In this section we first discuss the use of annotations for
+ </p></div></div><div class="sect2"><a name="d0e3796"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3796"></a>Advice</h3></div></div><p>In this section we first discuss the use of annotations for
simple advice declarations. Then we show how
<tt>thisJoinPoint</tt>
and its siblings are handled in the body of advice and discuss the
@@ -2202,50 +2098,24 @@
</p><p>A method that has an advice annotation is treated exactly as an
advice declaration by AspectJ's weaver. This includes the join points that
arise when the advice is executed (an adviceexecution join point, not a
- method execution join point), and the restriction that advice cannot be
- invoked explicitly (the weaver will issue an error if an advice method
- is explicitly invoked).</p><p>The following example shows a simple before advice declaration in
+ method execution join point).</p><p>The following example shows a simple before advice declaration in
both styles:</p><pre class="programlisting">
- before() : call(* org.aspectprogrammer..*(..)) &amp;&amp; this(Foo) {
- System.out.println("Call from Foo");
- }
-
- is equivalent to...
-
@Before("call(* org.aspectprogrammer..*(..)) &amp;&amp; this(Foo)")
public void callFromFoo() {
System.out.println("Call from Foo");
}
- </pre><p>Notice one slight difference between the two advice declarations: in
- the annotation style, the advice has a name, "callFromFoo". Even though
- advice cannot be invoked explicitly, this name is useful in join point
- matching when advising advice execution. For this reason, and to preserve
- exact semantic equivalence between the two styles, we also support the
- <tt>org.aspectj.lang.annotation.AdviceName</tt> annotation.
- The exact equivalent declarations are:
- </p><pre class="programlisting">
- @AdviceName("callFromFoo")
+ </pre><p>is equivalent to...</p><pre class="programlisting">
before() : call(* org.aspectprogrammer..*(..)) &amp;&amp; this(Foo) {
System.out.println("Call from Foo");
}
-
- is equivalent to...
-
- @Before("call(* org.aspectprogrammer..*(..)) &amp;&amp; this(Foo)")
- public void callFromFoo() {
- System.out.println("Call from Foo");
- }
- </pre><p>If the advice body needs to know which particular
- <tt>Foo</tt>
- was doing the calling, just add a parameter to the advice declaration.
+ </pre><p>If the advice body needs to know which particular
+ <tt>Foo</tt> instance
+ is making the call, just add a parameter to the advice declaration.
</p><pre class="programlisting">
- @AdviceName("callFromFoo")
before(Foo foo) : call(* org.aspectprogrammer..*(..)) &amp;&amp; this(foo) {
System.out.println("Call from Foo: " + foo);
}
-
- is equivalent to...
-
+ </pre><p>can be written as:</p><pre class="programlisting">
@Before("call(* org.aspectprogrammer..*(..)) &amp;&amp; this(foo)")
public void callFromFoo(Foo foo) {
System.out.println("Call from Foo: " + foo);
@@ -2257,20 +2127,17 @@
be declared as additional method parameters when using the annotation
style.
</p><pre class="programlisting">
- @AdviceName("callFromFoo")
- before(Foo foo) : call(* org.aspectprogrammer..*(..)) &amp;&amp; this(foo) {
+ @Before("call(* org.aspectprogrammer..*(..)) &amp;&amp; this(foo)")
+ public void callFromFoo(JoinPoint thisJoinPoint, Foo foo) {
System.out.println("Call from Foo: " + foo + " at "
+ thisJoinPoint);
}
-
- is equivalent to...
-
- @Before("call(* org.aspectprogrammer..*(..)) &amp;&amp; this(foo)")
- public void callFromFoo(JoinPoint thisJoinPoint, Foo foo) {
+ </pre><p>is equivalent to...</p><pre class="programlisting">
+ before(Foo foo) : call(* org.aspectprogrammer..*(..)) &amp;&amp; this(foo) {
System.out.println("Call from Foo: " + foo + " at "
+ thisJoinPoint);
}
- </pre><p>Advice that needs all three variables would be declared:</p><pre class="programlisting">
+ </pre><p>Advice that needs all three variables would be declared:</p><pre class="programlisting">
@Before("call(* org.aspectprogrammer..*(..)) &amp;&amp; this(Foo)")
public void callFromFoo(JoinPoint thisJoinPoint,
JoinPoint.StaticPart thisJoinPointStaticPart,
@@ -2298,23 +2165,21 @@
parameter as a parameter in the method body and bind it with the "returning"
attribute:
</p><pre class="programlisting">
- after() returning : criticalOperation() {
+ @AfterReturning("criticalOperation()")
+ public void phew() {
System.out.println("phew");
}
- after() returning(Foo f) : call(Foo+.new(..)) {
+ @AfterReturning(pointcut="call(Foo+.new(..))",returning="f")
+ public void itsAFoo(Foo f) {
System.out.println("It's a Foo: " + f);
}
-
- can be written as...
-
- @AfterReturning("criticalOperation()")
- public void phew() {
+ </pre><p>is equivalent to...</p><pre class="programlisting">
+ after() returning : criticalOperation() {
System.out.println("phew");
}
- @AfterReturning(pointcut="call(Foo+.new(..))",returning="f")
- public void itsAFoo(Foo f) {
+ after() returning(Foo f) : call(Foo+.new(..)) {
System.out.println("It's a Foo: " + f);
}
</pre><p>(Note the use of the "pointcut=" prefix in front of the pointcut
@@ -2346,16 +2211,6 @@
return thisJoinPoint.proceed();
}
</pre><p>Here's an example that uses parameters for the proceed call:</p><pre class="programlisting">
- public aspect ProceedAspect {
- pointcut setAge(int i): call(* setAge(..)) &amp;&amp; args(i);
-
- Object around(int i): setAge(i) {
- return proceed(i*2);
- }
- }
-
- can be written as...
-
@Aspect
public class ProceedAspect {
@@ -2369,8 +2224,17 @@
}
- Note that the ProceedingJoinPoint does not need to be passed as the proceed(..) arguments.
- </pre></div></div><div class="sect1"><a name="ataspectj-itds"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ataspectj-itds"></a>Inter-type Declarations</h2></div></div><p>
+ </pre><p>is equivalent to:</p><pre class="programlisting">
+ public aspect ProceedAspect {
+ pointcut setAge(int i): call(* setAge(..)) &amp;&amp; args(i);
+
+ Object around(int i): setAge(i) {
+ return proceed(i*2);
+ }
+ }
+ </pre><p>Note that the ProceedingJoinPoint does not need to be passed to the proceed(..) arguments.
+</p></div></div><div class="sect1"><a name="ataspectj-itds"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ataspectj-itds"></a>Inter-type Declarations</h2></div></div><p><span class="emphasis"><i>The features described in this section will not be supported until the
+ AspectJ 5 M4 milestone build.</i></span></p><p>
Inter-type declarations are challenging to support using an annotation style.
It's very important to preserve the exact same semantics between the code style
and the annotation style. We also want to support compilation of a large set
@@ -2501,7 +2365,10 @@
@DeclareAnnotation("* DAO+.*")
@Persisted Object daoFields;
}
- </pre><p>We also support annotation style declarations for declare warning and
+ </pre><p>
+ <span class="emphasis"><i>Note: Declare annotation is not available in AspectJ 1.5 M3 and syntax may change
+ when the design and implementation is complete.</i></span>
+ </p><p>We also support annotation style declarations for declare warning and
declare error - any corresponding warnings and errors will be emitted at
weave time, not when the aspects containing the declarations are compiled.
(This is the same behaviour as when using declare warning or error with the
@@ -2567,7 +2434,7 @@
analogous to the Java class <tt>Class</tt> and provides access to the members of an aspect.
</p><div class="sect1"><a name="reflection_api"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="reflection_api"></a>The Aspect Class</h2></div></div><p>
- </p></div></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="miscellaneous"></a>Chapter 11. Other Changes in AspectJ 5</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#d0e4336">Pointcuts</a></dt><dd><dl><dt><a href="#d0e4339">Binding of formals</a></dt><dt><a href="#d0e4348">Additional lint warnings</a></dt></dl></dd><dt><a href="#declare-soft">Declare Soft</a></dt><dt><a href="#d0e4390">Tools</a></dt><dd><dl><dt><a href="#d0e4393">Aspectpath</a></dt></dl></dd></dl></div><div class="sect1"><a name="d0e4336"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e4336"></a>Pointcuts</h2></div></div><div class="sect2"><a name="d0e4339"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4339"></a>Binding of formals</h3></div></div><p>
+ </p></div></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="miscellaneous"></a>Chapter 11. Other Changes in AspectJ 5</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#d0e4055">Pointcuts</a></dt><dd><dl><dt><a href="#d0e4058">Binding of formals</a></dt><dt><a href="#d0e4067">Additional lint warnings</a></dt></dl></dd><dt><a href="#declare-soft">Declare Soft</a></dt><dt><a href="#d0e4109">Tools</a></dt><dd><dl><dt><a href="#d0e4112">Aspectpath</a></dt></dl></dd></dl></div><div class="sect1"><a name="d0e4055"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e4055"></a>Pointcuts</h2></div></div><div class="sect2"><a name="d0e4058"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4058"></a>Binding of formals</h3></div></div><p>
AspectJ 5 is more liberal than AspectJ 1.2.1 in accepting pointcut expressions
that bind context variables in more than one location. For example, AspectJ
1.2.1 does not allow:
@@ -2580,7 +2447,7 @@
must be mutually exclusive. In the above example for instance, no join point
can be both an execution join point and a set join point so the two branches
are mutually exclusive.
- </p></div><div class="sect2"><a name="d0e4348"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4348"></a>Additional lint warnings</h3></div></div><p>
+ </p></div><div class="sect2"><a name="d0e4067"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4067"></a>Additional lint warnings</h3></div></div><p>
Discuss detection of common errors -&gt; warning/error, eg. conjunction of more than one
kind of join point. Differing numbers of args in method signature / args / @args /
@parameters.
@@ -2591,12 +2458,12 @@
or a subtype of <tt>RuntimeException</tt> then a new XLint warning will be issued:</p><pre class="programlisting">
declare soft : SomeRuntimeException : execution(* *(..));
- &amp;gt;&amp;gt; "SomeRuntimeException will not be softened as it is already a RuntimeException" [XLint:runtimeExceptionNotSoftened]
+ &gt;&gt; "SomeRuntimeException will not be softened as it is already a RuntimeException" [XLint:runtimeExceptionNotSoftened]
</pre><p>
This XLint message can be controlled by setting the <tt>runtimeExceptionNotSoftened</tt> XLint parameter.
</p><p>
If the exception type specified in a declare soft statement is a super type of <tt>RuntimeException</tt>
- (such as <tt>Exception</tt> for example) then any <font color="red">&lt;i&gt;checked&lt;/i&gt;</font> exception thrown at a matched join point,
+ (such as <tt>Exception</tt> for example) then any <span class="emphasis"><i>checked</i></span> exception thrown at a matched join point,
where the exception is an instance of the softened exception, will be softened to an
<tt>org.aspectj.lang.SoftException</tt>.
</p><pre class="programlisting">
@@ -2623,23 +2490,23 @@
}
}
- </pre></div><div class="sect1"><a name="d0e4390"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e4390"></a>Tools</h2></div></div><div class="sect2"><a name="d0e4393"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4393"></a>Aspectpath</h3></div></div><p>AspectJ 5 allows the specification of directories (containing .class files) on the aspectpath in
- addition to jar/zip files.</p></div></div></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="ltw"></a>Chapter 12. Load-Time Weaving</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#ltw-introduction">Introduction</a></dt><dd><dl><dt><a href="#d0e4415">Weaving class files more than once</a></dt></dl></dd><dt><a href="#ltw-rules">Load-time Weaving Requirements</a></dt><dt><a href="#ltw-configuration">Configuration</a></dt><dd><dl><dt><a href="#d0e4443">Enabling Load-time Weaving</a></dt><dt><a href="#d0e4471">Configuring Load-time Weaving with aop.xml files</a></dt><dt><a href="#d0e4535">Configuring Load-time Weaving with Properties Files</a></dt><dt><a href="#d0e4545">Weaver Options</a></dt></dl></dd><dt><a href="#ltw-packaging">Runtime Requirements for Load-time Weaving</a></dt><dt><a href="#ltw-agents">Supported Agents</a></dt><dd><dl><dt><a href="#d0e4637">JVMTI</a></dt><dt><a href="#d0e4644">JRockit</a></dt></dl></dd></dl></div><div class="sect1"><a name="ltw-introduction"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ltw-introduction"></a>Introduction</h2></div></div><p> The AspectJ 5 weaver takes class files as input and produces class files as output.
+ </pre></div><div class="sect1"><a name="d0e4109"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e4109"></a>Tools</h2></div></div><div class="sect2"><a name="d0e4112"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4112"></a>Aspectpath</h3></div></div><p>AspectJ 5 allows the specification of directories (containing .class files) on the aspectpath in
+ addition to jar/zip files.</p></div></div></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="ltw"></a>Chapter 12. Load-Time Weaving</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#ltw-introduction">Introduction</a></dt><dd><dl><dt><a href="#d0e4134">Weaving class files more than once</a></dt></dl></dd><dt><a href="#ltw-rules">Load-time Weaving Requirements</a></dt><dt><a href="#ltw-configuration">Configuration</a></dt><dd><dl><dt><a href="#d0e4162">Enabling Load-time Weaving</a></dt><dt><a href="#d0e4206">Configuring Load-time Weaving with aop.xml files</a></dt><dt><a href="#d0e4277">Weaver Options</a></dt></dl></dd><dt><a href="#ltw-specialcases">Special cases</a></dt><dt><a href="#ltw-packaging">Runtime Requirements for Load-time Weaving</a></dt><dt><a href="#ltw-agents">Supported Agents</a></dt><dd><dl><dt><a href="#d0e4412">JVMTI</a></dt><dt><a href="#d0e4419">JRockit with Java 1.3/1.4 (use JVMTI on Java 5)</a></dt></dl></dd></dl></div><div class="sect1"><a name="ltw-introduction"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ltw-introduction"></a>Introduction</h2></div></div><p> The AspectJ 5 weaver takes class files as input and produces class files as output.
The weaving process itself can take place at one of three different times: compile-time,
post-compile time, and load-time. The class files produced by the weaving process (and
hence the run-time behaviour of an application) are the same regardless of the approach
- chosen. </p><div class="itemizedlist"><ul><li><a name="d0e4407"></a> Compile-time weaving is the simplest approach. When you have the source code
+ chosen. </p><div class="itemizedlist"><ul><li><a name="d0e4126"></a> Compile-time weaving is the simplest approach. When you have the source code
for an application, ajc will compile from source and produce woven class files as
output. The invocation of the weaver is integral to the ajc compilation process. The
- aspects themselves may be in source or binary form. </li><li><a name="d0e4409"></a> Post-compile weaving (also sometimes called binary weaving) is used to weave
+ aspects themselves may be in source or binary form. </li><li><a name="d0e4128"></a> Post-compile weaving (also sometimes called binary weaving) is used to weave
existing class files and JAR files. As with compile-time weaving,
- the aspects used for weaving may be in source or binary form. </li><li><a name="d0e4411"></a> Load-time weaving (LTW) is simply binary weaving defered until the point that
+ the aspects used for weaving may be in source or binary form. </li><li><a name="d0e4130"></a> Load-time weaving (LTW) is simply binary weaving defered until the point that
a class loader loads a class file and defines the class to the JVM. To support this,
one or more "weaving class loaders", either provided explicitly by the run-time
environment or enabled through a "weaving agent" are required. </li></ul></div><p> You may also hear the term "run-time weaving". We define this as the weaving of
classes that have already been defined to the JVM (without reloading those
classes). AspectJ 5 does not provide explicit support for run-time weaving although
- simple coding patterns can support dynamically enabling and disabling advice in aspects. </p><div class="sect2"><a name="d0e4415"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4415"></a>Weaving class files more than once</h3></div></div><p> By default a class file that has been woven by the AspectJ compiler cannot
+ simple coding patterns can support dynamically enabling and disabling advice in aspects. </p><div class="sect2"><a name="d0e4134"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4134"></a>Weaving class files more than once</h3></div></div><p> By default a class file that has been woven by the AspectJ compiler cannot
subsequently be rewoven (passed as input to the weaver). If you are developing
AspectJ applications that are to be used in a load-time weaving environment, you
need to specify the <tt>-Xreweavable</tt> compiler option when building
@@ -2648,38 +2515,30 @@
reweavable by default, and weaved classes may be as well in 1.5.0 final.</p></div></div><div class="sect1"><a name="ltw-rules"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ltw-rules"></a>Load-time Weaving Requirements</h2></div></div><p> All load-time weaving is done in the context of a class loader, and hence the set of
aspects used for weaving and the types that can be woven are affected by the class
loader delegation model. This ensures that LTW complies with the Java 2 security model.
- The following rules govern the interaction of load-time weaving with class loading: </p><div class="orderedlist"><ol type="1"><li><a name="d0e4432"></a> All aspects to be used for weaving must be defined to the weaver before any
- types to be woven are loaded.</li><li><a name="d0e4434"></a> All abstract and concrete aspects visible to the weaver
+ The following rules govern the interaction of load-time weaving with class loading: </p><div class="orderedlist"><ol type="1"><li><a name="d0e4151"></a> All aspects to be used for weaving must be defined to the weaver before any
+ types to be woven are loaded.</li><li><a name="d0e4153"></a> All abstract and concrete aspects visible to the weaver
are available for extending (abstract aspects) and using for weaving.
A visible aspect is one defined by the
- weaving class loader or one of its parent class loaders.</li><li><a name="d0e4436"></a>A class loader may only weave classes that it defines. It may not weave
+ weaving class loader or one of its parent class loaders.</li><li><a name="d0e4155"></a>A class loader may only weave classes that it defines. It may not weave
classes loaded by a delegate or parent class loader.</li></ol></div></div><div class="sect1"><a name="ltw-configuration"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ltw-configuration"></a>Configuration</h2></div></div><p>AspectJ 5 supports a number of mechanisms designed to make load-time weaving as
easy to use as possibe. The load-time weaving mechanism is chosen through JVM startup options.
Configuration files determine the set of aspects to be used for weaving and which
types will be woven. Additional diagnostic options allow the user to debug the configuration and
- weaving process. </p><div class="sect2"><a name="d0e4443"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4443"></a>Enabling Load-time Weaving</h3></div></div><p> AspectJ 5 supports three different ways of enabling load-time weaving for
+ weaving process. </p><div class="sect2"><a name="d0e4162"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4162"></a>Enabling Load-time Weaving</h3></div></div><p> AspectJ 5 supports several different ways of enabling load-time weaving for
an application: agents, a command-line launch script, and a set of interfaces for
- integration of AspectJ load-time weaving in custom environments. </p><div class="variablelist"><dl><dt><a name="d0e4449"></a><span class="term">Agents</span></dt><dd><p><a name="d0e4452"></a>AspectJ 5 ships with a number of load-time weaving agents that
+ integration of AspectJ load-time weaving in custom environments. </p><div class="variablelist"><dl><dt><a name="d0e4168"></a><span class="term">Agents</span></dt><dd><p><a name="d0e4171"></a>AspectJ 5 ships with a number of load-time weaving agents that
enable load-time weaving. These agents and their configuration
- are execution environment dependent.
- Using Java 5 for example, you can specify the "-javaagent" option
- to the JVM. Configuration for the supported environments is discussed
- later in this chapter. AspectJ 5
- has several agents including those that use JVMTI, and the
- JRockit MAPI. </p></dd><dt><a name="d0e4455"></a><span class="term">Command line</span></dt><dd><p> AspectJ includes a script "aj" that allows programs executed at
- the command line to take advantage of load-time weaving.
- The script is customized when AspectJ is installed depending on the chosen
- JDK. For example, for JDK 1.4 the script uses the
- <tt>-Djava.system.class.loader</tt> system property to replace
- the system class loader with a weaving class loader allowing classes
- loaded from the CLASSPATH to be woven.
- For JDK 1.5 the JVMTI weaving agent is used allowing classes loaded by all
- class loaders to be woven. Versions of the JDK prior to 1.3 are not
- supported by the "aj" mechanism. </p></dd><dt><a name="d0e4465"></a><span class="term">Custom Integration</span></dt><dd><p><a name="d0e4468"></a> A public interface is provided to allow a user written class loader
+ are execution environment dependent. Configuration for the supported environments is discussed
+ later in this chapter.</p><p>
+ Using Java 5 JVMTI you can specify the <tt>-javaagent:pathto/aspectjweaver.jar</tt> option
+ to the JVM.</p><p>
+ Using BEA JRockit and Java 1.3/1.4, the very same behavior can be obtained using BEA JRockit JMAPI features with
+ the <tt>-Xmanagement:class=org.aspectj.weaver.loadtime.JRockitAgent</tt>
+ </p></dd><dt><a name="d0e4200"></a><span class="term">Custom Integration</span></dt><dd><p><a name="d0e4203"></a> A public interface is provided to allow a user written class loader
to instantiate a weaver and weave classes after loading and before
defining them in the JVM. This enables load-time weaving to be supported in
environments where no weaving agent is available. It also allows the
- user to explicity restrict by class loader which classes can be woven. </p></dd></dl></div></div><div class="sect2"><a name="d0e4471"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4471"></a>Configuring Load-time Weaving with aop.xml files</h3></div></div><p>The weaver is configured using one or more <tt>META-INF/aop.xml</tt>
+ user to explicity restrict by class loader which classes can be woven.</p></dd></dl></div></div><div class="sect2"><a name="d0e4206"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4206"></a>Configuring Load-time Weaving with aop.xml files</h3></div></div><p>The weaver is configured using one or more <tt>META-INF/aop.xml</tt>
files located on the class loader search path. Each file may define a list of
concrete aspects to be used for weaving, type patterns describing which types
should woven, and a set of options to be passed to the weaver. In addition AspectJ 5
@@ -2688,7 +2547,7 @@
may define abstract pointcuts (but not abstract
methods). The following example shows a simple aop.xml file: </p><pre class="programlisting">
&lt;aspectj&gt;
-
+
&lt;aspects&gt;
&lt;!-- declare two existing aspects to the weaver --&gt;
&lt;aspect name="com.MyAspect"/&gt;
@@ -2698,14 +2557,14 @@
&lt;concrete-aspect name="com.xyz.tracing.MyTracing" extends="tracing.AbstractTracing"&gt;
&lt;pointcut name="tracingScope" expression="within(org.maw.*)"/&gt;
&lt;/concrete-aspect&gt;
-
+
&lt;!-- Of the set of aspects known to the weaver, use aspects matching
the type pattern "com..*" for weaving. --&gt;
&lt;include within="com..*"/&gt;
-
+
&lt;!-- Do not use any aspects with the @CoolAspect annotation for weaving --&gt;
- &lt;exclude within="@CoolAspect *"/&gt;
-
+ &lt;exclude within="@CoolAspect *"/&gt;
+
&lt;/aspects&gt;
&lt;weaver options="-verbose -XlazyTjp"&gt;
@@ -2715,10 +2574,11 @@
&lt;include within="javax.*"/&gt;
&lt;include within="org.aspectj.*"/&gt;
&lt;include within="(!@NoWeave foo.*) AND foo.*"/&gt;
+ &lt;dump within="somepack.*"/&gt;&lt;!-- will dump weaved classes to the "./_ajdump" folder on disk (for diagnostic purpose) --&gt;
&lt;/weaver&gt;
-
+
&lt;/aspectj&gt;
-
+
</pre><p>
An aop.xml file contains two key sections: "aspects" defines one
or more aspects to the weaver and controls which aspects are to be
@@ -2736,6 +2596,10 @@
auxiliary aspects where the pointcut definitions themselves can be
considered part of the configuration of the service.
</p><p>
+ <span class="emphasis"><i>
+ Note: concrete-aspect is not available in AspectJ 1.5 M3.
+ </i></span>
+ </p><p>
The aspects element may optionally contain one or more include and
exclude elements (by default, all defined aspects are used for weaving).
Specifying include or exclude elements restricts the set of defined
@@ -2752,16 +2616,16 @@
and to aop.properties files as described in the next section).
The files are merged in the order they are
found on the search path (regular <tt>getResourceAsStream</tt> lookup)
- according to the following rules: </p><div class="itemizedlist"><ul><li><a name="d0e4496"></a> The set of available aspects is the set of all
+ according to the following rules: </p><div class="itemizedlist"><ul><li><a name="d0e4236"></a> The set of available aspects is the set of all
declared and defined aspects (<tt>aspect</tt> and
<tt>concrete-aspect</tt> elements of the <tt>aspects</tt>
- section).</li><li><a name="d0e4507"></a>The set of aspects used for weaving is the subset of the available
+ section).</li><li><a name="d0e4247"></a>The set of aspects used for weaving is the subset of the available
aspects that are matched by at least one include statement and are not matched
by any exclude statements. If there are no include statements then all non-excluded
- aspects are included.</li><li><a name="d0e4509"></a> The set of types to be woven are those types matched by at
+ aspects are included.</li><li><a name="d0e4249"></a> The set of types to be woven are those types matched by at
least one weaver <tt>include</tt> element and not matched by any
weaver <tt>exclude</tt> element. If there are no weaver include
- statements then all non-excluded types are included.</li><li><a name="d0e4517"></a> The weaver options are derived by taking the union of the
+ statements then all non-excluded types are included.</li><li><a name="d0e4257"></a> The weaver options are derived by taking the union of the
options specified in each of the weaver options attribute specifications. Where an
option takes a value e.g. <tt>-warn:none</tt> the most recently defined value
will be used.</li></ul></div><p>It is not an error for the same aspect to be defined to the weaver in
@@ -2774,33 +2638,40 @@
</p><p> A <tt>META-INF/aop.xml</tt> file will automatically be generated when
using the <tt>-outjar</tt> option of the AspectJ compiler.
It will simply contain a (possibly empty) set of aspect elements, one for
- each concrete aspect included in the JAR. </p></div><div class="sect2"><a name="d0e4535"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4535"></a>Configuring Load-time Weaving with Properties Files</h3></div></div><p> For memory constrained environments or those without support for XML a simple
- Java Properties file can be used to configure LTW. Just like XML files,
- <tt>META-INF/aop.properties</tt> files are loaded from the class loader
- search path. Everything that can be configured through XML can be configured using a
- Properties file, with the exception of declarative concrete aspects. For example: </p><pre class="programlisting">
- aspects.names=com.MyAspect,com.MyAspect.Inner
- aspects.include=com..*
- aspects.exclude=@CoolAspect
-
- weaver.options=-verbose -XlazyTjp
- weaver.include=javax.* OR org.aspectj.*
- </pre></div><div class="sect2"><a name="d0e4545"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4545"></a>Weaver Options</h3></div></div><p> The table below lists the AspectJ options supported by LTW. All other options
- will be ignored and a warning issued. </p><div class="informaltable" id="d0e4550"><a name="d0e4550"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Option</th><th>Purpose</th></tr></thead><tbody><tr><td><tt>-1.5</tt></td><td>Run the weaver in 1.5 mode (supports autoboxing in
+ each concrete aspect included in the JAR. </p></div><div class="sect2"><a name="d0e4277"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4277"></a>Weaver Options</h3></div></div><p> The table below lists the AspectJ options supported by LTW. All other options
+ will be ignored and a warning issued. </p><div class="informaltable" id="d0e4282"><a name="d0e4282"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Option</th><th>Purpose</th></tr></thead><tbody><tr><td><tt>-verbose</tt></td><td>Issue informational messages about the weaving process. If ever you need to have information
+ when the load time weaving engine is bootstrapped (hence its logger as per <tt>-XmessageHandlerClass:...</tt> not ready yet),
+ you can use the option <tt>-Daj.weaving.verbose=true</tt> on the JVM startup command line. Messages will then be printed
+ on stderr as long as the message handler class is not ready.
+ </td></tr><tr><td><tt>-1.5</tt></td><td>Run the weaver in 1.5 mode (supports autoboxing in
join point matching)</td></tr><tr><td><tt>-XlazyTjp</tt></td><td>Performance optimization for aspects making use
- of thisJoinPoint (non-static parts)</td></tr><tr><td><tt>-Xlint, -Xlint:ignore, ...</tt></td><td>Configure lint messages</td></tr><tr><td><tt>-nowarn, -warn:none</tt></td><td>Suppress warning messages</td></tr><tr><td><tt>-proceedOnError</tt></td><td>Continue weaving even if errors occur (for example,
- "... already woven" errors)</td></tr><tr><td><tt>-verbose</tt></td><td>Issue informational messages about the weaving process</td></tr><tr><td><tt>-Xreweavable</tt></td><td>Produce class files that can subsequently be rewoven</td></tr><tr><td><tt>-XnoInline</tt></td><td>Don't inline around advice.</td></tr><tr><td><tt>-showWeaveInfo</tt></td><td>Issue informational messages whenever the weaver touches a class file</td></tr><tr><td><tt>-XmessageHolderClass:...</tt></td><td>Provide alternative output destination to stdout/stderr for all weaver messages.
+ of thisJoinPoint (non-static parts)</td></tr><tr><td><tt>-Xlintfile:pathToAResource</tt></td><td>Configure lint messages as specified in the given resource (visible from this aop.xml file' classloader)</td></tr><tr><td><tt>-Xlint:default, -Xlint:ignore, ...</tt></td><td>Configure lint messages, refer to documentation for meaningfull values</td></tr><tr><td><tt>-nowarn, -warn:none</tt></td><td>Suppress warning messages</td></tr><tr><td><tt>-proceedOnError</tt></td><td>Continue weaving even if errors occur (for example,
+ "... already woven" errors)</td></tr><tr><td><tt>-Xreweavable</tt></td><td>Produce class files that can subsequently be rewoven</td></tr><tr><td><tt>-XnoInline</tt></td><td>Don't inline around advice.</td></tr><tr><td><tt>-showWeaveInfo</tt></td><td>Issue informational messages whenever the weaver touches a class file</td></tr><tr><td><tt>-XmessageHandlerClass:...</tt></td><td>Provide alternative output destination to stdout/stderr for all weaver messages.
The given value must be the full qualified class name of a class that implements
- <tt>org.aspectj.weaver.loadtime</tt>
+ <tt>org.aspectj.bridge.IMessageHandler</tt>
and that is visible from where the <tt>aop.xml</tt> is packed.
If more than one such options are used,
- the first occurence only is taken into account.</td></tr></tbody></table></div></div></div><div class="sect1"><a name="ltw-packaging"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ltw-packaging"></a>Runtime Requirements for Load-time Weaving</h2></div></div><p> To use LTW the <tt>aspectjweaver.jar</tt> library must be added to the
+ the first occurence only is taken into account.
+ You must also be very cautious about using a custom handler since it is likely that it will be invoked
+ (as well as all its third parties) while the weaving is done, which means that f.e. it cannot be weaved
+ by the aspects that are configured within the same deployment unit.
+ </td></tr></tbody></table></div></div></div><div class="sect1"><a name="ltw-specialcases"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ltw-specialcases"></a>Special cases</h2></div></div><p>
+ Those classes are not exposed to the LTW infrastructure, no matter
+ the configuration of the <tt>aop.xml</tt> file(s):
+ <div class="itemizedlist"><ul><li><a name="d0e4378"></a>All <tt>org.aspectj.*</tt> classes (and subpackages) - as those are needed by the infrastructure itself</li><li><a name="d0e4383"></a>All <tt>java.*</tt> and <tt>javax.*</tt> classes (and subpackages)</li><li><a name="d0e4391"></a>All <tt>sun.reflect.*</tt> classes - as those are JDK specific classes used when reflective calls occurs</li></ul></div>
+ </p><p>
+ Despite these restrictions, it is perfectly possible to match call join points for calls to these types providing the calling
+ class is exposed to the weaver. Subtypes of these excluded types that are exposed to the weaver may of course be woven.
+ </p><p>
+ Note that dynamic proxy representations are exposed to the LTW infrastructure and are not considered
+ a special case.
+ </p></div><div class="sect1"><a name="ltw-packaging"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ltw-packaging"></a>Runtime Requirements for Load-time Weaving</h2></div></div><p> To use LTW the <tt>aspectjweaver.jar</tt> library must be added to the
classpath. This contains the AspectJ 5 runtime, weaver, weaving class loader and
- weaving agents. It also contains the DTD for parsing XML weaving configuration files. </p></div><div class="sect1"><a name="ltw-agents"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ltw-agents"></a>Supported Agents</h2></div></div><div class="sect2"><a name="d0e4637"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4637"></a>JVMTI</h3></div></div><p> When using JDK 1.5 the JVMTI agent can be used by starting the JVM with the
+ weaving agents. It also contains the DTD for parsing XML weaving configuration files. </p></div><div class="sect1"><a name="ltw-agents"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ltw-agents"></a>Supported Agents</h2></div></div><div class="sect2"><a name="d0e4412"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4412"></a>JVMTI</h3></div></div><p> When using Java 5 the JVMTI agent can be used by starting the JVM with the
following option (adapt according to the path to aspectjweaver.jar): </p><pre class="programlisting">
- -javaagent=aspectjweaver.jar
- </pre></div><div class="sect2"><a name="d0e4644"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4644"></a>JRockit</h3></div></div><p> The JRockit agent is configured with the following JVM option: </p><pre class="programlisting">
- -Xmanagement:class=org.aspectj.weaver.tools.JRockitWeavingAgent
+ -javaagent:pathto/aspectjweaver.jar
+ </pre></div><div class="sect2"><a name="d0e4419"></a><div class="titlepage"><div><h3 class="title"><a name="d0e4419"></a>JRockit with Java 1.3/1.4 (use JVMTI on Java 5)</h3></div></div><p> The JRockit agent is configured with the following JVM option: </p><pre class="programlisting">
+ -Xmanagement:class=org.aspectj.weaver.loadtime.JRockitAgent
</pre></div></div></div><div class="appendix"><div class="titlepage"><div><h2 class="title"><a name="grammar"></a>Appendix A. A Grammar for the AspectJ 5 Language</h2></div></div><pre class="programlisting">
=== type patterns ===
diff --git a/org.aspectj.ajde/doc/adk15notebook/varargs-in-pcds.html b/org.aspectj.ajde/doc/adk15notebook/varargs-in-pcds.html
index dd62a6086..feaaa957c 100755
--- a/org.aspectj.ajde/doc/adk15notebook/varargs-in-pcds.html
+++ b/org.aspectj.ajde/doc/adk15notebook/varargs-in-pcds.html
@@ -5,7 +5,7 @@
outlined in the previous section.</p><p>
AspectJ 5 also allows variable length arguments to be matched by pointcut expressions and
bound as formals in advice.
- </p><div class="sect2"><a name="d0e3654"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3654"></a>Matching signatures based on variable length argument types</h3></div></div><p>
+ </p><div class="sect2"><a name="d0e3337"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3337"></a>Matching signatures based on variable length argument types</h3></div></div><p>
Recall from the definition of signature patterns given in the chapter on
annotations (<a href="annotations-pointcuts-and-advice.html#signaturePatterns">Signature Patterns</a>), that <tt>MethodPattern</tt>
and <tt>ConstructorPattern</tt> are extended to allow a <tt>varargs</tt>
@@ -24,14 +24,14 @@
<tt>execution</tt>, <tt>initialization</tt>,
<tt>preinitialization</tt>, and <tt>withincode</tt>
pointcut designators. Some examples of usage follow:
- </p><div class="variablelist"><dl><dt><a name="d0e3690"></a><span class="term">call(* org.xyz.*.*(int, String...))</span></dt><dd><p><a name="d0e3693"></a>
+ </p><div class="variablelist"><dl><dt><a name="d0e3373"></a><span class="term">call(* org.xyz.*.*(int, String...))</span></dt><dd><p><a name="d0e3376"></a>
Matches a call join point for a call to a method defined in the
<tt>org.xyz</tt> package, taking an <tt>int</tt>
and a <tt>String vararg</tt>.
- </p></dd><dt><a name="d0e3705"></a><span class="term">execution(* org.xyz.*.*(Integer...))</span></dt><dd><p><a name="d0e3708"></a>
+ </p></dd><dt><a name="d0e3388"></a><span class="term">execution(* org.xyz.*.*(Integer...))</span></dt><dd><p><a name="d0e3391"></a>
Matches an execution join point for the execution of a method defined in the
<tt>org.xyz</tt> package, taking an <tt>Integer vararg</tt>.
- </p></dd><dt><a name="d0e3717"></a><span class="term">initialization(org.xyz.*.new((Foo || Goo)...))</span></dt><dd><p><a name="d0e3720"></a>
+ </p></dd><dt><a name="d0e3400"></a><span class="term">initialization(org.xyz.*.new((Foo || Goo)...))</span></dt><dd><p><a name="d0e3403"></a>
Matches the initialization join point for the construction of an
object in the <tt>org.xyz</tt> package via a constructor
taking either a variable number of <tt>Foo</tt> parameters or
@@ -47,7 +47,7 @@
for <tt>foo</tt>, but not <tt>bar</tt>. The pointcut
<tt>execution(* *.*(String[]))</tt> matches the execution join point
for <tt>bar</tt> but not <tt>foo</tt>.
- </p></div><div class="sect2"><a name="d0e3756"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3756"></a>Exposing variable-length arguments as context in pointcuts and advice</h3></div></div><p>
+ </p></div><div class="sect2"><a name="d0e3439"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3439"></a>Exposing variable-length arguments as context in pointcuts and advice</h3></div></div><p>
When a varargs parameter is used within the body of a method, it has
an array type, as discussed in the introduction to this section. We follow the
same convention when binding a varargs parameter via the <tt>args</tt>
diff --git a/org.aspectj.ajde/doc/adk15notebook/varargs.html b/org.aspectj.ajde/doc/adk15notebook/varargs.html
index f5801ce03..9f23e512b 100755
--- a/org.aspectj.ajde/doc/adk15notebook/varargs.html
+++ b/org.aspectj.ajde/doc/adk15notebook/varargs.html
@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Chapter 6. Varargs</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="previous" href="covariance-and-join-point-matching.html" title="Covariant methods and Join Point matching"><link rel="next" href="varargs-in-pcds.html" title="Using Variable-length arguments in advice and pointcut expressions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 6. Varargs</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="covariance-and-join-point-matching.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="varargs-in-pcds.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="varargs"></a>Chapter 6. Varargs</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="varargs.html#varargs-inJava5">Variable-length Argument Lists in Java 5</a></dt><dd><dl><dt><a href="varargs.html#d0e3620">Calling Methods and Constructors with variable-length arguments</a></dt></dl></dd><dt><a href="varargs-in-pcds.html">Using Variable-length arguments in advice and pointcut expressions</a></dt><dd><dl><dt><a href="varargs-in-pcds.html#d0e3654">Matching signatures based on variable length argument types</a></dt><dt><a href="varargs-in-pcds.html#d0e3756">Exposing variable-length arguments as context in pointcuts and advice</a></dt></dl></dd></dl></div><div class="sect1"><a name="varargs-inJava5"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="varargs-inJava5"></a>Variable-length Argument Lists in Java 5</h2></div></div><p>
+ <title>Chapter 6. Varargs</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="previous" href="covariance-and-join-point-matching.html" title="Covariant methods and Join Point matching"><link rel="next" href="varargs-in-pcds.html" title="Using Variable-length arguments in advice and pointcut expressions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 6. Varargs</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="covariance-and-join-point-matching.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="varargs-in-pcds.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="varargs"></a>Chapter 6. Varargs</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="varargs.html#varargs-inJava5">Variable-length Argument Lists in Java 5</a></dt><dd><dl><dt><a href="varargs.html#d0e3303">Calling Methods and Constructors with variable-length arguments</a></dt></dl></dd><dt><a href="varargs-in-pcds.html">Using Variable-length arguments in advice and pointcut expressions</a></dt><dd><dl><dt><a href="varargs-in-pcds.html#d0e3337">Matching signatures based on variable length argument types</a></dt><dt><a href="varargs-in-pcds.html#d0e3439">Exposing variable-length arguments as context in pointcuts and advice</a></dt></dl></dd></dl></div><div class="sect1"><a name="varargs-inJava5"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="varargs-inJava5"></a>Variable-length Argument Lists in Java 5</h2></div></div><p>
Java 5 (and hence AspectJ 5) allows you to specify methods that take a
variable number of arguments of a specified type. This is achieved using
an ellipsis (...) in the method signature as shown:
@@ -10,7 +10,7 @@
</pre><p>
A method or constructor may take at most one variable length argument, and
this must always be the last declared argument in the signature.
- </p><div class="sect2"><a name="d0e3620"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3620"></a>Calling Methods and Constructors with variable-length arguments</h3></div></div><p>
+ </p><div class="sect2"><a name="d0e3303"></a><div class="titlepage"><div><h3 class="title"><a name="d0e3303"></a>Calling Methods and Constructors with variable-length arguments</h3></div></div><p>
A <span class="emphasis"><i>varargs</i></span> method may be called with zero or more arguments
in the variable argument position. For example, given the definition of
<tt>foo</tt> above, the following calls are all legal:
diff --git a/org.aspectj.ajde/doc/aspectj-faq.css b/org.aspectj.ajde/doc/aspectj-faq.css
new file mode 100644
index 000000000..d627302f3
--- /dev/null
+++ b/org.aspectj.ajde/doc/aspectj-faq.css
@@ -0,0 +1,88 @@
+body {
+ font-family: "Lucida Grande", "Trebuchet MS", sans-serif;
+ line-height: 1.1em;
+ }
+
+h2 {
+ font-size: 130%;
+ font-weight: bold ;
+ line-height: 16px;
+ color: #FFFFFF;
+ background-color: #0080C0;
+ padding: 5px;
+}
+
+h3 {
+ font-size: 110%;
+ font-weight: bold ;
+ line-height: 14px;
+ color: #FFFFFF;
+ background-color: orange;
+ padding: 5px;
+}
+
+tt {
+ font-size: 100%;
+ color: #0080C0;
+ }
+
+tt tt {
+ font-size: 100%;
+ }
+
+.programlisting {
+ padding-top: 5px;
+ border: 2px solid #ccc;
+ background: #eee;
+ font-size: 120%;
+ color: #111199;
+
+ }
+
+.term {
+ color: #111199;
+ }
+
+.variablelist dd {
+ margin-left: 18px;
+ padding-left: 20px;
+ background: url(dd_arrow.gif) no-repeat 0 2px;
+ }
+
+.toc dt {
+ font-size: 110%;
+ padding-bottom: 0px;
+ margin-bottom: 5px;
+ }
+
+.toc dl dd dt {
+ font-size: 100%;
+ }
+
+.toc dt {
+ font-size: 100%
+ margin-bottom: 0;
+ }
+
+.informaltable table {
+ margin-left: 5%;
+ }
+
+.informaltable th {
+ background-color: orange;
+ padding: 1px;
+ }
+
+ul li {
+ line-height: 1.2em;
+ }
+
+.keyword {
+ font-weight: bold;
+ color: purple;
+ }
+
+ .question {
+ color: #3333CC;
+ border-top: 1px solid silver;
+ } \ No newline at end of file
diff --git a/org.aspectj.ajde/doc/devguide/ajbrowser-problems.html b/org.aspectj.ajde/doc/devguide/ajbrowser-problems.html
index dc24e19d6..8e6b09b95 100755
--- a/org.aspectj.ajde/doc/devguide/ajbrowser-problems.html
+++ b/org.aspectj.ajde/doc/devguide/ajbrowser-problems.html
@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Isolating problems running the AspectJ browser</title><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="ajbrowser.html" title="Chapter 1. AspectJ Browser"><link rel="previous" href="ch01s04.html" title="Running Programs"><link rel="next" href="antTasks.html" title="Chapter 2. AspectJ Ant Tasks"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Isolating problems running the AspectJ browser</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch01s04.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 1. AspectJ Browser</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="antTasks.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="ajbrowser-problems"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ajbrowser-problems"></a>Isolating problems running the AspectJ browser</h2></div></div><p>
+ <title>Isolating problems running the AspectJ browser</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="ajbrowser.html" title="Chapter 1. AspectJ Browser"><link rel="previous" href="ch01s04.html" title="Running Programs"><link rel="next" href="antTasks.html" title="Chapter 2. AspectJ Ant Tasks"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Isolating problems running the AspectJ browser</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch01s04.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 1. AspectJ Browser</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="antTasks.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="ajbrowser-problems"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ajbrowser-problems"></a>Isolating problems running the AspectJ browser</h2></div></div><p>
If you have problems with the browser not solved by the documentation,
please try to see if you have the same problems when running ajc
directly on the command line.
diff --git a/org.aspectj.ajde/doc/devguide/ajbrowser.html b/org.aspectj.ajde/doc/devguide/ajbrowser.html
index b88a4f42c..37a3562aa 100755
--- a/org.aspectj.ajde/doc/devguide/ajbrowser.html
+++ b/org.aspectj.ajde/doc/devguide/ajbrowser.html
@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Chapter 1. AspectJ Browser</title><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="previous" href="rn01re02.html" title="ajdoc"><link rel="next" href="ch01s02.html" title="Building Programs"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 1. AspectJ Browser</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="rn01re02.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ch01s02.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="ajbrowser"></a>Chapter 1. AspectJ Browser</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="ajbrowser.html#ajbrowser-intro">Introduction</a></dt><dt><a href="ch01s02.html">Building Programs</a></dt><dd><dl><dt><a href="ch01s02.html#d0e875">Build Configurations</a></dt><dt><a href="ch01s02.html#d0e906">Compiling a Program Build Configuration</a></dt></dl></dd><dt><a href="ch01s03.html">Navigating Program Structure</a></dt><dd><dl><dt><a href="ch01s03.html#d0e941">Example: Exploring the "Spacewar" sample code </a></dt></dl></dd><dt><a href="ch01s04.html">Running Programs</a></dt><dt><a href="ajbrowser-problems.html">Isolating problems running the AspectJ browser</a></dt><dd><dl><dt><a href="ajbrowser-problems.html#ajbrowser-knownProblems">Known issues with the AspectJ browser</a></dt><dt><a href="ajbrowser-problems.html#ajbrowser-limitations">Limitations</a></dt><dt><a href="ajbrowser-problems.html#ajbrowser-feedback">AspectJ Browser questions and bugs</a></dt></dl></dd></dl></div><div class="sect1"><a name="ajbrowser-intro"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ajbrowser-intro"></a>Introduction</h2></div></div><p>
+ <title>Chapter 1. AspectJ Browser</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="previous" href="ajdoc-ref.html" title="ajdoc"><link rel="next" href="ch01s02.html" title="Building Programs"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 1. AspectJ Browser</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ajdoc-ref.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ch01s02.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="ajbrowser"></a>Chapter 1. AspectJ Browser</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="ajbrowser.html#ajbrowser-intro">Introduction</a></dt><dt><a href="ch01s02.html">Building Programs</a></dt><dd><dl><dt><a href="ch01s02.html#d0e875">Build Configurations</a></dt><dt><a href="ch01s02.html#d0e906">Compiling a Program Build Configuration</a></dt></dl></dd><dt><a href="ch01s03.html">Navigating Program Structure</a></dt><dd><dl><dt><a href="ch01s03.html#d0e941">Example: Exploring the "Spacewar" sample code </a></dt></dl></dd><dt><a href="ch01s04.html">Running Programs</a></dt><dt><a href="ajbrowser-problems.html">Isolating problems running the AspectJ browser</a></dt><dd><dl><dt><a href="ajbrowser-problems.html#ajbrowser-knownProblems">Known issues with the AspectJ browser</a></dt><dt><a href="ajbrowser-problems.html#ajbrowser-limitations">Limitations</a></dt><dt><a href="ajbrowser-problems.html#ajbrowser-feedback">AspectJ Browser questions and bugs</a></dt></dl></dd></dl></div><div class="sect1"><a name="ajbrowser-intro"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="ajbrowser-intro"></a>Introduction</h2></div></div><p>
AJBrowser presents a GUI for compiling programs with ajc
and navigating crosscutting structure.
</p><p>
@@ -26,4 +26,4 @@
<pre class="programlisting">
java -jar aspectj1.1/lib/aspectjtools.jar aspectj1.1/doc/examples/spacewar/debug.lst
</pre>
- </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="rn01re02.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ch01s02.html">Next</a></td></tr><tr><td width="40%" align="left">ajdoc&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right">&nbsp;Building Programs</td></tr></table></div></body></html> \ No newline at end of file
+ </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ajdoc-ref.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ch01s02.html">Next</a></td></tr><tr><td width="40%" align="left">ajdoc&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right">&nbsp;Building Programs</td></tr></table></div></body></html> \ No newline at end of file
diff --git a/org.aspectj.ajde/doc/devguide/ajc-ref.html b/org.aspectj.ajde/doc/devguide/ajc-ref.html
index 7cd81ec0d..4ac970a2b 100755
--- a/org.aspectj.ajde/doc/devguide/ajc-ref.html
+++ b/org.aspectj.ajde/doc/devguide/ajc-ref.html
@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>ajc</title><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="rn01.html" title="Command-line tools"><link rel="previous" href="rn01.html" title="Command-line tools"><link rel="next" href="rn01re02.html" title="ajdoc"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ajc</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="rn01.html">Prev</a>&nbsp;</td><th width="60%" align="center">Command-line tools</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="rn01re02.html">Next</a></td></tr></table><hr></div><div class="refentry"><h1 class="title"><a name="ajc-ref"></a>ajc</h1><div class="refnamediv"><a name="d0e37"></a><h2>Name</h2>ajc &#8212; compiler and bytecode weaver for the AspectJ and Java languages</div><div class="refsynopsisdiv"><a name="d0e42"></a><h2>Synopsis</h2><div class="cmdsynopsis" id="d0e43"><a name="d0e43"></a><tt>ajc</tt> [<i><tt>Options</tt></i>] [<i><tt>file...</tt></i> | @<i><tt>file...</tt></i> | -argfile <i><tt>file...</tt></i>]</div></div><div class="refsect1"><a name="ajc"></a><h2>Description</h2><p>The <b>ajc</b> command compiles AspectJ and Java
+ <title>ajc</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="rn01.html" title="Command-line tools"><link rel="previous" href="rn01.html" title="Command-line tools"><link rel="next" href="ajdoc-ref.html" title="ajdoc"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ajc</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="rn01.html">Prev</a>&nbsp;</td><th width="60%" align="center">Command-line tools</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ajdoc-ref.html">Next</a></td></tr></table><hr></div><div class="refentry"><h1 class="title"><a name="ajc-ref"></a>ajc</h1><div class="refnamediv"><a name="d0e37"></a><h2>Name</h2>ajc &#8212; compiler and bytecode weaver for the AspectJ and Java languages</div><div class="refsynopsisdiv"><a name="d0e42"></a><h2>Synopsis</h2><div class="cmdsynopsis" id="d0e43"><a name="d0e43"></a><tt>ajc</tt> [<i><tt>Options</tt></i>] [<i><tt>file...</tt></i> | @<i><tt>file...</tt></i> | -argfile <i><tt>file...</tt></i>]</div></div><div class="refsect1"><a name="ajc"></a><h2>Description</h2><p>The <b>ajc</b> command compiles AspectJ and Java
language files, weaving aspects as necessary to produce .class files
compliant with any Java VM (1.1 or later).
To do bytecode weaving, it also accepts input classes or aspects
@@ -341,4 +341,4 @@ File0;File1[Number1];File2[Number2] ... :LineNumber
</p><p>In a class file that comes from only a single source file, the AspectJ
compiler generates SourceFile attributes consistent with
traditional Java compilers.
- </p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="rn01.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="rn01re02.html">Next</a></td></tr><tr><td width="40%" align="left">Command-line tools&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="rn01.html">Up</a></td><td width="40%" align="right">&nbsp;ajdoc</td></tr></table></div></body></html> \ No newline at end of file
+ </p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="rn01.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ajdoc-ref.html">Next</a></td></tr><tr><td width="40%" align="left">Command-line tools&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="rn01.html">Up</a></td><td width="40%" align="right">&nbsp;ajdoc</td></tr></table></div></body></html> \ No newline at end of file
diff --git a/org.aspectj.ajde/doc/devguide/ajdoc-ref.html b/org.aspectj.ajde/doc/devguide/ajdoc-ref.html
new file mode 100644
index 000000000..7ae1b1e5a
--- /dev/null
+++ b/org.aspectj.ajde/doc/devguide/ajdoc-ref.html
@@ -0,0 +1,82 @@
+<html><head>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ <title>ajdoc</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="rn01.html" title="Command-line tools"><link rel="previous" href="ajc-ref.html" title="ajc"><link rel="next" href="ajbrowser.html" title="Chapter 1. AspectJ Browser"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ajdoc</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ajc-ref.html">Prev</a>&nbsp;</td><th width="60%" align="center">Command-line tools</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ajbrowser.html">Next</a></td></tr></table><hr></div><div class="refentry"><h1 class="title"><a name="ajdoc-ref"></a>ajdoc</h1><div class="refnamediv"><a name="d0e630"></a><h2>Name</h2>ajdoc &#8212; generate HTML API documentation, including crosscutting structure (early-access)
+ </div><div class="refsynopsisdiv"><a name="d0e635"></a><h2>Synopsis</h2><div class="cmdsynopsis" id="d0e636"><a name="d0e636"></a><tt>ajdoc</tt> [
+ -bootclasspath <i><tt>classpathlist</tt></i>
+ ] [
+ -classpath <i><tt>classpathlist</tt></i>
+ ] [-d <i><tt>path</tt></i>] [-help] [-package] [-protected] [-private] [-public] [-overview <i><tt>overviewFile</tt></i>] [
+ -sourcepath <i><tt>sourcepathlist</tt></i>
+ ] [-verbose] [-version] [<i><tt>sourcefiles...</tt></i> | <i><tt>packages...</tt></i> | @<i><tt>file...</tt></i> | -argfile <i><tt>file...</tt></i>]</div></div><div class="refsect1"><a name="d0e691"></a><h2>Description</h2><p>
+ Similar to <b>javadoc</b>,
+ <b>ajdoc</b> renders HTML documentation for pointcuts,
+ advice, and inter-type declarations, as
+ well as the Java constructs that Javadoc renders.
+ <b>ajdoc</b> also links
+ advice from members affected by the advice and
+ the inter-type declaration for members declared from aspects.
+ The aspect will be fully documented,
+ as will your target classes, including links to any
+ advice or declarations that affect the class.
+ That means, for example, that
+ you can see everything affecting a method when reading
+ the documentation for the method.
+ </p><p>
+ To run <b>ajdoc</b>, use one of the scripts in the
+ AspectJ <tt>bin</tt> directory.
+ The <b>ajdoc</b> implementation builds on Sun's <b>javadoc</b>
+ command line tool, and you use it in the same way with many of
+ the same options
+ (<b>javadoc</b> options are not documented here;
+ for more information on <b>javadoc</b> usage, see the
+ <a href="http://java.sun.com/j2se/javadoc/" target="_top">Javadoc homepage</a>.)
+ </p><p>
+ As with <b>ajc</b> (but unlike <b>javadoc</b>),
+ you pass <b>ajdoc</b> all your aspect source files
+ and any files containing types affected by the aspects;
+ it's often easiest to just pass all the <tt>.java</tt> files
+ in your system.
+ Unlike <b>ajc</b>,
+ <b>ajdoc</b> will try to find package sources using the
+ specified sourcepath if you list packages on the command line.
+ </p><p>
+ To provide an argfile listing the source files, you can use
+ use the same argfile (<tt>@filename</tt>) conventions
+ as with <b>ajc</b>.
+ For example, the following documents all the source files listed
+ in <tt>argfile.lst</tt>, sending the output to
+ the <tt>docDir</tt> output directory.
+
+ <pre class="programlisting">ajdoc -d docDir @argfile.lst</pre>
+
+ See the <a href="ajc-ref.html#ajc" title="Description">ajc documentation</a>
+ for details on the text file format.
+ </p><p>
+ <b>ajdoc</b> currently requires the
+ <tt>tools.jar</tt> from J2SE 1.3 to be on the classpath.
+ Normally the scripts set this up, assuming that your <tt>JAVA_HOME</tt>
+ variable points to an appropriate installation of Java.
+ You may need to provide this jar when using a different
+ version of Java or a JRE.
+ </p></div><div class="refsect1"><a name="d0e779"></a><h2>Known limitations</h2><p>
+ <b>ajdoc</b> documents advice and pointcut members, shows where advice applies and
+ links affected members back to the advice.
+ It currently does not document or add structural links for any inter-type declarations or other declare forms.
+ </p></div><div class="refsect1"><a name="d0e787"></a><h2>Examples</h2><div class="example"><p><a name="ajdocdocumentingspacewar"></a><b>Example 4. Documenting Spacewar</b></p><div class="itemizedlist"><ul><li><p><a name="d0e795"></a>
+ Change into the <tt>examples</tt> directory.
+ </p></li><li><p><a name="d0e801"></a>
+ Type <b><tt>mkdir doc</tt></b> to create the
+ destination directory for the documentation.
+ </p></li><li><p><a name="d0e807"></a>
+ Type <b><tt>ajdoc -private -d doc spacewar
+ coordination</tt></b> to generate the documentation.
+ </p><div class="itemizedlist"><ul><li><p><a name="d0e814"></a>
+ (Use <tt>-private</tt> to get all members, since
+ may of the interesting ones in spacewar are not public.)
+ </p></li></ul></div></li><li><p><a name="d0e820"></a>
+ Type <b><tt>ajdoc -private -d doc @spacewar/demo.lst</tt></b>
+ to use the argfile associated with Spacewar.
+ </p></li><li><p><a name="d0e826"></a>
+ To view the documentation, open the file <tt>index.html</tt>
+ in the <tt>doc</tt> directory using a web browser.
+ </p></li></ul></div></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ajc-ref.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ajbrowser.html">Next</a></td></tr><tr><td width="40%" align="left">ajc&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="rn01.html">Up</a></td><td width="40%" align="right">&nbsp;Chapter 1. AspectJ Browser</td></tr></table></div></body></html> \ No newline at end of file
diff --git a/org.aspectj.ajde/doc/devguide/antTasks-adapter.html b/org.aspectj.ajde/doc/devguide/antTasks-adapter.html
index d2c56fe46..0418b24de 100755
--- a/org.aspectj.ajde/doc/devguide/antTasks-adapter.html
+++ b/org.aspectj.ajde/doc/devguide/antTasks-adapter.html
@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Ajc11CompilerAdapter (javac)</title><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="antTasks.html" title="Chapter 2. AspectJ Ant Tasks"><link rel="previous" href="antTasks-iajc.html" title="AjcTask (iajc)"><link rel="next" href="antTasks-ajc.html" title="Ajc10 (ajc)"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Ajc11CompilerAdapter (javac)</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="antTasks-iajc.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 2. AspectJ Ant Tasks</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="antTasks-ajc.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="antTasks-adapter"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="antTasks-adapter"></a>Ajc11CompilerAdapter (javac)</h2></div></div><p>
+ <title>Ajc11CompilerAdapter (javac)</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="antTasks.html" title="Chapter 2. AspectJ Ant Tasks"><link rel="previous" href="antTasks-iajc.html" title="AjcTask (iajc)"><link rel="next" href="antTasks-ajc.html" title="Ajc10 (ajc)"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Ajc11CompilerAdapter (javac)</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="antTasks-iajc.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 2. AspectJ Ant Tasks</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="antTasks-ajc.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="antTasks-adapter"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="antTasks-adapter"></a>Ajc11CompilerAdapter (javac)</h2></div></div><p>
This CompilerAdapter can be used in javac task calls by setting the
<tt>build.compiler</tt> property.
This enables users to to easily switch between the Javac and AspectJ
@@ -55,44 +55,44 @@
The adapter supports any ajc command-line option passed using compilerarg,
as well as the following options available only in AjcTask.
Find more details on the following options in <a href="antTasks-iajc.html">AjcTask (iajc)</a>.
- </p><div class="itemizedlist"><ul><li><p><a name="d0e1976"></a>
+ </p><div class="itemizedlist"><ul><li><p><a name="d0e1992"></a>
<tt>-Xmaxmem</tt>:
set maximum memory for forking (also settable in javac).
- </p></li><li><p><a name="d0e1982"></a>
+ </p></li><li><p><a name="d0e1998"></a>
<tt>-Xlistfileargs</tt>:
list file arguments (also settable in javac).
- </p></li><li><p><a name="d0e1988"></a>
+ </p></li><li><p><a name="d0e2004"></a>
<tt>-Xfailonerror</tt>:
throw BuildException on compiler error (also settable in javac).
- </p></li><li><p><a name="d0e1994"></a>
+ </p></li><li><p><a name="d0e2010"></a>
<tt>-Xmessageholderclass</tt>:
specify fully-qualified name of class to use as the message holder.
- </p></li><li><p><a name="d0e2000"></a>
+ </p></li><li><p><a name="d0e2016"></a>
<tt>-Xcopyinjars</tt>:
copy resources from any input jars to output
(default behavior since 1.1.1)
- </p></li><li><p><a name="d0e2006"></a>
+ </p></li><li><p><a name="d0e2022"></a>
<tt>-Xsourcerootcopyfilter {filter}</tt>:
copy resources from source directories to output (minus files specified in filter)
- </p></li><li><p><a name="d0e2012"></a>
+ </p></li><li><p><a name="d0e2028"></a>
<tt>-Xtagfile {file}</tt>:
use file to control incremental compilation
- </p></li><li><p><a name="d0e2018"></a>
+ </p></li><li><p><a name="d0e2034"></a>
<tt>-Xsrcdir {dir}</tt>:
add to list of ajc source roots (all source files will be included).
</p></li></ul></div><p>
Special considerations when using Javac and compilerarg:
- </p><div class="itemizedlist"><ul><li><p><a name="d0e2027"></a>
+ </p><div class="itemizedlist"><ul><li><p><a name="d0e2043"></a>
The names above may differ slightly from what you might expect
from AjcTask; use these forms when specifying compilerarg.
- </p></li></ul></div><div class="itemizedlist"><ul><li><p><a name="d0e2031"></a>
+ </p></li></ul></div><div class="itemizedlist"><ul><li><p><a name="d0e2047"></a>
By default the adapter will mimic the Javac task's copying of resource
files by specifying
<tt>"**/CVS/*,**/*.java,**/*.aj"</tt>
for the sourceroot copy filter.
To change this behavior, supply your own value
(e.g., <tt>"**/*"</tt> to copy nothing).
- </p></li></ul></div><div class="itemizedlist"><ul><li><p><a name="d0e2041"></a>
+ </p></li></ul></div><div class="itemizedlist"><ul><li><p><a name="d0e2057"></a>
Warning - define the system property
<tt>build.compiler.clean</tt> to compile all files,
when available.
@@ -115,20 +115,20 @@
</pre><p>
Caveats to consider when using this global
<tt>build.compiler.clean</tt> property:
- </p><div class="orderedlist"><ol type="1"><li><p><a name="d0e2060"></a>
+ </p><div class="orderedlist"><ol type="1"><li><p><a name="d0e2076"></a>
If javac believes there are no out-of-date source files,
then the adapter is never called and cannot clean up,
and the "compile" will appear to complete successfully
though it did nothing.
- </p></li><li><p><a name="d0e2063"></a>
+ </p></li><li><p><a name="d0e2079"></a>
Cleaning will makes stepwise build processes fail if
they depend on the results of the prior compilation being
in the same directory, since cleaning deletes all .class files.
- </p></li><li><p><a name="d0e2066"></a>
+ </p></li><li><p><a name="d0e2082"></a>
This clean process only permits one compile process at a
time for each destination directory because it tracks
recursion by writing a tag file to the destination directory.
- </p></li><li><p><a name="d0e2069"></a>
+ </p></li><li><p><a name="d0e2085"></a>
When running incrementally, the clean happens only before
the initial compile.
</p></li></ol></div></li></ul></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="antTasks-iajc.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="antTasks-ajc.html">Next</a></td></tr><tr><td width="40%" align="left">AjcTask (iajc)&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="antTasks.html">Up</a></td><td width="40%" align="right">&nbsp;Ajc10 (ajc)</td></tr></table></div></body></html> \ No newline at end of file
diff --git a/org.aspectj.ajde/doc/devguide/antTasks-ajc.html b/org.aspectj.ajde/doc/devguide/antTasks-ajc.html
index 9ec086395..e6bad22e4 100755
--- a/org.aspectj.ajde/doc/devguide/antTasks-ajc.html
+++ b/org.aspectj.ajde/doc/devguide/antTasks-ajc.html
@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Ajc10 (ajc)</title><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="antTasks.html" title="Chapter 2. AspectJ Ant Tasks"><link rel="previous" href="antTasks-adapter.html" title="Ajc11CompilerAdapter (javac)"><link rel="next" href="antTasks-problems.html" title="Isolating problems running the Ant tasks"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Ajc10 (ajc)</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="antTasks-adapter.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 2. AspectJ Ant Tasks</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="antTasks-problems.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="antTasks-ajc"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="antTasks-ajc"></a>Ajc10 (ajc)</h2></div></div><p>
+ <title>Ajc10 (ajc)</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="antTasks.html" title="Chapter 2. AspectJ Ant Tasks"><link rel="previous" href="antTasks-adapter.html" title="Ajc11CompilerAdapter (javac)"><link rel="next" href="antTasks-problems.html" title="Isolating problems running the Ant tasks"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Ajc10 (ajc)</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="antTasks-adapter.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 2. AspectJ Ant Tasks</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="antTasks-problems.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="antTasks-ajc"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="antTasks-ajc"></a>Ajc10 (ajc)</h2></div></div><p>
This task handles the same arguments as those used by the AspectJ 1.0 task.
This should permit those with existing build scripts using the Ajc Ant
task to continue using the same scripts when compiling with 1.1.
@@ -21,7 +21,7 @@
<tt>srcdir</tt> (with patterns)).
</p><p>Boolean parameters default to <tt>false</tt>
unless otherwise stated.
- </p><div class="table"><p><a name="d0e2103"></a><b>Table 2.1. AjcTask (ajc) options for specifying sources</b></p><table summary="AjcTask (ajc) options for specifying sources" border="1"><colgroup><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>srcdir
+ </p><div class="table"><p><a name="d0e2119"></a><b>Table 2.1. AjcTask (ajc) options for specifying sources</b></p><table summary="AjcTask (ajc) options for specifying sources" border="1"><colgroup><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>srcdir
</p></td><td><p>
The base directory of the java files.
See
@@ -81,7 +81,7 @@
</p></td></tr><tr><td><p>source
</p></td><td><p>
Value of -source option - ignored unless <tt>1.4</tt>.
- </p></td></tr></tbody></table></div><div class="table"><p><a name="d0e2235"></a><b>Table 2.2. Parameters ignored by the old ajc taskdef,
+ </p></td></tr></tbody></table></div><div class="table"><p><a name="d0e2251"></a><b>Table 2.2. Parameters ignored by the old ajc taskdef,
but now supported or buggy</b></p><table summary="Parameters ignored by the old ajc taskdef, &#xA; but now supported or buggy" border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Supported?</th></tr></thead><tbody><tr><td><p>encoding
</p></td><td><p>Default encoding of source files.
</p></td><td><p>yes
@@ -112,7 +112,7 @@
</p></td></tr></tbody></table></div><p>
The following table shows that many of the unique parameters in
AspectJ 1.0 are no longer supported.
- </p><div class="table"><p><a name="d0e2323"></a><b>Table 2.3. Parameters unique to ajc</b></p><table summary="Parameters unique to ajc" border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>X
+ </p><div class="table"><p><a name="d0e2339"></a><b>Table 2.3. Parameters unique to ajc</b></p><table summary="Parameters unique to ajc" border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>X
</p></td><td><p>
comma-delimited list of extended (-X...) options,
entered without -X (e.g.,
@@ -124,7 +124,7 @@
</p></td><td><p>
A comma-delimited list of argfiles that contain a line-delimited
list of source file paths (absolute or relative to the argfile).
- </p></td></tr></tbody></table></div><div class="sect3"><a name="d0e2358"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2358"></a>argfiles - argument list files</h4></div></div><p>
+ </p></td></tr></tbody></table></div><div class="sect3"><a name="d0e2374"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2374"></a>argfiles - argument list files</h4></div></div><p>
An argument file is a file (usually <tt>{file}.lst</tt>)
containing a list of source file paths
(absolute or relative to the argfile).
diff --git a/org.aspectj.ajde/doc/devguide/antTasks-iajc.html b/org.aspectj.ajde/doc/devguide/antTasks-iajc.html
index 09aaf4e5c..c536621a0 100755
--- a/org.aspectj.ajde/doc/devguide/antTasks-iajc.html
+++ b/org.aspectj.ajde/doc/devguide/antTasks-iajc.html
@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>AjcTask (iajc)</title><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="antTasks.html" title="Chapter 2. AspectJ Ant Tasks"><link rel="previous" href="antTasks-install.html" title="Installing Ant Tasks"><link rel="next" href="antTasks-adapter.html" title="Ajc11CompilerAdapter (javac)"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">AjcTask (iajc)</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="antTasks-install.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 2. AspectJ Ant Tasks</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="antTasks-adapter.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="antTasks-iajc"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="antTasks-iajc"></a>AjcTask (iajc)</h2></div></div><p>
+ <title>AjcTask (iajc)</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="antTasks.html" title="Chapter 2. AspectJ Ant Tasks"><link rel="previous" href="antTasks-install.html" title="Installing Ant Tasks"><link rel="next" href="antTasks-adapter.html" title="Ajc11CompilerAdapter (javac)"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">AjcTask (iajc)</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="antTasks-install.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 2. AspectJ Ant Tasks</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="antTasks-adapter.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="antTasks-iajc"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="antTasks-iajc"></a>AjcTask (iajc)</h2></div></div><p>
This task uses the AspectJ post-1.1 compiler ajc.
The AspectJ compiler can be used like Javac to compile Java sources,
but it can also compile AspectJ sources or weave binary aspects
@@ -47,7 +47,7 @@
<span class="strong"><i>
AjcTask (iajc) options for specifying sources
</i></span>
- </p><div class="informaltable" id="d0e1268"><a name="d0e1268"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>argfiles, argfilesRef
+ </p><div class="informaltable" id="d0e1284"><a name="d0e1284"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>argfiles, argfilesRef
(<a href="antTasks-iajc.html#antTasks-iajc-paths">Path</a>)
</p></td><td><p>
An argument file contains a list of arguments read by the compiler.
@@ -105,7 +105,7 @@
<span class="strong"><i>
AjcTask (iajc) options for specifying output
</i></span>
- </p><div class="informaltable" id="d0e1371"><a name="d0e1371"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>destDir
+ </p><div class="informaltable" id="d0e1387"><a name="d0e1387"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>destDir
</p></td><td><p>
The directory in which to place the generated class files.
Only one of <tt>destDir</tt> and
@@ -150,7 +150,7 @@
<span class="strong"><i>
AjcTask (iajc) options for specifying compiler behavior
</i></span>
- </p><div class="informaltable" id="d0e1459"><a name="d0e1459"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>fork
+ </p><div class="informaltable" id="d0e1475"><a name="d0e1475"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>fork
</p></td><td><p>
Run process in another VM.
This gets the forking classpath either explicitly
@@ -199,7 +199,7 @@
<span class="strong"><i>
AjcTask (iajc) options for specifying compiler side-effects and messages
</i></span>
- </p><div class="informaltable" id="d0e1548"><a name="d0e1548"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>emacssym
+ </p><div class="informaltable" id="d0e1564"><a name="d0e1564"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>emacssym
</p></td><td><p>
If true, emit <tt>.ajesym</tt> symbol files for Emacs support.
</p></td></tr><tr><td><p>verbose
@@ -251,7 +251,7 @@
<span class="strong"><i>
AjcTask (iajc) options for specifying Eclipse compiler options
</i></span>
- </p><div class="informaltable" id="d0e1663"><a name="d0e1663"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>nowarn
+ </p><div class="informaltable" id="d0e1679"><a name="d0e1679"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>nowarn
</p></td><td><p>
If true, same as <tt>warn:none</tt>.
</p></td></tr><tr><td><p>deprecation
@@ -389,12 +389,12 @@
</pre><p>
Below is script with most everything in it. The compile process...
- </p><div class="orderedlist"><ol type="1"><li><p><a name="d0e1884"></a>Runs in incremental mode, recompiling when the user hits return;
- </p></li><li><p><a name="d0e1887"></a>Reads all the source files from two directories;
- </p></li><li><p><a name="d0e1890"></a>Reads binary .class files from input jar and directory;
- </p></li><li><p><a name="d0e1893"></a>Uses a binary aspect library for persistence;
- </p></li><li><p><a name="d0e1896"></a>Outputs to an application jar; and
- </p></li><li><p><a name="d0e1899"></a>Copies resources from the source directories and binary input
+ </p><div class="orderedlist"><ol type="1"><li><p><a name="d0e1900"></a>Runs in incremental mode, recompiling when the user hits return;
+ </p></li><li><p><a name="d0e1903"></a>Reads all the source files from two directories;
+ </p></li><li><p><a name="d0e1906"></a>Reads binary .class files from input jar and directory;
+ </p></li><li><p><a name="d0e1909"></a>Uses a binary aspect library for persistence;
+ </p></li><li><p><a name="d0e1912"></a>Outputs to an application jar; and
+ </p></li><li><p><a name="d0e1915"></a>Copies resources from the source directories and binary input
jar and directories to the application jar. </p></li></ol></div><p>
When this target is built, the compiler will build once and then
wait for input from the user.
@@ -460,7 +460,7 @@
When using this technique, be careful to verify that binary
input jars are themselves up-to-date after they would have been
modified by any build commands.
- </p></div><div class="sect2"><a name="d0e1921"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1921"></a>Programmatically handling compiler messages</h3></div></div><p>
+ </p></div><div class="sect2"><a name="d0e1937"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1937"></a>Programmatically handling compiler messages</h3></div></div><p>
Users may specify a message holder to which the compiler will pass
all messages as they are generated. This will override all of the
normal message printing, but does not prevent the task from failing
diff --git a/org.aspectj.ajde/doc/devguide/antTasks-install.html b/org.aspectj.ajde/doc/devguide/antTasks-install.html
index 745727367..fc3a5ec70 100755
--- a/org.aspectj.ajde/doc/devguide/antTasks-install.html
+++ b/org.aspectj.ajde/doc/devguide/antTasks-install.html
@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Installing Ant Tasks</title><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="antTasks.html" title="Chapter 2. AspectJ Ant Tasks"><link rel="previous" href="antTasks.html" title="Chapter 2. AspectJ Ant Tasks"><link rel="next" href="antTasks-iajc.html" title="AjcTask (iajc)"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Installing Ant Tasks</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="antTasks.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 2. AspectJ Ant Tasks</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="antTasks-iajc.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="antTasks-install"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="antTasks-install"></a>Installing Ant Tasks</h2></div></div><p>
+ <title>Installing Ant Tasks</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="antTasks.html" title="Chapter 2. AspectJ Ant Tasks"><link rel="previous" href="antTasks.html" title="Chapter 2. AspectJ Ant Tasks"><link rel="next" href="antTasks-iajc.html" title="AjcTask (iajc)"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Installing Ant Tasks</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="antTasks.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 2. AspectJ Ant Tasks</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="antTasks-iajc.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="antTasks-install"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="antTasks-install"></a>Installing Ant Tasks</h2></div></div><p>
Install Jakarta Ant 1.5.1:
Please see the official Jakarta Ant website for more information
and the 1.5.1 distribution. This release is source-compatible
@@ -10,11 +10,11 @@
Sources are available under the Common Public License v. 1.0
at <a href="http://eclipse.org/aspectj" target="_top">http://eclipse.org/aspectj</a>.
</p><p>
- In Ant, third-party tasks can be declared using a taskdef entry in
+ In Ant 1.5, third-party tasks can be declared using a taskdef entry in
the build script, to identify the name and classes.
When declaring a task, include the
<tt>aspectjtools.jar</tt> either in the
- taskdef classpath or in ${ANT_HOME}/lib where it will be added
+ taskdef classpath or in <tt>${ANT_HOME}/lib</tt> where it will be added
to the system class path by the ant script.
You may specify the task script names directly,
or use the "resource" attribute to specify the default names:
@@ -27,6 +27,27 @@
The current resource file retains the name "ajc" for the Ajc10 task,
and uses "iajc" for the AspectJ post-1.1 task.
</p><p>
+ In Ant 1.6, third-party tasks are declared in their own namespace
+ using <tt>antlib.xml</tt>. For example, the following
+ script would build and run the spacewar example, if you put the
+ script in the examples directory and <tt>aspectjtools.jar</tt>
+ in the <tt>${ANT_HOME}/lib</tt> directory.
+ </p><pre class="programlisting">
+
+&lt;project name="aspectj-ant1.6" default="spacewar"
+ xmlns:aspectj="antlib:org.aspectj" basedir="."&gt;
+ &lt;target name="spacewar"&gt;
+ &lt;aspectj:iajc
+ argfiles="spacewar/debug.lst"
+ outjar="spacewar.jar"
+ classpath="../../lib/aspectjrt.jar"
+ /&gt;
+ &lt;java classname="spacewar.Game"
+ classpath="spacewar.jar:../../lib/aspectjrt.jar"/&gt;
+ &lt;/target&gt;
+&lt;/project&gt;
+
+ </pre><p>
For more information on using Ant, please refer to Jakarta's
documentation on integrating user-defined Ant tasks into builds.
</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="antTasks.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="antTasks-iajc.html">Next</a></td></tr><tr><td width="40%" align="left">Chapter 2. AspectJ Ant Tasks&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="antTasks.html">Up</a></td><td width="40%" align="right">&nbsp;AjcTask (iajc)</td></tr></table></div></body></html> \ No newline at end of file
diff --git a/org.aspectj.ajde/doc/devguide/antTasks-problems.html b/org.aspectj.ajde/doc/devguide/antTasks-problems.html
index 7fd73f86a..d320957ee 100755
--- a/org.aspectj.ajde/doc/devguide/antTasks-problems.html
+++ b/org.aspectj.ajde/doc/devguide/antTasks-problems.html
@@ -1,18 +1,18 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Isolating problems running the Ant tasks</title><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="antTasks.html" title="Chapter 2. AspectJ Ant Tasks"><link rel="previous" href="antTasks-ajc.html" title="Ajc10 (ajc)"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Isolating problems running the Ant tasks</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="antTasks-ajc.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 2. AspectJ Ant Tasks</th><td width="20%" align="right">&nbsp;</td></tr></table><hr></div><div class="sect1"><a name="antTasks-problems"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="antTasks-problems"></a>Isolating problems running the Ant tasks</h2></div></div><p>
+ <title>Isolating problems running the Ant tasks</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="antTasks.html" title="Chapter 2. AspectJ Ant Tasks"><link rel="previous" href="antTasks-ajc.html" title="Ajc10 (ajc)"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Isolating problems running the Ant tasks</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="antTasks-ajc.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 2. AspectJ Ant Tasks</th><td width="20%" align="right">&nbsp;</td></tr></table><hr></div><div class="sect1"><a name="antTasks-problems"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="antTasks-problems"></a>Isolating problems running the Ant tasks</h2></div></div><p>
If you have problems with the tasks not solved by the documentation,
please try to see if you have the same problems when running ajc
directly on the command line.
- </p><div class="itemizedlist"><ul><li><p><a name="d0e2460"></a>
+ </p><div class="itemizedlist"><ul><li><p><a name="d0e2476"></a>
If the problem occurs on the command line also, then the problem
is not in the task.
(It may be in the tools; please send bug reports.)
- </p></li><li><p><a name="d0e2463"></a>
+ </p></li><li><p><a name="d0e2479"></a>
If the problem does not occur on the command line, then it may
lie in the parameters you are supplying in Ant or in the task's
handling of them.
- </p></li><li><p><a name="d0e2466"></a>
+ </p></li><li><p><a name="d0e2482"></a>
If the build script looks correct and the problem only occurs when
building from Ant, then please send a report
(including your build file, if possible).
diff --git a/org.aspectj.ajde/doc/devguide/antTasks.html b/org.aspectj.ajde/doc/devguide/antTasks.html
index 13170408a..11621afc8 100755
--- a/org.aspectj.ajde/doc/devguide/antTasks.html
+++ b/org.aspectj.ajde/doc/devguide/antTasks.html
@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Chapter 2. AspectJ Ant Tasks</title><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="previous" href="ajbrowser-problems.html" title="Isolating problems running the AspectJ browser"><link rel="next" href="antTasks-install.html" title="Installing Ant Tasks"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 2. AspectJ Ant Tasks</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ajbrowser-problems.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="antTasks-install.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="antTasks"></a>Chapter 2. AspectJ Ant Tasks</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="antTasks.html#antTasks-intro">Introduction</a></dt><dt><a href="antTasks-install.html">Installing Ant Tasks</a></dt><dt><a href="antTasks-iajc.html">AjcTask (iajc)</a></dt><dd><dl><dt><a href="antTasks-iajc.html#antTasks-iajc-options">AjcTask (iajc) Options</a></dt><dt><a href="antTasks-iajc.html#antTasks-nested-includes">AjcTask matching parameters specified as nested elements</a></dt><dt><a href="antTasks-iajc.html#antTasks-iajc-paths">AjcTask Path-like Structures</a></dt><dt><a href="antTasks-iajc.html#antTasks-iajc-sample">Sample of iajc task</a></dt><dt><a href="antTasks-iajc.html#antTasks-iajc-uptodate">Avoiding clean compiles</a></dt><dt><a href="antTasks-iajc.html#d0e1921">Programmatically handling compiler messages</a></dt></dl></dd><dt><a href="antTasks-adapter.html">Ajc11CompilerAdapter (javac)</a></dt><dd><dl><dt><a href="antTasks-adapter.html#antTasks-adapter-sample">Sample of compiler adapter</a></dt><dt><a href="antTasks-adapter.html#antTasks-adapter-options">Compiler adapter compilerarg options</a></dt></dl></dd><dt><a href="antTasks-ajc.html">Ajc10 (ajc)</a></dt><dd><dl><dt><a href="antTasks-ajc.html#antTasks-ajc-options">Ajc10 (ajc) Options</a></dt><dt><a href="antTasks-ajc.html#antTasks-ajc-nested">Ajc10 parameters specified as nested elements</a></dt><dt><a href="antTasks-ajc.html#antTasks-ajc-sample">Sample of ajc task</a></dt></dl></dd><dt><a href="antTasks-problems.html">Isolating problems running the Ant tasks</a></dt><dd><dl><dt><a href="antTasks-problems.html#antTasks-knownProblems">Known issues with the Ant tasks</a></dt><dt><a href="antTasks-problems.html#antTasks-feedback">Ant task questions and bugs</a></dt></dl></dd></dl></div><div class="sect1"><a name="antTasks-intro"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="antTasks-intro"></a>Introduction</h2></div></div><p>
+ <title>Chapter 2. AspectJ Ant Tasks</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="previous" href="ajbrowser-problems.html" title="Isolating problems running the AspectJ browser"><link rel="next" href="antTasks-install.html" title="Installing Ant Tasks"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 2. AspectJ Ant Tasks</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ajbrowser-problems.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="antTasks-install.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="antTasks"></a>Chapter 2. AspectJ Ant Tasks</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="antTasks.html#antTasks-intro">Introduction</a></dt><dt><a href="antTasks-install.html">Installing Ant Tasks</a></dt><dt><a href="antTasks-iajc.html">AjcTask (iajc)</a></dt><dd><dl><dt><a href="antTasks-iajc.html#antTasks-iajc-options">AjcTask (iajc) Options</a></dt><dt><a href="antTasks-iajc.html#antTasks-nested-includes">AjcTask matching parameters specified as nested elements</a></dt><dt><a href="antTasks-iajc.html#antTasks-iajc-paths">AjcTask Path-like Structures</a></dt><dt><a href="antTasks-iajc.html#antTasks-iajc-sample">Sample of iajc task</a></dt><dt><a href="antTasks-iajc.html#antTasks-iajc-uptodate">Avoiding clean compiles</a></dt><dt><a href="antTasks-iajc.html#d0e1937">Programmatically handling compiler messages</a></dt></dl></dd><dt><a href="antTasks-adapter.html">Ajc11CompilerAdapter (javac)</a></dt><dd><dl><dt><a href="antTasks-adapter.html#antTasks-adapter-sample">Sample of compiler adapter</a></dt><dt><a href="antTasks-adapter.html#antTasks-adapter-options">Compiler adapter compilerarg options</a></dt></dl></dd><dt><a href="antTasks-ajc.html">Ajc10 (ajc)</a></dt><dd><dl><dt><a href="antTasks-ajc.html#antTasks-ajc-options">Ajc10 (ajc) Options</a></dt><dt><a href="antTasks-ajc.html#antTasks-ajc-nested">Ajc10 parameters specified as nested elements</a></dt><dt><a href="antTasks-ajc.html#antTasks-ajc-sample">Sample of ajc task</a></dt></dl></dd><dt><a href="antTasks-problems.html">Isolating problems running the Ant tasks</a></dt><dd><dl><dt><a href="antTasks-problems.html#antTasks-knownProblems">Known issues with the Ant tasks</a></dt><dt><a href="antTasks-problems.html#antTasks-feedback">Ant task questions and bugs</a></dt></dl></dd></dl></div><div class="sect1"><a name="antTasks-intro"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="antTasks-intro"></a>Introduction</h2></div></div><p>
AspectJ contains a compiler, <tt>ajc</tt>,
that can be run from Ant.
Included in the <tt>aspectjtools.jar</tt>
diff --git a/org.aspectj.ajde/doc/devguide/aspectj-docs.css b/org.aspectj.ajde/doc/devguide/aspectj-docs.css
new file mode 100644
index 000000000..9be5a3954
--- /dev/null
+++ b/org.aspectj.ajde/doc/devguide/aspectj-docs.css
@@ -0,0 +1,89 @@
+body {
+ font-family: "Lucida Grande", "Trebuchet MS", sans-serif;
+ line-height: 1.1em;
+ }
+
+h1 {
+ margin-bottom: 3px;
+ padding-bottom: 0px;
+ line-height: 1.1em;
+}
+
+h2 {
+ font-size: 130%;
+ font-weight: bold ;
+ line-height: 16px;
+ color: #FFFFFF;
+ background-color: #0080C0;
+ padding: 5px;
+}
+
+h3 {
+ font-size: 110%;
+ font-weight: bold ;
+ line-height: 14px;
+ color: #FFFFFF;
+ background-color: orange;
+ padding: 5px;
+}
+
+tt {
+ font-size: 120%;
+ color: #0080C0;
+ }
+
+tt tt {
+ font-size: 100%;
+ }
+
+.programlisting {
+ padding-top: 5px;
+ border: 2px solid #ccc;
+ background: #eee;
+ font-size: 120%;
+ color: #111199;
+
+ }
+
+.term {
+ color: #111199;
+ }
+
+.variablelist dd {
+ margin-left: 18px;
+ padding-left: 20px;
+ background: url(dd_arrow.gif) no-repeat 0 2px;
+ }
+
+.toc dt {
+ font-size: 110%;
+ padding-bottom: 0px;
+ margin-bottom: 5px;
+ }
+
+.toc dl dd dt {
+ font-size: 100%;
+ }
+
+.toc dt {
+ font-size: 100%
+ margin-bottom: 0;
+ }
+
+.informaltable table {
+ margin-left: 5%;
+ }
+
+.informaltable th {
+ background-color: orange;
+ padding: 1px;
+ }
+
+ul li {
+ line-height: 1.2em;
+ }
+
+.keyword {
+ font-weight: bold;
+ color: purple;
+ } \ No newline at end of file
diff --git a/org.aspectj.ajde/doc/devguide/ch01s02.html b/org.aspectj.ajde/doc/devguide/ch01s02.html
index 22c135d62..2af048416 100755
--- a/org.aspectj.ajde/doc/devguide/ch01s02.html
+++ b/org.aspectj.ajde/doc/devguide/ch01s02.html
@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Building Programs</title><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="ajbrowser.html" title="Chapter 1. AspectJ Browser"><link rel="previous" href="ajbrowser.html" title="Chapter 1. AspectJ Browser"><link rel="next" href="ch01s03.html" title="Navigating Program Structure"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Building Programs</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ajbrowser.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 1. AspectJ Browser</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ch01s03.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="d0e872"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e872"></a>Building Programs</h2></div></div><div class="sect2"><a name="d0e875"></a><div class="titlepage"><div><h3 class="title"><a name="d0e875"></a>Build Configurations</h3></div></div><p>A build configuration is a set of files to compile for a
+ <title>Building Programs</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="ajbrowser.html" title="Chapter 1. AspectJ Browser"><link rel="previous" href="ajbrowser.html" title="Chapter 1. AspectJ Browser"><link rel="next" href="ch01s03.html" title="Navigating Program Structure"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Building Programs</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ajbrowser.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 1. AspectJ Browser</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ch01s03.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="d0e872"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e872"></a>Building Programs</h2></div></div><div class="sect2"><a name="d0e875"></a><div class="titlepage"><div><h3 class="title"><a name="d0e875"></a>Build Configurations</h3></div></div><p>A build configuration is a set of files to compile for a
program (and optionally some additional compile arguments).
Because <tt>ajc</tt> requires all sources to be specified
(at least using the <tt>-sourceroots</tt> option),
diff --git a/org.aspectj.ajde/doc/devguide/ch01s03.html b/org.aspectj.ajde/doc/devguide/ch01s03.html
index 901fd5c17..8e772cd3f 100755
--- a/org.aspectj.ajde/doc/devguide/ch01s03.html
+++ b/org.aspectj.ajde/doc/devguide/ch01s03.html
@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Navigating Program Structure</title><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="ajbrowser.html" title="Chapter 1. AspectJ Browser"><link rel="previous" href="ch01s02.html" title="Building Programs"><link rel="next" href="ch01s04.html" title="Running Programs"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Navigating Program Structure</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch01s02.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 1. AspectJ Browser</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ch01s04.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="d0e932"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e932"></a>Navigating Program Structure</h2></div></div><p>
+ <title>Navigating Program Structure</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="ajbrowser.html" title="Chapter 1. AspectJ Browser"><link rel="previous" href="ch01s02.html" title="Building Programs"><link rel="next" href="ch01s04.html" title="Running Programs"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Navigating Program Structure</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch01s02.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 1. AspectJ Browser</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ch01s04.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="d0e932"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e932"></a>Navigating Program Structure</h2></div></div><p>
Select nodes in the program structure by clicking them (see label 2).
If one node is related to one or more other nodes by an association the
name of the association will appear below that node and will be
diff --git a/org.aspectj.ajde/doc/devguide/ch01s04.html b/org.aspectj.ajde/doc/devguide/ch01s04.html
index d64b39317..497f28435 100755
--- a/org.aspectj.ajde/doc/devguide/ch01s04.html
+++ b/org.aspectj.ajde/doc/devguide/ch01s04.html
@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Running Programs</title><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="ajbrowser.html" title="Chapter 1. AspectJ Browser"><link rel="previous" href="ch01s03.html" title="Navigating Program Structure"><link rel="next" href="ajbrowser-problems.html" title="Isolating problems running the AspectJ browser"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Running Programs</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch01s03.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 1. AspectJ Browser</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ajbrowser-problems.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="d0e1073"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e1073"></a>Running Programs</h2></div></div><p>
+ <title>Running Programs</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="ajbrowser.html" title="Chapter 1. AspectJ Browser"><link rel="previous" href="ch01s03.html" title="Navigating Program Structure"><link rel="next" href="ajbrowser-problems.html" title="Isolating problems running the AspectJ browser"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Running Programs</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch01s03.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 1. AspectJ Browser</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ajbrowser-problems.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="d0e1073"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e1073"></a>Running Programs</h2></div></div><p>
The browser supports a limited form of running compiled programs.
To run programs that have been built, click the run button
or select one of the run menu items in the project menu.
diff --git a/org.aspectj.ajde/doc/devguide/dd_arrow.gif b/org.aspectj.ajde/doc/devguide/dd_arrow.gif
new file mode 100644
index 000000000..a16b34c95
--- /dev/null
+++ b/org.aspectj.ajde/doc/devguide/dd_arrow.gif
Binary files differ
diff --git a/org.aspectj.ajde/doc/devguide/index.html b/org.aspectj.ajde/doc/devguide/index.html
index b933175a4..01ebbc131 100755
--- a/org.aspectj.ajde/doc/devguide/index.html
+++ b/org.aspectj.ajde/doc/devguide/index.html
@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>The AspectJtm Development Environment Guide</title><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="next" href="rn01.html" title="Command-line tools"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The AspectJ<sup>tm</sup> Development Environment Guide</th></tr><tr><td width="20%" align="left">&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="rn01.html">Next</a></td></tr></table><hr></div><div class="book" id="d0e1"><div class="titlepage"><div><h1 class="title"><a name="d0e1"></a>The AspectJ<sup>tm</sup> Development Environment Guide</h1></div><div><h3 class="author">the AspectJ Team</h3></div><div><div class="legalnotice"><p>Copyright (c) 1998-2001 Xerox Corporation,
+ <title>The AspectJtm Development Environment Guide</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="next" href="rn01.html" title="Command-line tools"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The AspectJ<sup>tm</sup> Development Environment Guide</th></tr><tr><td width="20%" align="left">&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="rn01.html">Next</a></td></tr></table><hr></div><div class="book" id="d0e1"><div class="titlepage"><div><h1 class="title"><a name="d0e1"></a>The AspectJ<sup>tm</sup> Development Environment Guide</h1></div><div><h3 class="author">the AspectJ Team</h3></div><div><div class="legalnotice"><p>Copyright (c) 1998-2001 Xerox Corporation,
2002 Palo Alto Research Center, Incorporated,
2003-2005 Contributors.
All rights reserved.
@@ -17,5 +17,5 @@
<a href="http://eclipse.org/aspectj" target="_top">
http://eclipse.org/aspectj</a>.
- </p></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>I. <a href="rn01.html">Command-line tools</a></dt><dd><dl><dt><a href="ajc-ref.html">ajc</a> - compiler and bytecode weaver for the AspectJ and Java languages</dt><dt><a href="rn01re02.html">ajdoc</a> - generate HTML API documentation, including crosscutting structure (early-access)
- </dt></dl></dd><dt>1. <a href="ajbrowser.html">AspectJ Browser</a></dt><dd><dl><dt><a href="ajbrowser.html#ajbrowser-intro">Introduction</a></dt><dt><a href="ch01s02.html">Building Programs</a></dt><dd><dl><dt><a href="ch01s02.html#d0e875">Build Configurations</a></dt><dt><a href="ch01s02.html#d0e906">Compiling a Program Build Configuration</a></dt></dl></dd><dt><a href="ch01s03.html">Navigating Program Structure</a></dt><dd><dl><dt><a href="ch01s03.html#d0e941">Example: Exploring the "Spacewar" sample code </a></dt></dl></dd><dt><a href="ch01s04.html">Running Programs</a></dt><dt><a href="ajbrowser-problems.html">Isolating problems running the AspectJ browser</a></dt><dd><dl><dt><a href="ajbrowser-problems.html#ajbrowser-knownProblems">Known issues with the AspectJ browser</a></dt><dt><a href="ajbrowser-problems.html#ajbrowser-limitations">Limitations</a></dt><dt><a href="ajbrowser-problems.html#ajbrowser-feedback">AspectJ Browser questions and bugs</a></dt></dl></dd></dl></dd><dt>2. <a href="antTasks.html">AspectJ Ant Tasks</a></dt><dd><dl><dt><a href="antTasks.html#antTasks-intro">Introduction</a></dt><dt><a href="antTasks-install.html">Installing Ant Tasks</a></dt><dt><a href="antTasks-iajc.html">AjcTask (iajc)</a></dt><dd><dl><dt><a href="antTasks-iajc.html#antTasks-iajc-options">AjcTask (iajc) Options</a></dt><dt><a href="antTasks-iajc.html#antTasks-nested-includes">AjcTask matching parameters specified as nested elements</a></dt><dt><a href="antTasks-iajc.html#antTasks-iajc-paths">AjcTask Path-like Structures</a></dt><dt><a href="antTasks-iajc.html#antTasks-iajc-sample">Sample of iajc task</a></dt><dt><a href="antTasks-iajc.html#antTasks-iajc-uptodate">Avoiding clean compiles</a></dt><dt><a href="antTasks-iajc.html#d0e1921">Programmatically handling compiler messages</a></dt></dl></dd><dt><a href="antTasks-adapter.html">Ajc11CompilerAdapter (javac)</a></dt><dd><dl><dt><a href="antTasks-adapter.html#antTasks-adapter-sample">Sample of compiler adapter</a></dt><dt><a href="antTasks-adapter.html#antTasks-adapter-options">Compiler adapter compilerarg options</a></dt></dl></dd><dt><a href="antTasks-ajc.html">Ajc10 (ajc)</a></dt><dd><dl><dt><a href="antTasks-ajc.html#antTasks-ajc-options">Ajc10 (ajc) Options</a></dt><dt><a href="antTasks-ajc.html#antTasks-ajc-nested">Ajc10 parameters specified as nested elements</a></dt><dt><a href="antTasks-ajc.html#antTasks-ajc-sample">Sample of ajc task</a></dt></dl></dd><dt><a href="antTasks-problems.html">Isolating problems running the Ant tasks</a></dt><dd><dl><dt><a href="antTasks-problems.html#antTasks-knownProblems">Known issues with the Ant tasks</a></dt><dt><a href="antTasks-problems.html#antTasks-feedback">Ant task questions and bugs</a></dt></dl></dd></dl></dd></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left">&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="rn01.html">Next</a></td></tr><tr><td width="40%" align="left">&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;Command-line tools</td></tr></table></div></body></html> \ No newline at end of file
+ </p></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>I. <a href="rn01.html">Command-line tools</a></dt><dd><dl><dt><a href="ajc-ref.html">ajc</a> - compiler and bytecode weaver for the AspectJ and Java languages</dt><dt><a href="ajdoc-ref.html">ajdoc</a> - generate HTML API documentation, including crosscutting structure (early-access)
+ </dt></dl></dd><dt>1. <a href="ajbrowser.html">AspectJ Browser</a></dt><dd><dl><dt><a href="ajbrowser.html#ajbrowser-intro">Introduction</a></dt><dt><a href="ch01s02.html">Building Programs</a></dt><dd><dl><dt><a href="ch01s02.html#d0e875">Build Configurations</a></dt><dt><a href="ch01s02.html#d0e906">Compiling a Program Build Configuration</a></dt></dl></dd><dt><a href="ch01s03.html">Navigating Program Structure</a></dt><dd><dl><dt><a href="ch01s03.html#d0e941">Example: Exploring the "Spacewar" sample code </a></dt></dl></dd><dt><a href="ch01s04.html">Running Programs</a></dt><dt><a href="ajbrowser-problems.html">Isolating problems running the AspectJ browser</a></dt><dd><dl><dt><a href="ajbrowser-problems.html#ajbrowser-knownProblems">Known issues with the AspectJ browser</a></dt><dt><a href="ajbrowser-problems.html#ajbrowser-limitations">Limitations</a></dt><dt><a href="ajbrowser-problems.html#ajbrowser-feedback">AspectJ Browser questions and bugs</a></dt></dl></dd></dl></dd><dt>2. <a href="antTasks.html">AspectJ Ant Tasks</a></dt><dd><dl><dt><a href="antTasks.html#antTasks-intro">Introduction</a></dt><dt><a href="antTasks-install.html">Installing Ant Tasks</a></dt><dt><a href="antTasks-iajc.html">AjcTask (iajc)</a></dt><dd><dl><dt><a href="antTasks-iajc.html#antTasks-iajc-options">AjcTask (iajc) Options</a></dt><dt><a href="antTasks-iajc.html#antTasks-nested-includes">AjcTask matching parameters specified as nested elements</a></dt><dt><a href="antTasks-iajc.html#antTasks-iajc-paths">AjcTask Path-like Structures</a></dt><dt><a href="antTasks-iajc.html#antTasks-iajc-sample">Sample of iajc task</a></dt><dt><a href="antTasks-iajc.html#antTasks-iajc-uptodate">Avoiding clean compiles</a></dt><dt><a href="antTasks-iajc.html#d0e1937">Programmatically handling compiler messages</a></dt></dl></dd><dt><a href="antTasks-adapter.html">Ajc11CompilerAdapter (javac)</a></dt><dd><dl><dt><a href="antTasks-adapter.html#antTasks-adapter-sample">Sample of compiler adapter</a></dt><dt><a href="antTasks-adapter.html#antTasks-adapter-options">Compiler adapter compilerarg options</a></dt></dl></dd><dt><a href="antTasks-ajc.html">Ajc10 (ajc)</a></dt><dd><dl><dt><a href="antTasks-ajc.html#antTasks-ajc-options">Ajc10 (ajc) Options</a></dt><dt><a href="antTasks-ajc.html#antTasks-ajc-nested">Ajc10 parameters specified as nested elements</a></dt><dt><a href="antTasks-ajc.html#antTasks-ajc-sample">Sample of ajc task</a></dt></dl></dd><dt><a href="antTasks-problems.html">Isolating problems running the Ant tasks</a></dt><dd><dl><dt><a href="antTasks-problems.html#antTasks-knownProblems">Known issues with the Ant tasks</a></dt><dt><a href="antTasks-problems.html#antTasks-feedback">Ant task questions and bugs</a></dt></dl></dd></dl></dd></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left">&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="rn01.html">Next</a></td></tr><tr><td width="40%" align="left">&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;Command-line tools</td></tr></table></div></body></html> \ No newline at end of file
diff --git a/org.aspectj.ajde/doc/devguide/printable.html b/org.aspectj.ajde/doc/devguide/printable.html
index f7956ac92..3cd383dd6 100755
--- a/org.aspectj.ajde/doc/devguide/printable.html
+++ b/org.aspectj.ajde/doc/devguide/printable.html
@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>The AspectJtm Development Environment Guide</title><meta name="generator" content="DocBook XSL Stylesheets V1.44"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" id="d0e1"><div class="titlepage"><div><h1 class="title"><a name="d0e1"></a>The AspectJ<sup>tm</sup> Development Environment Guide</h1></div><div><h3 class="author">the AspectJ Team</h3></div><div><div class="legalnotice"><p>Copyright (c) 1998-2001 Xerox Corporation,
+ <title>The AspectJtm Development Environment Guide</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" id="d0e1"><div class="titlepage"><div><h1 class="title"><a name="d0e1"></a>The AspectJ<sup>tm</sup> Development Environment Guide</h1></div><div><h3 class="author">the AspectJ Team</h3></div><div><div class="legalnotice"><p>Copyright (c) 1998-2001 Xerox Corporation,
2002 Palo Alto Research Center, Incorporated,
2003-2005 Contributors.
All rights reserved.
@@ -17,8 +17,8 @@
<a href="http://eclipse.org/aspectj" target="_top">
http://eclipse.org/aspectj</a>.
- </p></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>I. <a href="#d0e26">Command-line tools</a></dt><dd><dl><dt><a href="#ajc-ref">ajc</a> - compiler and bytecode weaver for the AspectJ and Java languages</dt><dt><a href="#d0e629">ajdoc</a> - generate HTML API documentation, including crosscutting structure (early-access)
- </dt></dl></dd><dt>1. <a href="#ajbrowser">AspectJ Browser</a></dt><dd><dl><dt><a href="#ajbrowser-intro">Introduction</a></dt><dt><a href="#d0e872">Building Programs</a></dt><dd><dl><dt><a href="#d0e875">Build Configurations</a></dt><dt><a href="#d0e906">Compiling a Program Build Configuration</a></dt></dl></dd><dt><a href="#d0e932">Navigating Program Structure</a></dt><dd><dl><dt><a href="#d0e941">Example: Exploring the "Spacewar" sample code </a></dt></dl></dd><dt><a href="#d0e1073">Running Programs</a></dt><dt><a href="#ajbrowser-problems">Isolating problems running the AspectJ browser</a></dt><dd><dl><dt><a href="#ajbrowser-knownProblems">Known issues with the AspectJ browser</a></dt><dt><a href="#ajbrowser-limitations">Limitations</a></dt><dt><a href="#ajbrowser-feedback">AspectJ Browser questions and bugs</a></dt></dl></dd></dl></dd><dt>2. <a href="#antTasks">AspectJ Ant Tasks</a></dt><dd><dl><dt><a href="#antTasks-intro">Introduction</a></dt><dt><a href="#antTasks-install">Installing Ant Tasks</a></dt><dt><a href="#antTasks-iajc">AjcTask (iajc)</a></dt><dd><dl><dt><a href="#antTasks-iajc-options">AjcTask (iajc) Options</a></dt><dt><a href="#antTasks-nested-includes">AjcTask matching parameters specified as nested elements</a></dt><dt><a href="#antTasks-iajc-paths">AjcTask Path-like Structures</a></dt><dt><a href="#antTasks-iajc-sample">Sample of iajc task</a></dt><dt><a href="#antTasks-iajc-uptodate">Avoiding clean compiles</a></dt><dt><a href="#d0e1921">Programmatically handling compiler messages</a></dt></dl></dd><dt><a href="#antTasks-adapter">Ajc11CompilerAdapter (javac)</a></dt><dd><dl><dt><a href="#antTasks-adapter-sample">Sample of compiler adapter</a></dt><dt><a href="#antTasks-adapter-options">Compiler adapter compilerarg options</a></dt></dl></dd><dt><a href="#antTasks-ajc">Ajc10 (ajc)</a></dt><dd><dl><dt><a href="#antTasks-ajc-options">Ajc10 (ajc) Options</a></dt><dt><a href="#antTasks-ajc-nested">Ajc10 parameters specified as nested elements</a></dt><dt><a href="#antTasks-ajc-sample">Sample of ajc task</a></dt></dl></dd><dt><a href="#antTasks-problems">Isolating problems running the Ant tasks</a></dt><dd><dl><dt><a href="#antTasks-knownProblems">Known issues with the Ant tasks</a></dt><dt><a href="#antTasks-feedback">Ant task questions and bugs</a></dt></dl></dd></dl></dd></dl></div><div class="reference"><div class="titlepage"><div><h1 class="title"><a name="d0e26"></a>Command-line tools</h1></div><div><div class="abstract"><p><a name="d0e29"></a><b>Summary of command-line tools</b></p><p></p></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#ajc-ref">ajc</a> - compiler and bytecode weaver for the AspectJ and Java languages</dt><dt><a href="#d0e629">ajdoc</a> - generate HTML API documentation, including crosscutting structure (early-access)
+ </p></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>I. <a href="#d0e26">Command-line tools</a></dt><dd><dl><dt><a href="#ajc-ref">ajc</a> - compiler and bytecode weaver for the AspectJ and Java languages</dt><dt><a href="#ajdoc-ref">ajdoc</a> - generate HTML API documentation, including crosscutting structure (early-access)
+ </dt></dl></dd><dt>1. <a href="#ajbrowser">AspectJ Browser</a></dt><dd><dl><dt><a href="#ajbrowser-intro">Introduction</a></dt><dt><a href="#d0e872">Building Programs</a></dt><dd><dl><dt><a href="#d0e875">Build Configurations</a></dt><dt><a href="#d0e906">Compiling a Program Build Configuration</a></dt></dl></dd><dt><a href="#d0e932">Navigating Program Structure</a></dt><dd><dl><dt><a href="#d0e941">Example: Exploring the "Spacewar" sample code </a></dt></dl></dd><dt><a href="#d0e1073">Running Programs</a></dt><dt><a href="#ajbrowser-problems">Isolating problems running the AspectJ browser</a></dt><dd><dl><dt><a href="#ajbrowser-knownProblems">Known issues with the AspectJ browser</a></dt><dt><a href="#ajbrowser-limitations">Limitations</a></dt><dt><a href="#ajbrowser-feedback">AspectJ Browser questions and bugs</a></dt></dl></dd></dl></dd><dt>2. <a href="#antTasks">AspectJ Ant Tasks</a></dt><dd><dl><dt><a href="#antTasks-intro">Introduction</a></dt><dt><a href="#antTasks-install">Installing Ant Tasks</a></dt><dt><a href="#antTasks-iajc">AjcTask (iajc)</a></dt><dd><dl><dt><a href="#antTasks-iajc-options">AjcTask (iajc) Options</a></dt><dt><a href="#antTasks-nested-includes">AjcTask matching parameters specified as nested elements</a></dt><dt><a href="#antTasks-iajc-paths">AjcTask Path-like Structures</a></dt><dt><a href="#antTasks-iajc-sample">Sample of iajc task</a></dt><dt><a href="#antTasks-iajc-uptodate">Avoiding clean compiles</a></dt><dt><a href="#d0e1937">Programmatically handling compiler messages</a></dt></dl></dd><dt><a href="#antTasks-adapter">Ajc11CompilerAdapter (javac)</a></dt><dd><dl><dt><a href="#antTasks-adapter-sample">Sample of compiler adapter</a></dt><dt><a href="#antTasks-adapter-options">Compiler adapter compilerarg options</a></dt></dl></dd><dt><a href="#antTasks-ajc">Ajc10 (ajc)</a></dt><dd><dl><dt><a href="#antTasks-ajc-options">Ajc10 (ajc) Options</a></dt><dt><a href="#antTasks-ajc-nested">Ajc10 parameters specified as nested elements</a></dt><dt><a href="#antTasks-ajc-sample">Sample of ajc task</a></dt></dl></dd><dt><a href="#antTasks-problems">Isolating problems running the Ant tasks</a></dt><dd><dl><dt><a href="#antTasks-knownProblems">Known issues with the Ant tasks</a></dt><dt><a href="#antTasks-feedback">Ant task questions and bugs</a></dt></dl></dd></dl></dd></dl></div><div class="reference"><div class="titlepage"><div><h1 class="title"><a name="d0e26"></a>Command-line tools</h1></div><div><div class="abstract"><p><a name="d0e29"></a><b>Summary of command-line tools</b></p><p></p></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#ajc-ref">ajc</a> - compiler and bytecode weaver for the AspectJ and Java languages</dt><dt><a href="#ajdoc-ref">ajdoc</a> - generate HTML API documentation, including crosscutting structure (early-access)
</dt></dl></div><div class="refentry"><h1 class="title"><a name="ajc-ref"></a>ajc</h1><div class="refnamediv"><a name="d0e37"></a><h2>Name</h2>ajc &#8212; compiler and bytecode weaver for the AspectJ and Java languages</div><div class="refsynopsisdiv"><a name="d0e42"></a><h2>Synopsis</h2><div class="cmdsynopsis" id="d0e43"><a name="d0e43"></a><tt>ajc</tt> [<i><tt>Options</tt></i>] [<i><tt>file...</tt></i> | @<i><tt>file...</tt></i> | -argfile <i><tt>file...</tt></i>]</div></div><div class="refsect1"><a name="ajc"></a><h2>Description</h2><p>The <b>ajc</b> command compiles AspectJ and Java
language files, weaving aspects as necessary to produce .class files
compliant with any Java VM (1.1 or later).
@@ -360,7 +360,7 @@ File0;File1[Number1];File2[Number2] ... :LineNumber
</p><p>In a class file that comes from only a single source file, the AspectJ
compiler generates SourceFile attributes consistent with
traditional Java compilers.
- </p></div></div></div><div class="refentry"><h1 class="title"><a name="d0e629"></a>ajdoc</h1><div class="refnamediv"><a name="d0e630"></a><h2>Name</h2>ajdoc &#8212; generate HTML API documentation, including crosscutting structure (early-access)
+ </p></div></div></div><div class="refentry"><h1 class="title"><a name="ajdoc-ref"></a>ajdoc</h1><div class="refnamediv"><a name="d0e630"></a><h2>Name</h2>ajdoc &#8212; generate HTML API documentation, including crosscutting structure (early-access)
</div><div class="refsynopsisdiv"><a name="d0e635"></a><h2>Synopsis</h2><div class="cmdsynopsis" id="d0e636"><a name="d0e636"></a><tt>ajdoc</tt> [
-bootclasspath <i><tt>classpathlist</tt></i>
] [
@@ -678,7 +678,7 @@ File0;File1[Number1];File2[Number2] ... :LineNumber
<a href="http://bugs.eclipse.org/bugs" target="_top">
http://bugs.eclipse.org/bugs</a>
using the AspectJ product and IDE component.
- </p></div></div></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="antTasks"></a>Chapter 2. AspectJ Ant Tasks</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#antTasks-intro">Introduction</a></dt><dt><a href="#antTasks-install">Installing Ant Tasks</a></dt><dt><a href="#antTasks-iajc">AjcTask (iajc)</a></dt><dd><dl><dt><a href="#antTasks-iajc-options">AjcTask (iajc) Options</a></dt><dt><a href="#antTasks-nested-includes">AjcTask matching parameters specified as nested elements</a></dt><dt><a href="#antTasks-iajc-paths">AjcTask Path-like Structures</a></dt><dt><a href="#antTasks-iajc-sample">Sample of iajc task</a></dt><dt><a href="#antTasks-iajc-uptodate">Avoiding clean compiles</a></dt><dt><a href="#d0e1921">Programmatically handling compiler messages</a></dt></dl></dd><dt><a href="#antTasks-adapter">Ajc11CompilerAdapter (javac)</a></dt><dd><dl><dt><a href="#antTasks-adapter-sample">Sample of compiler adapter</a></dt><dt><a href="#antTasks-adapter-options">Compiler adapter compilerarg options</a></dt></dl></dd><dt><a href="#antTasks-ajc">Ajc10 (ajc)</a></dt><dd><dl><dt><a href="#antTasks-ajc-options">Ajc10 (ajc) Options</a></dt><dt><a href="#antTasks-ajc-nested">Ajc10 parameters specified as nested elements</a></dt><dt><a href="#antTasks-ajc-sample">Sample of ajc task</a></dt></dl></dd><dt><a href="#antTasks-problems">Isolating problems running the Ant tasks</a></dt><dd><dl><dt><a href="#antTasks-knownProblems">Known issues with the Ant tasks</a></dt><dt><a href="#antTasks-feedback">Ant task questions and bugs</a></dt></dl></dd></dl></div><div class="sect1"><a name="antTasks-intro"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="antTasks-intro"></a>Introduction</h2></div></div><p>
+ </p></div></div></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="antTasks"></a>Chapter 2. AspectJ Ant Tasks</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#antTasks-intro">Introduction</a></dt><dt><a href="#antTasks-install">Installing Ant Tasks</a></dt><dt><a href="#antTasks-iajc">AjcTask (iajc)</a></dt><dd><dl><dt><a href="#antTasks-iajc-options">AjcTask (iajc) Options</a></dt><dt><a href="#antTasks-nested-includes">AjcTask matching parameters specified as nested elements</a></dt><dt><a href="#antTasks-iajc-paths">AjcTask Path-like Structures</a></dt><dt><a href="#antTasks-iajc-sample">Sample of iajc task</a></dt><dt><a href="#antTasks-iajc-uptodate">Avoiding clean compiles</a></dt><dt><a href="#d0e1937">Programmatically handling compiler messages</a></dt></dl></dd><dt><a href="#antTasks-adapter">Ajc11CompilerAdapter (javac)</a></dt><dd><dl><dt><a href="#antTasks-adapter-sample">Sample of compiler adapter</a></dt><dt><a href="#antTasks-adapter-options">Compiler adapter compilerarg options</a></dt></dl></dd><dt><a href="#antTasks-ajc">Ajc10 (ajc)</a></dt><dd><dl><dt><a href="#antTasks-ajc-options">Ajc10 (ajc) Options</a></dt><dt><a href="#antTasks-ajc-nested">Ajc10 parameters specified as nested elements</a></dt><dt><a href="#antTasks-ajc-sample">Sample of ajc task</a></dt></dl></dd><dt><a href="#antTasks-problems">Isolating problems running the Ant tasks</a></dt><dd><dl><dt><a href="#antTasks-knownProblems">Known issues with the Ant tasks</a></dt><dt><a href="#antTasks-feedback">Ant task questions and bugs</a></dt></dl></dd></dl></div><div class="sect1"><a name="antTasks-intro"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="antTasks-intro"></a>Introduction</h2></div></div><p>
AspectJ contains a compiler, <tt>ajc</tt>,
that can be run from Ant.
Included in the <tt>aspectjtools.jar</tt>
@@ -710,11 +710,11 @@ File0;File1[Number1];File2[Number2] ... :LineNumber
Sources are available under the Common Public License v. 1.0
at <a href="http://eclipse.org/aspectj" target="_top">http://eclipse.org/aspectj</a>.
</p><p>
- In Ant, third-party tasks can be declared using a taskdef entry in
+ In Ant 1.5, third-party tasks can be declared using a taskdef entry in
the build script, to identify the name and classes.
When declaring a task, include the
<tt>aspectjtools.jar</tt> either in the
- taskdef classpath or in ${ANT_HOME}/lib where it will be added
+ taskdef classpath or in <tt>${ANT_HOME}/lib</tt> where it will be added
to the system class path by the ant script.
You may specify the task script names directly,
or use the "resource" attribute to specify the default names:
@@ -727,6 +727,27 @@ File0;File1[Number1];File2[Number2] ... :LineNumber
The current resource file retains the name "ajc" for the Ajc10 task,
and uses "iajc" for the AspectJ post-1.1 task.
</p><p>
+ In Ant 1.6, third-party tasks are declared in their own namespace
+ using <tt>antlib.xml</tt>. For example, the following
+ script would build and run the spacewar example, if you put the
+ script in the examples directory and <tt>aspectjtools.jar</tt>
+ in the <tt>${ANT_HOME}/lib</tt> directory.
+ </p><pre class="programlisting">
+
+&lt;project name="aspectj-ant1.6" default="spacewar"
+ xmlns:aspectj="antlib:org.aspectj" basedir="."&gt;
+ &lt;target name="spacewar"&gt;
+ &lt;aspectj:iajc
+ argfiles="spacewar/debug.lst"
+ outjar="spacewar.jar"
+ classpath="../../lib/aspectjrt.jar"
+ /&gt;
+ &lt;java classname="spacewar.Game"
+ classpath="spacewar.jar:../../lib/aspectjrt.jar"/&gt;
+ &lt;/target&gt;
+&lt;/project&gt;
+
+ </pre><p>
For more information on using Ant, please refer to Jakarta's
documentation on integrating user-defined Ant tasks into builds.
</p></div><div class="sect1"><a name="antTasks-iajc"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="antTasks-iajc"></a>AjcTask (iajc)</h2></div></div><p>
@@ -776,7 +797,7 @@ File0;File1[Number1];File2[Number2] ... :LineNumber
<span class="strong"><i>
AjcTask (iajc) options for specifying sources
</i></span>
- </p><div class="informaltable" id="d0e1268"><a name="d0e1268"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>argfiles, argfilesRef
+ </p><div class="informaltable" id="d0e1284"><a name="d0e1284"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>argfiles, argfilesRef
(<a href="#antTasks-iajc-paths">Path</a>)
</p></td><td><p>
An argument file contains a list of arguments read by the compiler.
@@ -834,7 +855,7 @@ File0;File1[Number1];File2[Number2] ... :LineNumber
<span class="strong"><i>
AjcTask (iajc) options for specifying output
</i></span>
- </p><div class="informaltable" id="d0e1371"><a name="d0e1371"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>destDir
+ </p><div class="informaltable" id="d0e1387"><a name="d0e1387"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>destDir
</p></td><td><p>
The directory in which to place the generated class files.
Only one of <tt>destDir</tt> and
@@ -879,7 +900,7 @@ File0;File1[Number1];File2[Number2] ... :LineNumber
<span class="strong"><i>
AjcTask (iajc) options for specifying compiler behavior
</i></span>
- </p><div class="informaltable" id="d0e1459"><a name="d0e1459"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>fork
+ </p><div class="informaltable" id="d0e1475"><a name="d0e1475"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>fork
</p></td><td><p>
Run process in another VM.
This gets the forking classpath either explicitly
@@ -928,7 +949,7 @@ File0;File1[Number1];File2[Number2] ... :LineNumber
<span class="strong"><i>
AjcTask (iajc) options for specifying compiler side-effects and messages
</i></span>
- </p><div class="informaltable" id="d0e1548"><a name="d0e1548"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>emacssym
+ </p><div class="informaltable" id="d0e1564"><a name="d0e1564"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>emacssym
</p></td><td><p>
If true, emit <tt>.ajesym</tt> symbol files for Emacs support.
</p></td></tr><tr><td><p>verbose
@@ -980,7 +1001,7 @@ File0;File1[Number1];File2[Number2] ... :LineNumber
<span class="strong"><i>
AjcTask (iajc) options for specifying Eclipse compiler options
</i></span>
- </p><div class="informaltable" id="d0e1663"><a name="d0e1663"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>nowarn
+ </p><div class="informaltable" id="d0e1679"><a name="d0e1679"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>nowarn
</p></td><td><p>
If true, same as <tt>warn:none</tt>.
</p></td></tr><tr><td><p>deprecation
@@ -1118,12 +1139,12 @@ File0;File1[Number1];File2[Number2] ... :LineNumber
</pre><p>
Below is script with most everything in it. The compile process...
- </p><div class="orderedlist"><ol type="1"><li><p><a name="d0e1884"></a>Runs in incremental mode, recompiling when the user hits return;
- </p></li><li><p><a name="d0e1887"></a>Reads all the source files from two directories;
- </p></li><li><p><a name="d0e1890"></a>Reads binary .class files from input jar and directory;
- </p></li><li><p><a name="d0e1893"></a>Uses a binary aspect library for persistence;
- </p></li><li><p><a name="d0e1896"></a>Outputs to an application jar; and
- </p></li><li><p><a name="d0e1899"></a>Copies resources from the source directories and binary input
+ </p><div class="orderedlist"><ol type="1"><li><p><a name="d0e1900"></a>Runs in incremental mode, recompiling when the user hits return;
+ </p></li><li><p><a name="d0e1903"></a>Reads all the source files from two directories;
+ </p></li><li><p><a name="d0e1906"></a>Reads binary .class files from input jar and directory;
+ </p></li><li><p><a name="d0e1909"></a>Uses a binary aspect library for persistence;
+ </p></li><li><p><a name="d0e1912"></a>Outputs to an application jar; and
+ </p></li><li><p><a name="d0e1915"></a>Copies resources from the source directories and binary input
jar and directories to the application jar. </p></li></ol></div><p>
When this target is built, the compiler will build once and then
wait for input from the user.
@@ -1189,7 +1210,7 @@ File0;File1[Number1];File2[Number2] ... :LineNumber
When using this technique, be careful to verify that binary
input jars are themselves up-to-date after they would have been
modified by any build commands.
- </p></div><div class="sect2"><a name="d0e1921"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1921"></a>Programmatically handling compiler messages</h3></div></div><p>
+ </p></div><div class="sect2"><a name="d0e1937"></a><div class="titlepage"><div><h3 class="title"><a name="d0e1937"></a>Programmatically handling compiler messages</h3></div></div><p>
Users may specify a message holder to which the compiler will pass
all messages as they are generated. This will override all of the
normal message printing, but does not prevent the task from failing
@@ -1257,44 +1278,44 @@ File0;File1[Number1];File2[Number2] ... :LineNumber
The adapter supports any ajc command-line option passed using compilerarg,
as well as the following options available only in AjcTask.
Find more details on the following options in <a href="#antTasks-iajc">AjcTask (iajc)</a>.
- </p><div class="itemizedlist"><ul><li><p><a name="d0e1976"></a>
+ </p><div class="itemizedlist"><ul><li><p><a name="d0e1992"></a>
<tt>-Xmaxmem</tt>:
set maximum memory for forking (also settable in javac).
- </p></li><li><p><a name="d0e1982"></a>
+ </p></li><li><p><a name="d0e1998"></a>
<tt>-Xlistfileargs</tt>:
list file arguments (also settable in javac).
- </p></li><li><p><a name="d0e1988"></a>
+ </p></li><li><p><a name="d0e2004"></a>
<tt>-Xfailonerror</tt>:
throw BuildException on compiler error (also settable in javac).
- </p></li><li><p><a name="d0e1994"></a>
+ </p></li><li><p><a name="d0e2010"></a>
<tt>-Xmessageholderclass</tt>:
specify fully-qualified name of class to use as the message holder.
- </p></li><li><p><a name="d0e2000"></a>
+ </p></li><li><p><a name="d0e2016"></a>
<tt>-Xcopyinjars</tt>:
copy resources from any input jars to output
(default behavior since 1.1.1)
- </p></li><li><p><a name="d0e2006"></a>
+ </p></li><li><p><a name="d0e2022"></a>
<tt>-Xsourcerootcopyfilter {filter}</tt>:
copy resources from source directories to output (minus files specified in filter)
- </p></li><li><p><a name="d0e2012"></a>
+ </p></li><li><p><a name="d0e2028"></a>
<tt>-Xtagfile {file}</tt>:
use file to control incremental compilation
- </p></li><li><p><a name="d0e2018"></a>
+ </p></li><li><p><a name="d0e2034"></a>
<tt>-Xsrcdir {dir}</tt>:
add to list of ajc source roots (all source files will be included).
</p></li></ul></div><p>
Special considerations when using Javac and compilerarg:
- </p><div class="itemizedlist"><ul><li><p><a name="d0e2027"></a>
+ </p><div class="itemizedlist"><ul><li><p><a name="d0e2043"></a>
The names above may differ slightly from what you might expect
from AjcTask; use these forms when specifying compilerarg.
- </p></li></ul></div><div class="itemizedlist"><ul><li><p><a name="d0e2031"></a>
+ </p></li></ul></div><div class="itemizedlist"><ul><li><p><a name="d0e2047"></a>
By default the adapter will mimic the Javac task's copying of resource
files by specifying
<tt>"**/CVS/*,**/*.java,**/*.aj"</tt>
for the sourceroot copy filter.
To change this behavior, supply your own value
(e.g., <tt>"**/*"</tt> to copy nothing).
- </p></li></ul></div><div class="itemizedlist"><ul><li><p><a name="d0e2041"></a>
+ </p></li></ul></div><div class="itemizedlist"><ul><li><p><a name="d0e2057"></a>
Warning - define the system property
<tt>build.compiler.clean</tt> to compile all files,
when available.
@@ -1317,20 +1338,20 @@ File0;File1[Number1];File2[Number2] ... :LineNumber
</pre><p>
Caveats to consider when using this global
<tt>build.compiler.clean</tt> property:
- </p><div class="orderedlist"><ol type="1"><li><p><a name="d0e2060"></a>
+ </p><div class="orderedlist"><ol type="1"><li><p><a name="d0e2076"></a>
If javac believes there are no out-of-date source files,
then the adapter is never called and cannot clean up,
and the "compile" will appear to complete successfully
though it did nothing.
- </p></li><li><p><a name="d0e2063"></a>
+ </p></li><li><p><a name="d0e2079"></a>
Cleaning will makes stepwise build processes fail if
they depend on the results of the prior compilation being
in the same directory, since cleaning deletes all .class files.
- </p></li><li><p><a name="d0e2066"></a>
+ </p></li><li><p><a name="d0e2082"></a>
This clean process only permits one compile process at a
time for each destination directory because it tracks
recursion by writing a tag file to the destination directory.
- </p></li><li><p><a name="d0e2069"></a>
+ </p></li><li><p><a name="d0e2085"></a>
When running incrementally, the clean happens only before
the initial compile.
</p></li></ol></div></li></ul></div></div></div><div class="sect1"><a name="antTasks-ajc"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="antTasks-ajc"></a>Ajc10 (ajc)</h2></div></div><p>
@@ -1354,7 +1375,7 @@ File0;File1[Number1];File2[Number2] ... :LineNumber
<tt>srcdir</tt> (with patterns)).
</p><p>Boolean parameters default to <tt>false</tt>
unless otherwise stated.
- </p><div class="table"><p><a name="d0e2103"></a><b>Table 2.1. AjcTask (ajc) options for specifying sources</b></p><table summary="AjcTask (ajc) options for specifying sources" border="1"><colgroup><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>srcdir
+ </p><div class="table"><p><a name="d0e2119"></a><b>Table 2.1. AjcTask (ajc) options for specifying sources</b></p><table summary="AjcTask (ajc) options for specifying sources" border="1"><colgroup><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>srcdir
</p></td><td><p>
The base directory of the java files.
See
@@ -1414,7 +1435,7 @@ File0;File1[Number1];File2[Number2] ... :LineNumber
</p></td></tr><tr><td><p>source
</p></td><td><p>
Value of -source option - ignored unless <tt>1.4</tt>.
- </p></td></tr></tbody></table></div><div class="table"><p><a name="d0e2235"></a><b>Table 2.2. Parameters ignored by the old ajc taskdef,
+ </p></td></tr></tbody></table></div><div class="table"><p><a name="d0e2251"></a><b>Table 2.2. Parameters ignored by the old ajc taskdef,
but now supported or buggy</b></p><table summary="Parameters ignored by the old ajc taskdef, &#xA; but now supported or buggy" border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Supported?</th></tr></thead><tbody><tr><td><p>encoding
</p></td><td><p>Default encoding of source files.
</p></td><td><p>yes
@@ -1445,7 +1466,7 @@ File0;File1[Number1];File2[Number2] ... :LineNumber
</p></td></tr></tbody></table></div><p>
The following table shows that many of the unique parameters in
AspectJ 1.0 are no longer supported.
- </p><div class="table"><p><a name="d0e2323"></a><b>Table 2.3. Parameters unique to ajc</b></p><table summary="Parameters unique to ajc" border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>X
+ </p><div class="table"><p><a name="d0e2339"></a><b>Table 2.3. Parameters unique to ajc</b></p><table summary="Parameters unique to ajc" border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><p>X
</p></td><td><p>
comma-delimited list of extended (-X...) options,
entered without -X (e.g.,
@@ -1457,7 +1478,7 @@ File0;File1[Number1];File2[Number2] ... :LineNumber
</p></td><td><p>
A comma-delimited list of argfiles that contain a line-delimited
list of source file paths (absolute or relative to the argfile).
- </p></td></tr></tbody></table></div><div class="sect3"><a name="d0e2358"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2358"></a>argfiles - argument list files</h4></div></div><p>
+ </p></td></tr></tbody></table></div><div class="sect3"><a name="d0e2374"></a><div class="titlepage"><div><h4 class="title"><a name="d0e2374"></a>argfiles - argument list files</h4></div></div><p>
An argument file is a file (usually <tt>{file}.lst</tt>)
containing a list of source file paths
(absolute or relative to the argfile).
@@ -1554,15 +1575,15 @@ File0;File1[Number1];File2[Number2] ... :LineNumber
If you have problems with the tasks not solved by the documentation,
please try to see if you have the same problems when running ajc
directly on the command line.
- </p><div class="itemizedlist"><ul><li><p><a name="d0e2460"></a>
+ </p><div class="itemizedlist"><ul><li><p><a name="d0e2476"></a>
If the problem occurs on the command line also, then the problem
is not in the task.
(It may be in the tools; please send bug reports.)
- </p></li><li><p><a name="d0e2463"></a>
+ </p></li><li><p><a name="d0e2479"></a>
If the problem does not occur on the command line, then it may
lie in the parameters you are supplying in Ant or in the task's
handling of them.
- </p></li><li><p><a name="d0e2466"></a>
+ </p></li><li><p><a name="d0e2482"></a>
If the build script looks correct and the problem only occurs when
building from Ant, then please send a report
(including your build file, if possible).
diff --git a/org.aspectj.ajde/doc/devguide/rn01.html b/org.aspectj.ajde/doc/devguide/rn01.html
index 46a245537..d7b682a37 100755
--- a/org.aspectj.ajde/doc/devguide/rn01.html
+++ b/org.aspectj.ajde/doc/devguide/rn01.html
@@ -1,4 +1,4 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Command-line tools</title><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="previous" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="next" href="ajc-ref.html" title="ajc"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Command-line tools</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="index.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ajc-ref.html">Next</a></td></tr></table><hr></div><div class="reference"><div class="titlepage"><div><h1 class="title"><a name="d0e26"></a>Command-line tools</h1></div><div><div class="abstract"><p><a name="d0e29"></a><b>Summary of command-line tools</b></p><p></p></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="ajc-ref.html">ajc</a> - compiler and bytecode weaver for the AspectJ and Java languages</dt><dt><a href="rn01re02.html">ajdoc</a> - generate HTML API documentation, including crosscutting structure (early-access)
+ <title>Command-line tools</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="previous" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="next" href="ajc-ref.html" title="ajc"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Command-line tools</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="index.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ajc-ref.html">Next</a></td></tr></table><hr></div><div class="reference"><div class="titlepage"><div><h1 class="title"><a name="d0e26"></a>Command-line tools</h1></div><div><div class="abstract"><p><a name="d0e29"></a><b>Summary of command-line tools</b></p><p></p></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="ajc-ref.html">ajc</a> - compiler and bytecode weaver for the AspectJ and Java languages</dt><dt><a href="ajdoc-ref.html">ajdoc</a> - generate HTML API documentation, including crosscutting structure (early-access)
</dt></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="index.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ajc-ref.html">Next</a></td></tr><tr><td width="40%" align="left">The AspectJ<sup>tm</sup> Development Environment Guide&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right">&nbsp;ajc</td></tr></table></div></body></html> \ No newline at end of file
diff --git a/org.aspectj.ajde/doc/faq.html b/org.aspectj.ajde/doc/faq.html
index 21315e2c7..4254461eb 100755
--- a/org.aspectj.ajde/doc/faq.html
+++ b/org.aspectj.ajde/doc/faq.html
@@ -1,9 +1,9 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Frequently Asked Questions about AspectJ</title><meta name="generator" content="DocBook XSL Stylesheets V1.44"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="article"><div class="titlepage"><div><h2 class="title"><a name="d0e3"></a>Frequently Asked Questions about AspectJ</h2></div><hr></div><p>Copyright (c) 1997-2001 Xerox Corporation,
+ <title>Frequently Asked Questions about AspectJ</title><link rel="stylesheet" href="aspectj-faq.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="article"><div class="titlepage"><div><h2 class="title"><a name="d0e3"></a>Frequently Asked Questions about AspectJ</h2></div><hr></div><p>Copyright (c) 1997-2001 Xerox Corporation,
2002 Palo Alto Research Center, Incorporated,
2003-2005 Contributors. All rights reserved.
- </p><p>Last updated March 13, 2005
+ </p><p>Last updated June 16, 2005
</p><p>
For a list of recently-updated FAQ entries, see <a href="#q:faqchanges">Q:What has changed since the last FAQ version?</a>
</p><div class="qandaset"><dl><dt>1 <a href="#overview">Overview</a></dt><dd><dl><dt>1. <a href="#q:whatisaj">What is AspectJ?</a></dt><dt>2. <a href="#q:benefits">What are the benefits of using AspectJ?</a></dt><dt>3. <a href="#q:compability">Can AspectJ work with any Java program?</a></dt><dt>4. <a href="#q:license">How is AspectJ licensed?</a></dt><dt>5. <a href="#q:project">What is the AspectJ Project?</a></dt></dl></dd><dt>2 <a href="#quickstart">Quick Start</a></dt><dd><dl><dt>1. <a href="#q:requirements">
@@ -154,7 +154,11 @@
</a></dt><dt>20. <a href="#q:injection">I've heard AspectJ can generate or inject code into my code.
Is this true?
</a></dt><dt>21. <a href="#q:newjoinpoints">Why can't AspectJ pick out local variables (or array elements or ...)?
- </a></dt><dt>22. <a href="#q:currentbugs">What are the bugs now most affecting users?</a></dt></dl></dd><dt>12 <a href="#aj11">AspectJ 1.1 and eclipse.org</a></dt><dd><dl><dt>1. <a href="#q:whyeclipse">Why did the AspectJ project move to eclipse.org?
+ </a></dt><dt>22. <a href="#q:reflectiveCalls">Why doesn't AspectJ pick out reflective calls?
+ The pointcut call(void run())
+ won't pick out a call using reflection, like
+ ((Method)run).invoke(null, args).
+ </a></dt><dt>23. <a href="#q:currentbugs">What are the bugs now most affecting users?</a></dt></dl></dd><dt>12 <a href="#aj11">AspectJ 1.1 and eclipse.org</a></dt><dd><dl><dt>1. <a href="#q:whyeclipse">Why did the AspectJ project move to eclipse.org?
</a></dt><dt>2. <a href="#q:eclipserequired">Do I have to download Eclipse to use AspectJ?
</a></dt><dt>3. <a href="#q:eclipseetc">What are the relationships between AspectJ, JDT,
Eclipse, AJDT, and IDE support generally?
@@ -168,6 +172,7 @@
</a></dt><dt>4. <a href="#q:devDocs">Where do I find developer documentation on building and testing AspectJ source code?
</a></dt><dt>5. <a href="#q:harnesstestcases">How should I submit test cases for bugs?
</a></dt><dt>6. <a href="#q:testharness">I'd like to run my test case. How do I get the test harness?
+ </a></dt><dt>7. <a href="#q:bcel">BCEL is used by AspectJ but it's not actively developed. Will you change?
</a></dt></dl></dd><dt>15 <a href="#help">Getting Help</a></dt><dd><dl><dt>1. <a href="#q:moreaboutaj">
How do I find out more about AspectJ?
</a></dt><dt>2. <a href="#q:bugreports">How do I submit a bug report?</a></dt><dt>3. <a href="#q:talktousers">
@@ -2383,14 +2388,36 @@ vmparam -Xmx384m
so a new join point would have to be useful, sensible, and implementable.
The most promising of the new join points proposed are for exception
throws clauses and for synchronized blocks.
- </p></div></div><div class="qandaentry"><div class="question"><p><a name="q:currentbugs"></a><b>22. </b>What are the bugs now most affecting users?</p></div><div class="answer"><p><a name="d0e2194"></a><b></b><li><p><a name="d0e2196"></a>The bugs affecting the semantics of the language
- are marked with the "info" keyword. Find them with
- the query
- <a href="http://bugs.eclipse.org/bugs/buglist.cgi?product=AspectJ&amp;keywords=info" target="_top">
- http://bugs.eclipse.org/bugs/buglist.cgi?product=AspectJ&amp;keywords=info
- </a>
- </p></li></p></div></div></div><div class="qandadiv"><h3 class="title"><a name="aj11"></a>12 AspectJ 1.1 and eclipse.org</h3><div class="qandaentry"><div class="question"><p><a name="q:whyeclipse"></a><b>1. </b>Why did the AspectJ project move to eclipse.org?
- </p></div><div class="answer"><p><a name="d0e2209"></a><b></b>From the message sent to users:
+ </p></div></div><div class="qandaentry"><div class="question"><p><a name="q:reflectiveCalls"></a><b>22. </b>Why doesn't AspectJ pick out reflective calls?
+ The pointcut <tt>call(void run())</tt>
+ won't pick out a call using reflection, like
+ <tt>((Method)run).invoke(null, args)</tt>.
+ </p></div><div class="answer"><p><a name="d0e2200"></a><b></b>The pointcut
+ <tt>execution(void run())</tt> will
+ work. The call pointcut doesn't work because
+ <tt>Method.invoke(..)</tt> is the Java method-call,
+ and AspectJ cannot delve into the Java reflection library to
+ implement call semantics. To advise a reflective call
+ (e.g., because the compiler does not control the code for the
+ method execution), test the context for <tt>invoke(..)</tt>.
+ Here's a pointcut that tests only if the method name is
+ correct:
+ </p><pre class="programlisting">
+aspect A {
+ pointcut runReflectiveCall(Method run) : target(run) &amp;&amp;
+ call(Object Method.invoke(..)) &amp;&amp; if("run".equals(run.getName()));
+ before() : runReflectiveCall(Method) {
+ System.out.println("before reflective call " + thisJoinPoint);
+ }
+}
+ </pre></div></div><div class="qandaentry"><div class="question"><p><a name="q:currentbugs"></a><b>23. </b>What are the bugs now most affecting users?</p></div><div class="answer"><p><a name="d0e2218"></a><b></b>The bugs affecting the semantics of the language
+ are marked with the "info" keyword. Find them with
+ the query
+ <a href="http://bugs.eclipse.org/bugs/buglist.cgi?product=AspectJ&amp;keywords=info" target="_top">
+ http://bugs.eclipse.org/bugs/buglist.cgi?product=AspectJ&amp;keywords=info
+ </a>
+ </p></div></div></div><div class="qandadiv"><h3 class="title"><a name="aj11"></a>12 AspectJ 1.1 and eclipse.org</h3><div class="qandaentry"><div class="question"><p><a name="q:whyeclipse"></a><b>1. </b>Why did the AspectJ project move to eclipse.org?
+ </p></div><div class="answer"><p><a name="d0e2231"></a><b></b>From the message sent to users:
</p><p>
AspectJ has come a long way -- the language has
stabilized; there are a rapidly growing number of
@@ -2426,13 +2453,13 @@ vmparam -Xmx384m
in the Java space. Once development moves to
Eclipse.org, others will be able to contribute more easily.
</p></div></div><div class="qandaentry"><div class="question"><p><a name="q:eclipserequired"></a><b>2. </b>Do I have to download Eclipse to use AspectJ?
- </p></div><div class="answer"><p><a name="d0e2224"></a><b></b>No. The AspectJ tools download is completely self-contained
+ </p></div><div class="answer"><p><a name="d0e2246"></a><b></b>No. The AspectJ tools download is completely self-contained
and does not require that you work in Eclipse.
For information on IDE support, see
<a href="#q:integrateWithDevTools">Q: How well does AspectJ integrate with existing Java development tools?</a>.
</p></div></div><div class="qandaentry"><div class="question"><p><a name="q:eclipseetc"></a><b>3. </b>What are the relationships between AspectJ, JDT,
Eclipse, AJDT, and IDE support generally?
- </p></div><div class="answer"><p><a name="d0e2233"></a><b></b>Eclipse is a software platform.
+ </p></div><div class="answer"><p><a name="d0e2255"></a><b></b>Eclipse is a software platform.
</p><p>JDT is an eclipse project to support Java development.
JDT has a Java compiler.
</p><p>AspectJ 1.1 is built on Eclipse/JDT's Java compiler
@@ -2461,7 +2488,7 @@ vmparam -Xmx384m
doing IDE integrations in Eclipse, Emacs, JBuilder, and NetBeans
through a common API, AJDE.
</p></div></div></div><div class="qandadiv"><h3 class="title"><a name="Technology"></a>13 Understanding AspectJ Technology</h3><div class="qandaentry"><div class="question"><p><a name="q:implementation"></a><b>1. </b>Do I need to know how the compiler or weaver works?
- </p></div><div class="answer"><p><a name="d0e2262"></a><b></b>Writing AspectJ programs only requires understanding the
+ </p></div><div class="answer"><p><a name="d0e2284"></a><b></b>Writing AspectJ programs only requires understanding the
<a href="progguide/index.html" target="_top">Programming Guide</a>.
However, current implementations do not control everything in
a system, so AspectJ program semantics may be limited to code
@@ -2487,7 +2514,7 @@ vmparam -Xmx384m
For more information, see
<a href="#Developers">AspectJ Project Development</a>.
</p></div></div><div class="qandaentry"><div class="question"><p><a name="q:whitepapers"></a><b>2. </b>How does the compiler/weaver work? Are there any white papers?
- </p></div><div class="answer"><p><a name="d0e2279"></a><b></b>
+ </p></div><div class="answer"><p><a name="d0e2301"></a><b></b>
There are currently no documents describing this process in detail.
You can compile programs and inspect the generated source or bytecode,
or view the source code (see <a href="#Developers">AspectJ Project Development</a>).
@@ -2509,7 +2536,7 @@ vmparam -Xmx384m
</p><p>
Each .class file is woven independently.
A .class file is woven by the following steps:
- <div class="itemizedlist"><ul><li><p><a name="d0e2295"></a>
+ <div class="itemizedlist"><ul><li><p><a name="d0e2317"></a>
Collect all of the joinpoint shadows in the .class file.
For every dynamic joinpoint in the AspectJ language model,
there is a corresponding static shadow of that joinpoint
@@ -2518,16 +2545,16 @@ vmparam -Xmx384m
bytecode as its static shadow. Some joinpoints
(such as initialization) have much more
complicated static shadows.
- </p></li><li><p><a name="d0e2298"></a>
+ </p></li><li><p><a name="d0e2320"></a>
Each piece of advice is matched to each static shadow.
There are three results possible from this match.
- <div class="itemizedlist"><ul><li><p><a name="d0e2302"></a>
+ <div class="itemizedlist"><ul><li><p><a name="d0e2324"></a>
Never matches,
in which case nothing is done to the shadow
- </p></li><li><p><a name="d0e2305"></a>
+ </p></li><li><p><a name="d0e2327"></a>
Always matches,
in which case the advice is woven into this joinpoint shadow
- </p></li><li><p><a name="d0e2308"></a>
+ </p></li><li><p><a name="d0e2330"></a>
Sometimes matches,
in which case the advice is woven into the shadow
along with the minimal dynamic tests to determine
@@ -2536,7 +2563,7 @@ vmparam -Xmx384m
The simplest example of sometimes matches is
when the pointcut uses if(test()).
</p></li></ul></div>
- </p></li><li><p><a name="d0e2312"></a>
+ </p></li><li><p><a name="d0e2334"></a>
If any advice matched any static shadows in the .class file,
then the transformed .class file is written out,
otherwise it is left unchanged.
@@ -2552,12 +2579,12 @@ vmparam -Xmx384m
It also ignores performance optimizations such as fast-match
that speed up the weaving process.
</p></div></div><div class="qandaentry"><div class="question"><p><a name="q:reflection"></a><b>3. </b>Does AspectJ use reflection at runtime?
- </p></div><div class="answer"><p><a name="d0e2331"></a><b></b>
+ </p></div><div class="answer"><p><a name="d0e2353"></a><b></b>
The only time that reflection is used during run-time is when the special
thisJoinPoint object is used to discover reflective information about the
join point. If you don't use thisJoinPoint then no reflection will be used.
</p></div></div><div class="qandaentry"><div class="question"><p><a name="q:loadtimeWeaving"></a><b>4. </b>What about load-time weaving? Can I weave aspects at runtime?
- </p></div><div class="answer"><p><a name="d0e2338"></a><b></b>
+ </p></div><div class="answer"><p><a name="d0e2360"></a><b></b>
AspectJ 1.1 can weave binary aspects
into classes in bytecode form. Hooked up to a class loader,
this can weave class bytecodes after they are read in,
@@ -2580,7 +2607,7 @@ vmparam -Xmx384m
to modify .class files protected by license,
without permission from the licensor.
</p></div></div></div><div class="qandadiv"><h3 class="title"><a name="Developers"></a>14 AspectJ Project Development</h3><div class="qandaentry"><div class="question"><p><a name="q:howitworks"></a><b>1. </b>I'm interested in the code implementing AspectJ.
- </p></div><div class="answer"><p><a name="d0e2352"></a><b></b>Most people do not need to see the code for AspectJ;
+ </p></div><div class="answer"><p><a name="d0e2374"></a><b></b>Most people do not need to see the code for AspectJ;
they can download the binary distribution for documentation
and tools for writing AspectJ programs.
</p><p>For people who want to know how the AspectJ technology works,
@@ -2595,9 +2622,9 @@ vmparam -Xmx384m
might be an initial version of a new architecture (e.g., bytecode
weaving).
</p></div></div><div class="qandaentry"><div class="question"><p><a name="q:contributions"></a><b>2. </b>How can I get involved with developing the AspectJ project?
- </p></div><div class="answer"><p><a name="d0e2367"></a><b></b>For those who want to contribute to the project,
+ </p></div><div class="answer"><p><a name="d0e2389"></a><b></b>For those who want to contribute to the project,
here's a general list of ways to do so, in no particular order:
- <div class="itemizedlist"><ul><li><p><a name="d0e2371"></a>Participate effectively in the mailing lists.
+ <div class="itemizedlist"><ul><li><p><a name="d0e2393"></a>Participate effectively in the mailing lists.
The quality of the mailing lists makes a huge difference
in the ability of new and experienced AspectJ users
to write good code. For guidance on effective
@@ -2607,13 +2634,13 @@ vmparam -Xmx384m
Also, the time that experienced users take in answering emails
can directly translate to time developers can use (instead)
for fixing bugs or adding features.
- </p></li><li><p><a name="d0e2378"></a>Write bugs. Good bugs, especially with test cases,
+ </p></li><li><p><a name="d0e2400"></a>Write bugs. Good bugs, especially with test cases,
are always appreciated. We especially like proposals for
new <tt>XLint</tt> messages, since they are
sometimes easy to implement and help users learn
AspectJ, and for other implementable features
grounded in a compelling use-case.
- </p></li><li><p><a name="d0e2384"></a>Write test cases for compiler bugs without test cases.
+ </p></li><li><p><a name="d0e2406"></a>Write test cases for compiler bugs without test cases.
Compiler bugs without test cases are much less likely to be fixed;
until they are rendered in code, they might be user mistakes,
and they might duplicate another bug or actually cover many bugs.
@@ -2627,7 +2654,7 @@ vmparam -Xmx384m
</a>
</p><p>For how to write test cases, see
<a href="#q:harnesstestcases">Q:How should I submit test cases for bugs?</a>.
- </p></li><li><p><a name="d0e2398"></a>Write patches to fix bugs.
+ </p></li><li><p><a name="d0e2420"></a>Write patches to fix bugs.
If you particularly need a bug to be fixed, or if you're interested in
learning about the system, then get the source code and try to fix the
bug. Most likely you'll want to email aspectj-dev@eclipse.org to
@@ -2638,7 +2665,7 @@ vmparam -Xmx384m
the bug. (When creating patches, do so on a per-module basis; that
means if fixing the bug involves changes to three modules, submit
three patches.)
- </p></li><li><p><a name="d0e2401"></a>Write patches for other reasons.
+ </p></li><li><p><a name="d0e2423"></a>Write patches for other reasons.
Often documentation needs to be fixed, or there may be a small new
feature you'd like to see. You can just do it and then submit it
as a patch to a bug you create. As with bugs, in some cases you
@@ -2647,7 +2674,7 @@ vmparam -Xmx384m
on an approach that will be fruitless.
</p></li></ul></div>
</p></div></div><div class="qandaentry"><div class="question"><p><a name="q:buildingsource"></a><b>3. </b>How do I get and compile the source code for AspectJ?
- </p></div><div class="answer"><p><a name="d0e2409"></a><b></b>AspectJ 1.0 source code is available in an archive available
+ </p></div><div class="answer"><p><a name="d0e2431"></a><b></b>AspectJ 1.0 source code is available in an archive available
with the 1.0 downloads. It contains instructions for building
from sources.
</p><p>AspectJ 1.1+ source code is available through CVS using the
@@ -2658,17 +2685,37 @@ vmparam -Xmx384m
org.aspectj/modules/build/readme-build-and-test-aspectj.html</a>.
If you would like to use Ant to checkout the sources, build the
distribution, and test everything, see <a href="http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/org.aspectj/modules/build/release/build.xml?rev=HEAD&amp;content-type=text/xml&amp;cvsroot=Technology_Project" target="_top">
- org.aspectj/modules/build/release/build.xml</a>. </p><p>The AspectJ tree is organized into modules as follows:
- <pre class="programlisting">
- org.aspectj/
- modules/
- ajbrowser/
- ajde/
- ...
- lib/
- ...
- </pre>
- </p><p>
+ org.aspectj/modules/build/release/build.xml</a>. </p><p>
+ To check out the source code in Eclipse go to (<tt>File &gt; new &gt; Other &gt; CVS &gt; Checkout Projects from CVS</tt>). You'll need about 125 MB of space for the source and build.
+ Host: <tt>dev.eclipse.org</tt>,
+ Repository Path: <tt>/home/technology</tt>,
+ user name: <tt>anonymous</tt>,
+ password: (your email address),
+ connection type: <tt>pserver</tt>,
+ default port.
+ Then select the individual modules you want to check out (you probably want all of them bar aspectj-attic and java5) and click Next and choose to check out the modules you selected as Java projects.
+ Once thats done each module you checked out should show up as a project in the package explorer.
+ If you have problems after this point you can view the build instructions that come with AspectJ by going in the package explorer to: <tt>build &gt; readme-build-and-test-aspectj.html</tt>.
+ </p><p>
+ To get the modules to build you have to set some classpath variables (<tt>Window &gt; Preferences &gt; Java &gt; Build Path &gt; Classpath Variables</tt>):
+ </p><p>
+ <div class="itemizedlist"><ul><li><p><a name="d0e2476"></a>
+ Name: <tt>JAVA_HOME</tt>, Value: (wherever your Java JDK is installed)
+ </p></li><li><p><a name="d0e2482"></a>
+ Name: <tt>JRE15_LIB</tt>, Value: (wherever your Java 5 Runtime is installed)<tt>\jre\lib\rt.jar</tt>
+ </p></li><li><p><a name="d0e2491"></a>
+ Name: <tt>ASPECTJRT_LIB</tt>, Value: (wherever your workspace is)<tt>\lib\aspectj\lib\aspectjrt.jar</tt>. To find out where your workspace is go to <tt>File &gt; Switch Workspace</tt>.
+ </p></li></ul></div>
+ </p><p>
+ When you've added the variables click OK to do a full rebuild, then run the tests by going in the Package Explorer to:
+ <tt>run-all-junit-tests &gt; testsrc &gt; (default package) &gt; RunTheseBeforeYouCommitTests.java</tt>
+ and running this as a JUnit test (right click and select <tt>Run As &gt; JUnit Test</tt>).
+ Don't worry about any errors that appear in the console output,
+ just check that there are no failures in the JUnit view (<tt>Window &gt; Show View &gt; Other &gt; Java &gt; JUnit</tt>).
+ If that finishes with no Failures and a full green bar you have the AspectJ compiler source and it's building and testing properly.
+ </p><p>
+ Further details:
+ </p><p>
You can check out the entire modules directory and build using the
Ant build script <tt>modules/build/build.xml</tt>.
All required libraries are included in <tt>modules/lib/</tt>,
@@ -2677,21 +2724,21 @@ vmparam -Xmx384m
subdirectory as an eclipse Java project.
Depending on what you are trying to build, you need not check out
all modules; as of this writing, here are the modules to get
- when trying to build something:
+ for building the specific parts of AspectJ:
</p><p>
- <div class="itemizedlist"><ul><li><p><a name="d0e2448"></a>For any builds: build, lib
- </p></li><li><p><a name="d0e2451"></a>For the documentation: docs
- </p></li><li><p><a name="d0e2454"></a>For the compiler: bridge, util, testing-util,
+ <div class="itemizedlist"><ul><li><p><a name="d0e2534"></a>For any builds: build, lib
+ </p></li><li><p><a name="d0e2537"></a>For the documentation: docs
+ </p></li><li><p><a name="d0e2540"></a>For the compiler: bridge, util, testing-util,
weaver, asm, org.eclipse.jdt.core, org.aspectj.ajdt.core,
and runtime.
- </p></li><li><p><a name="d0e2457"></a>For ajbrowser: the compiler modules, plus
+ </p></li><li><p><a name="d0e2543"></a>For ajbrowser: the compiler modules, plus
ajbrowser, ajdoc, taskdefs, and ajde.
- </p></li><li><p><a name="d0e2460"></a>For the AspectJ distribution, the ajbrowser modules,
+ </p></li><li><p><a name="d0e2546"></a>For the AspectJ distribution, the ajbrowser modules,
plus aspectj5rt and org.aspectj.lib.
- </p></li><li><p><a name="d0e2463"></a>For the test harness (or to run the release build
+ </p></li><li><p><a name="d0e2549"></a>For the test harness (or to run the release build
scripts and tests): the ajbrowser modules, plus
testing, testing-client, and testing-drivers.
- </p></li><li><p><a name="d0e2466"></a>To run the test suite: the test harness modules, plus
+ </p></li><li><p><a name="d0e2552"></a>To run the test suite: the test harness modules, plus
tests.
</p></li></ul></div>
</p><p>
@@ -2701,32 +2748,32 @@ vmparam -Xmx384m
files and may
change, so the list above may not be correct when you read it.
</p></div></div><div class="qandaentry"><div class="question"><p><a name="q:devDocs"></a><b>4. </b>Where do I find developer documentation on building and testing AspectJ source code?
- </p></div><div class="answer"><p><a name="d0e2479"></a><b></b>Find the developer documentation in HTML files in the CVS tree,
+ </p></div><div class="answer"><p><a name="d0e2565"></a><b></b>Find the developer documentation in HTML files in the CVS tree,
inside the <tt>build</tt> and <tt>testing</tt> modules
(i.e., in <tt>org.aspectj/modules/build/...</tt>).
Most pertinant:
- <div class="itemizedlist"><ul><li><p><a name="d0e2492"></a>
+ <div class="itemizedlist"><ul><li><p><a name="d0e2578"></a>
<tt>../build/readme-build-and-test-aspectj.html</tt>
describes how to build the AspectJ distribution in Eclipse
and in Ant.
- </p></li><li><p><a name="d0e2498"></a><tt>../build/readme-docs-module.html</tt>
+ </p></li><li><p><a name="d0e2584"></a><tt>../build/readme-docs-module.html</tt>
describes the AspectJ documentation sources and
how to build the documentation using Ant.
- </p></li><li><p><a name="d0e2503"></a><tt>../build/readme-tests-module.html</tt>
+ </p></li><li><p><a name="d0e2589"></a><tt>../build/readme-tests-module.html</tt>
describes the all the tests
in the <tt>tests</tt> module.
- </p></li><li><p><a name="d0e2511"></a><tt>../build/readme-writing-compiler-tests.html</tt>
+ </p></li><li><p><a name="d0e2597"></a><tt>../build/readme-writing-compiler-tests.html</tt>
describes how to write compiler tests that can be run by
the AspectJ test harness.
- </p></li><li><p><a name="d0e2516"></a><tt>../build/readme-testing-drivers-module.html</tt>
+ </p></li><li><p><a name="d0e2602"></a><tt>../build/readme-testing-drivers-module.html</tt>
describes the test harness used to run the compiler tests
in the <tt>tests</tt> module.
- </p></li><li><p><a name="d0e2524"></a><tt>../build/readme-testing-drivers-module.html</tt>
+ </p></li><li><p><a name="d0e2610"></a><tt>../build/readme-testing-drivers-module.html</tt>
describes the test harness used to run the compiler tests
in the <tt>testing</tt> module.
</p></li></ul></div>
</p></div></div><div class="qandaentry"><div class="question"><p><a name="q:harnesstestcases"></a><b>5. </b>How should I submit test cases for bugs?
- </p></div><div class="answer"><p><a name="d0e2537"></a><b></b>You can attach files to a bug after it has been created.
+ </p></div><div class="answer"><p><a name="d0e2623"></a><b></b>You can attach files to a bug after it has been created.
The code of course should replicate the actual behavior
described in the bug when run on the target version.
If you have a single source file, you can attach it directly,
@@ -2835,7 +2882,7 @@ vmparam -Xmx384m
</pre>
</p></div></div><div class="qandaentry"><div class="question"><p><a name="q:testharness"></a><b>6. </b>I'd like to run my test case. How do I get the test harness?
- </p></div><div class="answer"><p><a name="d0e2554"></a><b></b>The test harness is not distributed.
+ </p></div><div class="answer"><p><a name="d0e2640"></a><b></b>The test harness is not distributed.
To build it, get the source tree as
described in <a href="#q:buildingsource">Q:How do I get and compile the source code for AspectJ?</a> and then
build the <tt>build-testing-drivers</tt> target:
@@ -2847,11 +2894,22 @@ vmparam -Xmx384m
<tt>../aj-build/jars/testing-drivers-all.jar</tt>
which you can run as described in
<tt>tests/readme-tests-module.html</tt>.
+ </p></div></div><div class="qandaentry"><div class="question"><p><a name="q:bcel"></a><b>7. </b>BCEL is used by AspectJ but it's not actively developed. Will you change?
+ </p></div><div class="answer"><p><a name="d0e2661"></a><b></b>The AspectJ bytecode weaver has used BCEL for bytecode manipulation
+ since its first release. We have upgraded it extensively, to improve
+ performance, support Java 5, etc. The BCEL developers have not
+ incorporated our patches, so we continue to maintain our own version.
+ Ours has been optimized for the AspectJ weaver and battle-hardened
+ over years of development and use. At some point in the future,
+ the AspectJ weaver might be restructured to make it easy to see
+ whether another bytecode package offers the same stability,
+ functionality, and performance, but for now we prefer using something
+ that we know works well.
</p></div></div></div><div class="qandadiv"><h3 class="title"><a name="help"></a>15 Getting Help</h3><div class="qandaentry"><div class="question"><p><a name="q:moreaboutaj"></a><b>1. </b>
How do I find out more about AspectJ?
- </p></div><div class="answer"><p><a name="d0e2578"></a><b></b>Visit the AspectJ project web site:
+ </p></div><div class="answer"><p><a name="d0e2671"></a><b></b>Visit the AspectJ project web site:
<a href="http://eclipse.org/aspectj" target="_top">http://eclipse.org/aspectj</a>.
- </p></div></div><div class="qandaentry"><div class="question"><p><a name="q:bugreports"></a><b>2. </b>How do I submit a bug report?</p></div><div class="answer"><p><a name="d0e2588"></a><b></b>You can submit a bug from
+ </p></div></div><div class="qandaentry"><div class="question"><p><a name="q:bugreports"></a><b>2. </b>How do I submit a bug report?</p></div><div class="answer"><p><a name="d0e2681"></a><b></b>You can submit a bug from
<a href="http://bugs.eclipse.org/bugs/enter_bug.cgi?product=AspectJ" target="_top">
http://bugs.eclipse.org/bugs/enter_bug.cgi?product=AspectJ
</a>.
@@ -2862,7 +2920,7 @@ vmparam -Xmx384m
<a href="#q:ajcbugs">Q:How do I write bugs for the AspectJ compiler?</a>.
</p></div></div><div class="qandaentry"><div class="question"><p><a name="q:talktousers"></a><b>3. </b>
How do I communicate with other AspectJ users?
- </p></div><div class="answer"><p><a name="d0e2600"></a><b></b>You can reach other AspectJ users by using the
+ </p></div><div class="answer"><p><a name="d0e2693"></a><b></b>You can reach other AspectJ users by using the
aspectj-users mailing list. You can subscribe to the list or view the
list archives from the AspectJ home page
<a href="http://eclipse.org/aspectj" target="_top">
@@ -2870,7 +2928,7 @@ vmparam -Xmx384m
</a>.
</p></div></div><div class="qandaentry"><div class="question"><p><a name="q:searchingsite"></a><b>4. </b>
How can I search the email archives or the web site?
- </p></div><div class="answer"><p><a name="d0e2610"></a><b></b>
+ </p></div><div class="answer"><p><a name="d0e2703"></a><b></b>
It is very effective to do a google search of the form,
<a href="http://www.google.com/search?q=site:eclipse.org+cflowbelow" target="_top">
http://www.google.com/search?q=site:eclipse.org+cflowbelow
@@ -2886,14 +2944,14 @@ vmparam -Xmx384m
</a>.
</p></div></div><div class="qandaentry"><div class="question"><p><a name="q:writingbugsandemails"></a><b>5. </b>
How should I write email queries?
- </p></div><div class="answer"><p><a name="d0e2626"></a><b></b>Here's the general form of a good email:
- </p><div class="orderedlist"><ol type="1"><li><p><a name="d0e2630"></a>
+ </p></div><div class="answer"><p><a name="d0e2719"></a><b></b>Here's the general form of a good email:
+ </p><div class="orderedlist"><ol type="1"><li><p><a name="d0e2723"></a>
Describe the big picture of what you are trying to do...
- </p></li><li><p><a name="d0e2633"></a>
+ </p></li><li><p><a name="d0e2726"></a>
Describe what you think it takes, in AspectJ terms
(concepts, syntax, and semantics) from the
<a href="progguide/index.html" target="_top">Programming Guide</a>...
- </p></li><li><p><a name="d0e2639"></a>
+ </p></li><li><p><a name="d0e2732"></a>
Show the AspectJ code you are using, what output it
produces when run, and what output you expect...
</p></li></ol></div><p>
@@ -2919,7 +2977,7 @@ vmparam -Xmx384m
</a>.
</p></div></div><div class="qandaentry"><div class="question"><p><a name="q:idebugs"></a><b>6. </b>
How do I write bugs for IDE support?
- </p></div><div class="answer"><p><a name="d0e2656"></a><b></b>
+ </p></div><div class="answer"><p><a name="d0e2749"></a><b></b>
Bugs appearing in the IDE's may apply to the affected IDE
or to the compiler. Compiler stack traces in IDE message windows
are prefixed "Internal Compiler Error" and should be written up
@@ -2951,29 +3009,29 @@ vmparam -Xmx384m
You can submit a patch by attaching it to the bug.
</p></div></div><div class="qandaentry"><div class="question"><p><a name="q:ajcbugs"></a><b>7. </b>
How do I write bugs for the AspectJ compiler?
- </p></div><div class="answer"><p><a name="d0e2677"></a><b></b>
+ </p></div><div class="answer"><p><a name="d0e2770"></a><b></b>
The best compiler bug report is a reproducible test case,
standalone code that demonstrates the problem.
Sometimes with aspects, a test case requires several
files, if not some way to capture the behavior.
Here's how we recommend submitting test cases:
- <div class="orderedlist"><ol type="1"><li><p><a name="d0e2681"></a>
+ <div class="orderedlist"><ol type="1"><li><p><a name="d0e2774"></a>
Write the test case so that when the compiler bug
is fixed, the test completes normally without output
(e.g., expected compiler errors are issued,
or classes produced run correctly). This usually
means writing one or more source files.
- </p></li><li><p><a name="d0e2684"></a>
+ </p></li><li><p><a name="d0e2777"></a>
In the bug report, briefly summarize the bug.
If it is not obvious, be sure to specify
the expected output/behavior (e.g., compiler error on line 32)
and, if the compile should complete, the main class to run.
- </p></li><li><p><a name="d0e2687"></a>
+ </p></li><li><p><a name="d0e2780"></a>
Submit the bugs via the web form
<a href="http://bugs.eclipse.org/bugs/enter_bug.cgi?product=AspectJ" target="_top">
http://bugs.eclipse.org/bugs/enter_bug.cgi?product=AspectJ
</a>.
- </p></li><li><p><a name="d0e2693"></a>Attach the test case to the bug.
+ </p></li><li><p><a name="d0e2786"></a>Attach the test case to the bug.
The test case may be a single file
or it may be multiple files in a single zip archive,
of the form discussed in
@@ -2981,7 +3039,7 @@ vmparam -Xmx384m
</p></li></ol></div>
</p></div></div><div class="qandaentry"><div class="question"><p><a name="q:teachingmaterials"></a><b>8. </b>
Can you recommend reading or teaching material for AspectJ?
- </p></div><div class="answer"><p><a name="d0e2703"></a><b></b>The documentation available in the distribution is the
+ </p></div><div class="answer"><p><a name="d0e2796"></a><b></b>The documentation available in the distribution is the
best source for language and usage questions. You can also find
selected AspectJ papers and presentations on the
<a href="http://www.parc.com/groups/csl/projects/aspectj/index.html" target="_top">
@@ -2990,31 +3048,31 @@ vmparam -Xmx384m
<a href="http://aosd.net" target="_top">http://aosd.net</a>.
</p></div></div><div class="qandaentry"><div class="question"><p><a name="q:consulting"></a><b>9. </b>
Where can our group get consulting and support?
- </p></div><div class="answer"><p><a name="d0e2716"></a><b></b>The best thing to to is join and email the
+ </p></div><div class="answer"><p><a name="d0e2809"></a><b></b>The best thing to to is join and email the
<tt>aspectj-dev@eclipse.org</tt> mailing list.
</p></div></div><div class="qandaentry"><div class="question"><p><a name="q:faqchanges"></a><b>10. </b>
What has changed since the last FAQ version?
- </p></div><div class="answer"><p><a name="d0e2726"></a><b></b>
+ </p></div><div class="answer"><p><a name="d0e2819"></a><b></b>
Entries changed recently:
- <div class="itemizedlist"><ul><li><p><a name="d0e2730"></a><a href="#q:java5">Q:Will AspectJ support Java 5?</a></p></li><li><p><a name="d0e2733"></a><a href="#q:dynamicaop">Q:How does AspectJ compare with more dynamic AOP?</a></p></li><li><p><a name="d0e2736"></a><a href="#q:buildingsource">Q:How do I get and compile the source code for AspectJ?</a></p></li></ul></div>
+ <div class="itemizedlist"><ul><li><p><a name="d0e2823"></a><a href="#q:bcel">Q:BCEL is used by AspectJ but it's not actively developed. Will you change?</a></p></li><li><p><a name="d0e2826"></a><a href="#q:reflectiveCalls">Q:Why doesn't AspectJ pick out reflective calls?</a></p></li><li><p><a name="d0e2829"></a><a href="#q:java5">Q:Will AspectJ support Java 5?</a></p></li><li><p><a name="d0e2832"></a><a href="#q:dynamicaop">Q:How does AspectJ compare with more dynamic AOP?</a></p></li><li><p><a name="d0e2835"></a><a href="#q:buildingsource">Q:How do I get and compile the source code for AspectJ?</a></p></li></ul></div>
</p></div></div></div><div class="qandadiv"><h3 class="title"><a name="project"></a>16 About the AspectJ Project</h3><div class="qandaentry"><div class="question"><p><a name="q:opensource"></a><b>1. </b>What does the fact that AspectJ is an Open Source
Project mean to me?
- </p></div><div class="answer"><p><a name="d0e2747"></a><b></b>Open source protects your interest in a correct, long-lived,
+ </p></div><div class="answer"><p><a name="d0e2846"></a><b></b>Open source protects your interest in a correct, long-lived,
up-to-date, and widely-accepted implementation of AspectJ.
- <div class="itemizedlist"><ul><li><p><a name="d0e2751"></a>With the source code, you control your own destiny
+ <div class="itemizedlist"><ul><li><p><a name="d0e2850"></a>With the source code, you control your own destiny
in perpetuity. You can continue to use the implementation
and update it as necessary to fix bugs and add things you need.
- </p></li><li><p><a name="d0e2754"></a>Because the code is available to all, anyone can find
+ </p></li><li><p><a name="d0e2853"></a>Because the code is available to all, anyone can find
and fix bugs. There is no need to hope for it to be fixed
in the next product release. Those who encounter the bugs
are motivated to fix them, and there are more eyeballs on
the code than in closed-source, so the quality tends to be high.
This can be particularly true for the AspectJ community,
which tends to be highly skilled.
- </p></li><li><p><a name="d0e2757"></a>The same is true of new features or behavior, so the
+ </p></li><li><p><a name="d0e2856"></a>The same is true of new features or behavior, so the
implementation should be up-to-date. This is important as
the field of AOP develops, to capture the latest solutions.
- </p></li><li><p><a name="d0e2760"></a>For a programming language which forms the basis of
+ </p></li><li><p><a name="d0e2859"></a>For a programming language which forms the basis of
an entire solution stack, open source facilitates the kind
of adoption -- tool integrations and significant projects --
that develop and prove the technology for wider adoption. This
@@ -3025,7 +3083,7 @@ vmparam -Xmx384m
</p></div></div><div class="qandaentry"><div class="question"><p><a name="q:standardization"></a><b>2. </b>What are your plans to make AspectJ a general feature
of Java supported by Sun and the other key players in the Java
Industry?
- </p></div><div class="answer"><p><a name="d0e2768"></a><b></b>Although we are committed to making AspectJ available to a wide
+ </p></div><div class="answer"><p><a name="d0e2867"></a><b></b>Although we are committed to making AspectJ available to a wide
range of users, it is too early to decide on a strategy. Some
options include continuing AspectJ as a stand-alone product,
integrating it into IDEs, or possibly incorporating it into
@@ -3044,7 +3102,7 @@ vmparam -Xmx384m
for AspectJ in the long term.
</p></div></div><div class="qandaentry"><div class="question"><p><a name="q:bytecodeweaving"></a><b>3. </b>When will AspectJ work from class files?
When will it work at class-loading time?
- </p></div><div class="answer"><p><a name="d0e2781"></a><b></b>Bytecode weaving is in AspectJ 1.1. We believe it
+ </p></div><div class="answer"><p><a name="d0e2880"></a><b></b>Bytecode weaving is in AspectJ 1.1. We believe it
works as described in an email to the users list by Jim Hugugin:
</p><p>
The AspectJ language was designed to support weaving at many different times:
@@ -3066,12 +3124,12 @@ vmparam -Xmx384m
the 1.1 release or soon thereafter.
</p></div></div><div class="qandaentry"><div class="question"><p><a name="q:differences"></a><b>4. </b>What are the differences between the current and
previously released versions of AspectJ?
- </p></div><div class="answer"><p><a name="d0e2794"></a><b></b>The AspectJ team aims to keep the implementation bug-free and
+ </p></div><div class="answer"><p><a name="d0e2893"></a><b></b>The AspectJ team aims to keep the implementation bug-free and
up-to-date with the Java language,
to limit AspectJ language changes to those that
are carefully considered, compelling, and backwards-compatible,
and to deliver those language changes only in significant releases (1.0, 1.1).
- </p><div class="table"><p><a name="d0e2797"></a><b>Table 2. </b></p><table summary="" border="1"><colgroup><col><col></colgroup><tbody><tr><td align="left">Version</td><td align="left">Description</td></tr><tr><td>AspectJ 1.1</td><td>A few language changes and clarifications;
+ </p><div class="table"><p><a name="d0e2896"></a><b>Table 2. </b></p><table summary="" border="1"><colgroup><col><col></colgroup><tbody><tr><td align="left">Version</td><td align="left">Description</td></tr><tr><td>AspectJ 1.1</td><td>A few language changes and clarifications;
bytecode weaving and incremental compilation.
See <a href="README-11.html" target="_top">README-11.html</a>
for more detail.
@@ -3102,7 +3160,7 @@ vmparam -Xmx384m
<a href="changes.html" target="_top">changes.html</a>.
</p></div></div><div class="qandaentry"><div class="question"><p><a name="q:schedule"></a><b>5. </b>
What is the AspectJ development schedule?
- </p></div><div class="answer"><p><a name="d0e2877"></a><b></b>
+ </p></div><div class="answer"><p><a name="d0e2976"></a><b></b>
Below is a table describing the goals for the major releases.
For information about specific features, search the bug database
for <tt>RFE</tt>'s ("requests for enhancement") by
@@ -3113,7 +3171,7 @@ vmparam -Xmx384m
schedules, but we do follow a pattern of issuing preview releases
which can give observers an idea of when
a particular release might be available.
- </p><div class="table"><p><a name="d0e2886"></a><b>Table 3. The AspectJ Development Schedule</b></p><table summary="The AspectJ Development Schedule" border="1"><colgroup><col><col></colgroup><tbody><tr><td align="left">Version</td><td align="left">Description</td></tr><tr><td align="center" valign="top">1.0</td><td>Final syntax and semantic changes. Standalone structure
+ </p><div class="table"><p><a name="d0e2985"></a><b>Table 3. The AspectJ Development Schedule</b></p><table summary="The AspectJ Development Schedule" border="1"><colgroup><col><col></colgroup><tbody><tr><td align="left">Version</td><td align="left">Description</td></tr><tr><td align="center" valign="top">1.0</td><td>Final syntax and semantic changes. Standalone structure
browser. Complete documentation.
</td></tr><tr><td align="center" valign="top">1.1</td><td>Faster incremental compilation, bytecode weaving,
and a small number of language changes.</td></tr><tr><td align="center" valign="top">1.2</td><td>Faster weaving, -inpath option, better error messages,
@@ -3122,7 +3180,7 @@ vmparam -Xmx384m
</td></tr><tr><td align="center" valign="top">1.3 (AspectJ 5)</td><td>Support for Java 1.5
</td></tr></tbody></table></div></div></div><div class="qandaentry"><div class="question"><p><a name="q:java5"></a><b>6. </b>
Will AspectJ support Java 5?
- </p></div><div class="answer"><p><a name="d0e2920"></a><b></b>
+ </p></div><div class="answer"><p><a name="d0e3019"></a><b></b>
Yes. We will support weaving Java 5 classes and upgrade the language
to use annotations and generics. For more information, see the
documentation for the AspectJ 5 release.
diff --git a/org.aspectj.ajde/doc/index.html b/org.aspectj.ajde/doc/index.html
index f4ab069af..5827eb068 100755
--- a/org.aspectj.ajde/doc/index.html
+++ b/org.aspectj.ajde/doc/index.html
@@ -25,7 +25,7 @@
<a href="adk15notebook/index.html">AspectJ 5 Developer's Notebook</a>,
<a href="progguide/index.html">programming</a> and
<a href="devguide/index.html">development</a> guides,
- <a href="api/index.html">API</a> and
+ <a href="runtime-api/index.html">API</a> and
<a href="examples/">example code</a>.
</td></tr>
<tr><td><a href="#distributions">distributions</a></td><td>
@@ -106,10 +106,11 @@
</td>
</tr>
-<tr> <td><a href="api/index.html">AspectJ API</a>
+<tr> <td><a href="runtime-api/index.html">AspectJ API</a>
</td>
<td>API documentation for AspectJ runtime classes. <tt>JoinPoint</tt>
shows the state automatically available at each join point.
+ See also the <a href="weaver-api/index.html">Weaver API</a>
</td> </tr>
<tr> <td><a href="faq.html"> FAQ</a>
@@ -291,6 +292,7 @@
see the <a href="progguide/examples.html">Examples </a> section
in the <a href="progguide/index.html">Programming Guide</a>.
View and navigate the crosscutting structure using
+ <a href="http://eclipse.org/ajdt">AJDT</a>; if you can't use Eclipse, try
the <code>ajbrowser</code> structure viewer, as described in
the <a href="devguide/ajbrowser.html">AspectJ Browser</a> section of
the <a href="devguide/index.html">Development Environment Guide</a>.
diff --git a/org.aspectj.ajde/doc/progguide/apcs02.html b/org.aspectj.ajde/doc/progguide/apcs02.html
index 5cbe224c4..990a1531a 100755
--- a/org.aspectj.ajde/doc/progguide/apcs02.html
+++ b/org.aspectj.ajde/doc/progguide/apcs02.html
@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Bytecode Notes</title><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM Programming Guide"><link rel="up" href="implementation.html" title="Appendix C. Implementation Notes"><link rel="previous" href="implementation.html" title="Appendix C. Implementation Notes"><link rel="next" href="apcs03.html" title="Summary of implementation requirements"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Bytecode Notes</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="implementation.html">Prev</a>&nbsp;</td><th width="60%" align="center">Appendix C. Implementation Notes</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="apcs03.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="d0e7212"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e7212"></a>Bytecode Notes</h2></div></div><div class="sect2"><a name="d0e7215"></a><div class="titlepage"><div><h3 class="title"><a name="d0e7215"></a>The .class expression and String +</h3></div></div><p> The java language form <tt>Foo.class</tt> is
+ <title>Bytecode Notes</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM Programming Guide"><link rel="up" href="implementation.html" title="Appendix C. Implementation Notes"><link rel="previous" href="implementation.html" title="Appendix C. Implementation Notes"><link rel="next" href="apcs03.html" title="Summary of implementation requirements"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Bytecode Notes</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="implementation.html">Prev</a>&nbsp;</td><th width="60%" align="center">Appendix C. Implementation Notes</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="apcs03.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="d0e7219"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e7219"></a>Bytecode Notes</h2></div></div><div class="sect2"><a name="d0e7222"></a><div class="titlepage"><div><h3 class="title"><a name="d0e7222"></a>The .class expression and String +</h3></div></div><p> The java language form <tt>Foo.class</tt> is
implemented in bytecode with a call to
<tt>Class.forName</tt> guarded by an exception
handler catching a <tt>ClassNotFoundException</tt>.
@@ -23,12 +23,12 @@
}
</pre><p>In short, the join point model of the current AspectJ
compiler considers these as valid join points.
- </p></div><div class="sect2"><a name="d0e7246"></a><div class="titlepage"><div><h3 class="title"><a name="d0e7246"></a>The Handler join point</h3></div></div><p>The end of exception handlers cannot reliably be found in Java
+ </p></div><div class="sect2"><a name="d0e7253"></a><div class="titlepage"><div><h3 class="title"><a name="d0e7253"></a>The Handler join point</h3></div></div><p>The end of exception handlers cannot reliably be found in Java
bytecode. Instead of removing the handler join point entirely, the
current AspectJ compiler restricts what can be done with the handler
join point:
- </p><div class="itemizedlist"><ul><li><a name="d0e7252"></a>After and around advice cannot apply to handler
- join points.</li><li><a name="d0e7254"></a>The control flow of a handler join point cannot be
+ </p><div class="itemizedlist"><ul><li><a name="d0e7259"></a>After and around advice cannot apply to handler
+ join points.</li><li><a name="d0e7261"></a>The control flow of a handler join point cannot be
detected. </li></ul></div><p>
The first of these is relatively straightforward. If any piece of
after advice (returning, throwing, or "finally") would normally
@@ -58,7 +58,7 @@
A source-code implementation of AspectJ (such as AspectJ 1.0.6) is
able to detect the endpoint of a handler join point, and as such
will likely have fewer such restrictions.
- </p></div><div class="sect2"><a name="d0e7291"></a><div class="titlepage"><div><h3 class="title"><a name="d0e7291"></a>Initializers and Inter-type Constructors</h3></div></div><p>
+ </p></div><div class="sect2"><a name="d0e7298"></a><div class="titlepage"><div><h3 class="title"><a name="d0e7298"></a>Initializers and Inter-type Constructors</h3></div></div><p>
The code for Java initializers, such as the assignment to the
field d in
</p><pre class="programlisting">
diff --git a/org.aspectj.ajde/doc/progguide/apcs03.html b/org.aspectj.ajde/doc/progguide/apcs03.html
index 6d65a9c18..04c26a3a2 100755
--- a/org.aspectj.ajde/doc/progguide/apcs03.html
+++ b/org.aspectj.ajde/doc/progguide/apcs03.html
@@ -1,10 +1,10 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Summary of implementation requirements</title><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM Programming Guide"><link rel="up" href="implementation.html" title="Appendix C. Implementation Notes"><link rel="previous" href="apcs02.html" title="Bytecode Notes"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Summary of implementation requirements</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apcs02.html">Prev</a>&nbsp;</td><th width="60%" align="center">Appendix C. Implementation Notes</th><td width="20%" align="right">&nbsp;</td></tr></table><hr></div><div class="sect1"><a name="d0e7318"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e7318"></a>Summary of implementation requirements</h2></div></div><p>
+ <title>Summary of implementation requirements</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM Programming Guide"><link rel="up" href="implementation.html" title="Appendix C. Implementation Notes"><link rel="previous" href="apcs02.html" title="Bytecode Notes"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Summary of implementation requirements</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apcs02.html">Prev</a>&nbsp;</td><th width="60%" align="center">Appendix C. Implementation Notes</th><td width="20%" align="right">&nbsp;</td></tr></table><hr></div><div class="sect1"><a name="d0e7325"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e7325"></a>Summary of implementation requirements</h2></div></div><p>
This summarizes the requirements of our implementation of AspectJ.
For more details, see the relevant sections of this guide.
- </p><div class="itemizedlist"><ul compact><li><p><a name="d0e7324"></a>The invoking code must be under the control of ajc
- for the following join points:</p><div class="itemizedlist"><ul compact><li><a name="d0e7328"></a>call join point</li><li><a name="d0e7330"></a>get join point</li><li><a name="d0e7332"></a>set join point</li></ul></div></li><li><p><a name="d0e7334"></a>The declaring/target code must be under the control of ajc
- for the following join points and inter-type declarations:</p><div class="itemizedlist"><ul compact><li><a name="d0e7338"></a>execution join point</li><li><a name="d0e7340"></a>adviceexecution join point</li><li><a name="d0e7342"></a>handler join point</li><li><a name="d0e7344"></a>initialization join point</li><li><a name="d0e7346"></a>preinitialiaztion join point</li><li><a name="d0e7348"></a>staticinitialization join point</li><li><a name="d0e7350"></a>perthis aspect</li><li><a name="d0e7352"></a>pertarget aspect</li><li><a name="d0e7354"></a>declare parents</li><li><a name="d0e7356"></a>declare method or field (see interface caveats below)</li></ul></div></li><li><p><a name="d0e7358"></a>Implementation Caveats</p><div class="itemizedlist"><ul compact><li><p><a name="d0e7362"></a>The initialization and preinitialization join points
- do not support around advice</p></li><li><p><a name="d0e7365"></a>The handler join point does not support...</p><div class="itemizedlist"><ul compact><li><a name="d0e7369"></a>after advice</li><li><a name="d0e7371"></a>around advice</li><li><a name="d0e7373"></a>cflow(handler(..))</li></ul></div></li><li><p><a name="d0e7375"></a>Declaring members on an interface in an aspect affects only
- the topmost implementing classes the implementation controls.</p></li><li><p><a name="d0e7378"></a>cflow and cflowbelow pointcuts work within a single thread.</p></li></ul></div></li></ul></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="apcs02.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;</td></tr><tr><td width="40%" align="left">Bytecode Notes&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="implementation.html">Up</a></td><td width="40%" align="right">&nbsp;</td></tr></table></div></body></html> \ No newline at end of file
+ </p><div class="itemizedlist"><ul compact><li><p><a name="d0e7331"></a>The invoking code must be under the control of ajc
+ for the following join points:</p><div class="itemizedlist"><ul compact><li><a name="d0e7335"></a>call join point</li><li><a name="d0e7337"></a>get join point</li><li><a name="d0e7339"></a>set join point</li></ul></div></li><li><p><a name="d0e7341"></a>The declaring/target code must be under the control of ajc
+ for the following join points and inter-type declarations:</p><div class="itemizedlist"><ul compact><li><a name="d0e7345"></a>execution join point</li><li><a name="d0e7347"></a>adviceexecution join point</li><li><a name="d0e7349"></a>handler join point</li><li><a name="d0e7351"></a>initialization join point</li><li><a name="d0e7353"></a>preinitialiaztion join point</li><li><a name="d0e7355"></a>staticinitialization join point</li><li><a name="d0e7357"></a>perthis aspect</li><li><a name="d0e7359"></a>pertarget aspect</li><li><a name="d0e7361"></a>declare parents</li><li><a name="d0e7363"></a>declare method or field (see interface caveats below)</li></ul></div></li><li><p><a name="d0e7365"></a>Implementation Caveats</p><div class="itemizedlist"><ul compact><li><p><a name="d0e7369"></a>The initialization and preinitialization join points
+ do not support around advice</p></li><li><p><a name="d0e7372"></a>The handler join point does not support...</p><div class="itemizedlist"><ul compact><li><a name="d0e7376"></a>after advice</li><li><a name="d0e7378"></a>around advice</li><li><a name="d0e7380"></a>cflow(handler(..))</li></ul></div></li><li><p><a name="d0e7382"></a>Declaring members on an interface in an aspect affects only
+ the topmost implementing classes the implementation controls.</p></li><li><p><a name="d0e7385"></a>cflow and cflowbelow pointcuts work within a single thread.</p></li></ul></div></li></ul></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="apcs02.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;</td></tr><tr><td width="40%" align="left">Bytecode Notes&nbsp;</td>&l