diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2024-01-04 08:13:04 +0700 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2024-01-06 10:09:11 +0100 |
commit | 0065b755292708d6fd27c067564ecef2b10ede04 (patch) | |
tree | 2a88188271fe2910fd26c5b8536f39fabe111168 /docs/dist/doc | |
parent | ba6058a4007f937c3d32a6022446edaa149a0d1d (diff) | |
download | aspectj-0065b755292708d6fd27c067564ecef2b10ede04.tar.gz aspectj-0065b755292708d6fd27c067564ecef2b10ede04.zip |
Delete 50+ XML DocBook resource files
in favour of the already existing asciidoc ones.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'docs/dist/doc')
-rw-r--r-- | docs/dist/doc/aspectj-faq.css | 88 | ||||
-rw-r--r-- | docs/dist/doc/changes.html | 2046 | ||||
-rw-r--r-- | docs/dist/doc/index.html | 350 | ||||
-rw-r--r-- | docs/dist/doc/porting.html | 2045 |
4 files changed, 0 insertions, 4529 deletions
diff --git a/docs/dist/doc/aspectj-faq.css b/docs/dist/doc/aspectj-faq.css deleted file mode 100644 index 14cf4aa7c..000000000 --- a/docs/dist/doc/aspectj-faq.css +++ /dev/null @@ -1,88 +0,0 @@ -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: #00AAF0; - } - -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/docs/dist/doc/changes.html b/docs/dist/doc/changes.html deleted file mode 100644 index c3bd45add..000000000 --- a/docs/dist/doc/changes.html +++ /dev/null @@ -1,2046 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> <head> - <meta http-equiv="Content-Language" content="en-us"> - <title>Changes in AspectJ</title> -<STYLE TYPE="text/css"> -<!-- - - /* FOR THE SDA PAGE */ - - /* - BODY {margin-top: 15px; margin-left: 15px; margin-right: 15px;} - */ - - A:link { - color:#4756AC; - } - A:visited { - color:#60657B; - } - A:hover { - color:red - } - - INPUT {font:12px "Courier New", sans-serif;} - - H2 { - font:18px/18px Verdana, Arial, Helvetica, sans-serif; - color:black; - font-weight:bold; - margin-left: 10px; - line-height:110%; - } - H3 { - font:17px/17px Verdana, Arial, Helvetica, sans-serif; - color:black; - //font-weight:bold; - margin-left: 10px; - line-height:110%; - } - H4 { - font:15px/16px Verdana, Arial, Helvetica, sans-serif; - color:black; - font-weight:bold; - margin-left: 10px; - line-height:140%; - } - P { - font:13px/13px Verdana, Arial, Helvetica, sans-serif; - margin-right: 10px; - margin-left: 10px; - line-height:130%; - } - .paragraph { - font:13px/13px Verdana, Arial, Helvetica, sans-serif; - margin-right: 10px; - margin-left: 10px; - line-height:130%; - } - .smallParagraph { - font:11px/11px Verdana, Arial, Helvetica, sans-serif; - margin-right: 10px; - margin-left: 10px; - line-height:130%; - } - LI { - font:13px/13px Verdana, Arial, Helvetica, sans-serif; - text-align:justify; - margin-right: 10px; - margin-left: 15px; - line-height:120%; - } - /* - UL { - font:13px/13px Verdana, Arial, Helvetica, sans-serif; - text-align:justify; - margin-right: 10px; - margin-left: 15px; - line-height:120%; - }*/ - - DL { - font:13px/13px Verdana, Arial, Helvetica, sans-serif; - text-align:justify; - margin-right: 10px; - margin-left: 15px; - line-height:120%; - } - B { font:13px/13px Verdana, Arial, Helvetica, sans-serif; - font-weight:bold; - line-height:140%; - } - .footer { - font:10px/10px Verdana, Arial, Helvetica, sans-serif; - color:#888888; - text-align:left - } - .figureTitle { - font:13px/13px Verdana, Arial, Helvetica, sans-serif; - text-align:justify; - text-align:center - } - .copyrightNotice { - font:10px/10px Verdana, Arial, Helvetica, sans-serif; - color:#999999; - line-height:110%; - } - .smallHeading { - font:13px/13px Verdana, Arial, Helvetica, sans-serif; - font-weight:bold; - line-height:110%; - } - .tinyHeading { - font:11px/11px Verdana, Arial, Helvetica, sans-serif; - font-weight:bold; - line-height:120%; - } - .newsText { - font:11px/11px Verdana, Arial, Helvetica, sans-serif; - line-height:130%; - } - .smallParagraph { - font:11px/11px Verdana, Arial, Helvetica, sans-serif; - line-height:130%; - } - .fancyHeading { - font:20px/20px Chantilly, Arial, Helvetica, sans-serif; - margin-right: 10px; - color:#6f7a92; - margin-left: 10px; - line-height:130%; - } - ---> -</STYLE> -</head> -<body> - -<div align=right><small> -© Copyright 1998-2002 Palo Alto Research Center Incorporated - 2003-2008 Contributors. -All rights reserved. -</small></div> - -<h2>Changes in AspectJ</h2> - -<ul> - - <li> <a href="#1.6.0">1.6.0</a> (released 2008-04)</li> - <li> <a href="#1.5.4">1.5.4</a> (released 2007-12)</li> - <li> <a href="#1.5.3">1.5.3</a> (released 2006-11)</li> - <li> <a href="#1.5.2">1.5.2</a> (released 2006-06)</li> - <li> <a href="#1.5.1">1.5.1</a> (released 2006-04)</li> - <li> <a href="#1.5.0">1.5.0</a> (released 2005-12)</li> - <li> <a href="#1.2.1">1.2.1</a> (released 2004-10)</li> - <li> <a href="#1.2">1.2</a> (released 2004-05) - </li> - <li> <a href="#1.1.1">1.1.1</a> (released 2003-09) - </li> - <li> 1.1.0 (released 2003-06-06) - See <a href="README-11.html">README-11.html</a> - </li> - - <li><a href="#1.0.6">1.0.6</a> (released 2002-07-24) - <ul> - <li><a href="#1.0.6compiler">Compiler</a></li> - <li><a href="#1.0.6ajde">AJDE</a></li> - <li><a href="#1.0.6ajdoc">Ajdoc</a></li> - </ul> - </li> - - <li><a href="#1.0.5">1.0.5</a> (released 2002-06-27) - </li> - - <li><a href="#1.0.4">1.0.4</a> (released 2002-04-17) - </li> - - <li><a href="#1.0.3">1.0.3</a> (released 2002-02-08) - </li> - <li><a href="#1.0.2">1.0.2</a> (released 2002-02-06) - </li> - <li><a href="#1.0.1">1.0.1</a> (released 2001-12-18) - </li> - <li><a href="#1.0.0">1.0.0</a> (released 2001-11-30) - </li> - <li><a href="#1.0rc3">1.0rc3</a> (released 2001-11-14) - </li> - <li><a href="#1.0rc2">1.0rc2</a> (released 2001-10-12) - </li> - <li><a href="#1.0rc1">1.0rc1</a> (released 2001-10-5) - </li> - <li><a href="#1.0beta1">1.0beta1</a> (released 2001-08-29) - </li> - <li><a href="#1.0alpha1">1.0alpha1</a> (released 2001-08-09) - </li> - <li><a href="porting.html">Porting and Transition</a></li> -</ul> - -<hr /> - -<h2><a name="1.6.0">1.6.0</a></h2> -<p>This release rebases AspectJ on the Eclipse Compiler version 785_R33X - making it Java6 compliant.</p> - -<p>A full list of bugs fixed and enhancements implemented can be found in -<a href="https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=&product=AspectJ&target_milestone=1.6.0+M1&target_milestone=1.6.0+M2&target_milestone=1.6.0+RC1&target_milestone=1.6.0&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&status_whiteboard_type=allwordssubstr&status_whiteboard=&keywords_type=allwords&keywords=&bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&emailtype1=substring&email1=&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0=">Bugzilla</a>. -</p> - -<h2><a name="1.5.4">1.5.4</a></h2> -<p>This release contains around 40 bug fixes and enhancements since the 1.5.3 release.</p> - -<p>A full list of bugs fixed and enhancements implemented can be found in -<a href="https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced&product=AspectJ&target_milestone=1.5.4&bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED"/> -Bugzilla</a> -</p> - -<h2><a name="1.5.3">1.5.3</a></h2> -<p>This release contains around 80 bug fixes and enhancements since the 1.5.2 release.</p> - -<p>A full list of bugs fixed and enhancements implemented can be found in -<a href="https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced&product=AspectJ&target_milestone=1.5.3&bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED"/> -Bugzilla</a> -</p> - -<h2><a name="1.5.2">1.5.2</a></h2> -<p>This release contains around 60 bug fixes and enhancements since the 1.5.1 release.</p> - -<p>A full list of bugs fixed and enhancements implemented can be found in -<a href="https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced&product=AspectJ&target_milestone=1.5.2&bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED"/> -Bugzilla</a> -</p> - -<h2><a name="1.5.1">1.5.1</a></h2> -<p>This release contains over 70 bug fixes and enhancements since the 1.5.0 release.</p> - -<p>A full list of bugs fixed in AspectJ 5 can be found in -<a href="https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced&product=AspectJ&target_milestone=1.5.1&bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED"/> -Bugzilla</a> -</p> - -<h2><a name="1.5.0">1.5.0</a></h2> -<p>This release contains nearly 400 bug fixes and enhancements since the 1.2.1 release. -Major updates to the language are documented in the -<a href="adk15notebook/index.html">AspectJ 5 Developer's Notebook</a>. There are -also a number of enhancements to accompanying tools documented in the -<a href="devguide/index.html">Developer's Guide</a> -</p> - -<p>A full list of bugs fixed in AspectJ 5 can be found in -<a href="https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&product=AspectJ&resolution=FIXED&chfieldfrom=2004-11-06&chfieldto=2005-12-20">bugzilla</a>. -</p> - -<h2><a name="1.2.1">1.2.1</a></h2> -<p>All known P1 and P2 bugs have been fixed in this release. The -<a href="https://bugs.eclipse.org/bugs/buglist.cgi?product=AspectJ&target_milestone=1.2.1&bug_status=RESOLVED&resolution=FIXED">full list of fixes and -enhancements</a> can be found on bugzilla. -Some of the more significant bug fixes and enhancements include: - <ul> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=53981">53981</a> - Any occurence of proceed(..) within the body of around advice is treated as the - special proceed form (even if the aspect defines a method named proceed) unless - a target other than the aspect instance is specified as the recipient of the - call. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=48990">48990</a> - Optimisations added for the special cases of if(true) and if(false) in pointcut - expressions. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=69319">69319</a> - The Eclipse JDT compiler inside AspectJ has been upgraded to the Eclipse 3.0 release - version. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=61572">61572</a> - AspectJ 1.2.1 correctly detects an attempt to access instance variables of the - declaring aspect of an inter-type declared method from within the body of that - method. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=65319">65319</a> - Error message now correctly produced when attempting to bind a pointcut formal - in both a this() and a target() pointcut sub-expression. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=70619">70619</a> - Conflicting declare precedence statements are now handled gracefully. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=42573">42573</a> - Relative paths specified in .lst files are now resolved relative to the lst file - location. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=57666">57666</a> - Resource copying from jar files correctly handles duplicate manifests. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=61768">61768</a> - Static inner types of an aspect can now be referenced within the body of inter-type - declared methods in that aspect. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=62642">62642</a> - after-throwing advice on a static initialization join point no longer swallows - ExceptionInInitializer errors. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=67578">67578</a> - AspectJ 1.2.1 correctly handles privileged access to members defined in a different - package to the privileged aspect. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=67592">67592</a> - The Object[] given in response to a getArgs() call on a JoinPoint object is now - a value copy. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=68991">68991</a> - Initialisers of inter-type declared fields now have field-set join points. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=69459">69459</a> - A static inter-type method declaration is not allowed to hide an instance method. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=70794">70794</a> - An inter-type declaration of an abstract method on a target type which is an interface - must be declared as public. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=71372">71372</a> - Calls can be made to private static methods of enclosing types from the body of - around advice in an inner aspect. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=71377">71377</a> - Join points are now correctly detected for calls to private methods and set/get of - private fields within the body of around advice. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=71723">71723</a> - A non-privileged inter-type declared method cannot call protected methods defined in - parent classes of the target type. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=74238">74238</a> - Any privileged calls made by the AspectJ runtime library are now correctly - wrapped in doPrivileged blocks, with fall-back implementations, allowing - usage in restricted environments. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=74245">74245</a> - Specifying the -proceedOnError flag will now cause the compiler to attempt - weaving even in the face of errors. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=76030">76030</a> - Runtime optimisations for cflow (in the case where there are no arguments bound in - the cflow pointcut) have been implemented. This can dramatically speed-up some programs - making heavy use of cflow. Thanks to the abc compiler team for detecting this performance - related bug and for piloting the fix. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=54421">54421</a> - String concatentation (using "+") is now allowed for the message associated with - a declare error or warning statement. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=69011">69011</a> - ajdoc now correctly handles types in the default package. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=36747">36747</a> - The 1.2.1 compiler supports an additional option, -showWeaveInfo, which will - produce informational messages concerning the activity of the weaver. For example: - </br> - <pre> - Type 'tjp.Demo' (Demo.java:30) advised by around advice from 'tjp.GetInfo' - (GetInfo.java:26) [RuntimeTest=true] - </pre> - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=44191">44191</a> - AspectJ 1.2.1 improves the error messages issued in many of the infamous "can't find type" - scenarios. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=46298">46298</a> - The code generated by ajc is now more easily digested by many decompilers (but you - wouldn't want to do that anyway would you?? ;) ). - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=49743">49743</a> - Performance optimisations in the AspectJ runtime library when using getSignature() and - toString(). - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=61374">61374</a> - AspectJ now includes its own version of BCEL under the org.aspectj namespace which eliminates - unwanted conflicts with BCEL versions inside JDKs or on classpaths in general. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=68494">68494</a> - ajdoc now supports ".aj" files. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=72154">72154</a> - The AspectJ 1.2.1 compiler includes the ability to dump information about the current state of the - compiler on failure. By default this only happens on an abort, but it can also be forced to - dump on error by specifying the property: org.aspectj.weaver.Dump.condition=error - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=37020">37020</a> - The line number locations for method execution and static initialization join points now give - the first line of the method declaration (rather than the line number of the first line of code in - the method body) when the source code is compiled by ajc. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=73369">73369</a> - A new jar, aspectjweaver.jar is included in the lib directory, which contains the subset - of aspectjtools.jar needed for weaving. The "aj" script is also moved into the bin directory. - </ul> - - -<h2><a name="1.2">1.2</a></h2> -<p>All known P1 and P2 bugs have been fixed in this release. The -<a href="https://bugs.eclipse.org/bugs/buglist.cgi?product=AspectJ&target_milestone=1.2">full list of fixes and -enhancements</a> can be found on bugzilla. -Some of the more significant bug fixes and enhancements include: - <ul> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=46347">46347</a> - The ajc compiler now can read .class files from directories as well as - zip files for bytecode weaving, via the new -inpath option. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=48080">48080</a> - Error and warning messages emitted as a result of a declare error or - declare warning statement now include context information that indicates - the matched join point. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=54819">54819</a> - Error and warning messages coming from the weaving phase of compilation now - show source context wherever it is available, and also indicate as the source - location of the error either the class file or jar file from which the binary - source unit came. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=36430">36430</a> - A new -Xreweavable option has been added which allows class files to be woven - more than once. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=49250">49250</a> - SoftException now supports getCause(). - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=51320">51320</a> - AspectJ 1.2 now gives a compilation error if one of the non-statically determinable - pointcut forms is used in a declare statement. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=53012">53012</a> - Declaring precedence on a class type (rather than an aspect type) is now an - error unless subtypes are included. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=36069">36069</a> - The source information for inlined advice is now correct (using JSR 45). - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=34206">34206</a> - (See also <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=44587">44587</a>). - Errors occuring during static initialisation of an aspect are now handled much more gracefully. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=41952">41952</a> - A new Xlint warning warns users specifying declaring type patterns in - call pointcut designators if the pointcut does not match at places they - may expect it to. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=42574">42574</a> - -extdirs opion now recognises .zip files as well as .jar. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=48091">48091</a> - New option -XlazyTjp defers creation of JoinPoint objects until just before - calling the advice body that requires them. This allows the cost of creating - JoinPoint objects to be avoided using an if() pointcut test that returns - false when the advice body is not required to be executed. Speed-ups of 10-100X are - obtained via this optimisation (as compared to putting the test inside the advice - body). - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=45441">45441</a> - IncompatibleClassChangeError at runtime when compiling with the -1.4 option. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=54625">54625</a> - Incremental compilation did not support the -outjar option, but silently - failed if it was specified. AspectJ 1.2 always performs a full build when - the -outjar option is present. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=54965">54965</a> - Incremental compilation under AspectJ 1.2 is approximately twice as fast as - under AspectJ 1.1.1. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=55134">55134</a> - Incremental compilation now deletes any additional class files generated during - the weave phase when the class file from whence they came is deleted. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=54621">54621</a> - Incremental compilation will now detect changes (add, delete, modify) to class - files in directories on the inpath and will include them in incremental compilation. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=54621">54621</a> - Incremental compilation will now detect changes to jars on the inpath (and injars), - and trigger a full build if a jar is modified. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=54622">54622</a> - Incremental compilation will now detect changes to resources on the inpath. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=54618">54618</a> - Incremental compilation will now detect changes to any of the paths affecting - compilation, and triggers a full build if there has been any change since the - last build. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=50200">50200</a> - The aspectjrt.jar manifest file now has the correct (upper) case. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=49457">49457</a> - No error given when overloading pointcuts, unless variables are bound. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=50776">50776</a> - Compilation failure when overriding an inter-type declared method with a - different throws clause. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=51919">51919</a> - Polymorphic inter-type declaration fails. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=52464">52464</a> - Declare warning coupled with inter-type declaration causes compiler crash. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=41125">41125</a> - Variable names in the local variable table (for debugging) are now correctly - preserved in all cases. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=43792">43792</a> - Improved support for non-US locales (and significantly boosted weaver - performance at the same time). - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=35636">35636</a> - AspectJ 1.2 behaves much more gracefully when running out of memory. (It also - requires less memory than 1.1.1 did in any case). - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=42711">42711</a> - Super-types of parameters not recognised when calling priveleged methods. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=43972">43972</a> - (See also <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=45676">45676</a>). - Incorrectly adding synthetic attribute to generated methods. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=45184">45184</a> - External pointcut references not resolved when a named pointcut is used by a - declare statement. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=46750">46750</a> - Declare soft does not work inside a nested aspect. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=47754">47754</a> - No error signalled when attempting to declare a static method on an interface - using an inter-type declaration. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=48522">48522</a> - Declare soft softens all exceptions at matched join points, not just the - exception declared to be soft. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=49295">49295</a> - AspectJ 1.2 no longer supports inter-type constructor declarations on interfaces. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=51929">51929</a> - Call to a protected super-type method within a advice body causes java.lang.VerifyError. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=52928">52928</a> - Private members introduced via an interface are incorrectly visible within implementing classes. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=47910">47910</a> - An output jar file created by AspectJ when using the -outjar option does not contain a - valid manifest file. - </li> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=59909">59909</a> - Thread local storage used to manage cflow stacks when available - improves cflow performance - when working with a multi-threaded application. - </li> - </ul> - -<h2><a name="1.1.1">1.1.1</a></h2> - -<p>All known P1 and P2 bugs have been fixed in this release. The <a href="https://bugs.eclipse.org/bugs/buglist.cgi?product=AspectJ&target_milestone=1.1.1">full list of bug fixes</a> -(49 in all) can be found on bugzilla.</p> - -<p>Some of the more significant bug fixes and enhancements in this release include: - <ul> - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=40943">40943</a> - The ajc compiler now copies resource files from jars specified using the - -injars option. When compiling with source directories, resources are <i>not</i> - copied - mirroring the behaviour of javac so as to cause minimum disruption - when switching between ajc and javac. - (To copy resources from source directories, use the iajc Ant task - <tt>sourceRootCopyFilter</tt> option.) - Thanks to Matthew - Webster for contributing many of the patches for this enhancement. - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=39626">39626</a> - ajc was erroneously putting aspectjtools.jar in the classpath of a compilation. - This caused problems when attempting to compile projects using different versions - of any of the classes in aspectjtools.jar. Thanks to George Harley and Igor - Hjelmstrom Vinhas Ribeiro for their assistance in tracking this down. - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=40257">40257</a> - Relative paths are now supported in ".lst" files. - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=40771">40771</a> - The Ajde apis are no longer coupled to swing. This is of most significance to AJDT - users on the Mac OS X platform, enabling AJDT to be used with Mac OS X. - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=41254">41254</a> - Of interest to those writing tools that need to interact with the structure model for - AspectJ programs: the interface to the AspectJ structure model was significantly revised - and enhanced in 1.1.1. - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=39462">39462</a> - A compiler exception was thrown when an abstract aspect in a library was extended by - a concrete aspect using cflow. Thanks to Takao Naguchi for an easy to reproduce bug report. - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=39479">39479</a> - Compiler crashes when a constructor delegates to another constructor that uses a switch statement. - Thanks to Andy Clement for both the easy to reproduce bug report and the patch. - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=41175">41175</a> - Declared exceptions were being lost on inter-type declarations made from binary - aspects in an aspect library. - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=41359">41359</a> - Aspect per-clauses were not inherited by sub-aspects when using binary aspect libraries. - Thanks to Chris Bozic for the easy to reproduce bug report. - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=42539">42539</a> - The "+" pattern was being ignored for type patterns used in throws clauses. Thanks to - Keith Sader for the easy to reproduce bug report. - <li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=40807">40807</a> - If you specify no output directory, the iajc Ant task now defaults to using - the source directory, following ajc and javac. - As a result, now you can use ajc to compile JSP's in Tomcat. - Thanks to Ron Bodkin for investigating how to integrate ajc with Tomcat. - </ul> -</p> - -<h2><a name="1.0.6">1.0.6</a></h2> - -<p> This release contains mainly bug fixes for ajde and ajdoc. - -<h3><a name="1.0.6compiler">Compiler</a></h3> - -<p>We fixed a bug with switch statements, thanks largely -to Jason Rimmer's diligence in helping us isolate the problem. -Also, to help Log4J parse stack traces, we changed class file -symbolic line references to use [] instead of () for the -virtual start lines of each file. -</p> - -<h3><a name="1.0.6ajde">AJDE</a></h3> - -<p><b>AJDE Framework, AJBrowser, and AJDE for Forte/NetBeans</b></p> - -<p>The memory use of the structure model has been streamlined in order to reduce -footprint when working with large systems. Error tolerance has also been -improved for dealing with a structure model that is out of synch with resources -on disk.</p> - -<h4>AJDE for JBuilder</h4> - -<p>JBuilder 7 is now supported. All known bugs have been fixed including:</p> - -<ul> - <li><a href="http://aspectj.org/bugs/resolved?id=787">787</a> - AJDE for JBuilder throws exception given non-existent file</li> - <li><a href="http://aspectj.org/bugs/resolved?id=788">788</a> - Label too small in error message </li> - <li><a href="http://aspectj.org/bugs/resolved?id=789">789</a> - Index-out-of-bounds exception in JBuilder AJDE </li> - <li><a href="http://aspectj.org/bugs/resolved?id=792">792</a> - Required libraries disappear from JBuilder 6 </li> - <li><a href="http://aspectj.org/bugs/resolved?id=795">795</a> - Unable to compile open tools </li> - <li><a href="http://aspectj.org/bugs/resolved?id=802">802</a> - AJDE loses current (cursor) position in file when switching files </li> -</ul> - -<p>In addition, thanks to user feedback that indicated trouble building JBuilder -OpenTools with AJDE/JBuilder, the OpenTool is now being built with itself. </p> - -<h3><a name="1.0.6ajdoc">Ajdoc</a></h3> - <ul> - <li>Fixed <a href="http://aspectj.org/bugs/resolved?id=790">790</a> - aspect code comments suppressed by fix to bug 710 - </li> - <li>Known problems: <a href="http://aspectj.org/bugs/ajdoc"> - http://aspectj.org/bugs/ajdoc - </a></li> - </ul> - -<hr /> - -<h2><a name="1.0.5">1.0.5</a></h2> - - -<p>This release includes significant improvements to AspectJ Development -Environment (AJDE) support. The entire user interface has been revised and -streamlined. The AJDE features are more tightly integrated into JBuilder and -NetBeans/Forte support. JBuilder support now includes graphical configuration -file editing and an integrated AspectJ Browser tool. </p> - -<ul> - <li><a href="#1.0.5compiler">Compiler</a></li> - <li><a href="#1.0.5ajde">AJDE</a></li> - <li><a href="#1.0.5ajdoc">Ajdoc</a></li> - <li><a href="#1.0.5anttasks">Ant tasks</a></li> -</ul> - -<h3><a name="1.0.5compiler">Compiler</a></h3> - -<p> This was another compiler release primarily concerned with fixing -corner cases in the language implementation. Our handling of nested -classes, the assert statement, and cflow were the principal offenders -this time. Thanks to Nicholas Alex Leidenfrost and Patrick Chan for -their clear and concise bug reports on some of these issues. </p> - -<h3><a name="1.0.5ajde">AJDE</a></h3> - -<h4><span style="font-weight: 400">This release includes significant -improvements to AspectJ Development Environment (AJDE) support. All known bugs -have been fixed, and the core framework quality has been significantly increased -thanks to the adoption of a unit test suite. The following changes apply -to all of the AJDE NetBeans/Forte, JBuilder, and the AspectJ Browser support. -NetBeans/Forte and JBuilder-specific changes are listed below. </span></h4> - - -<ul> - <li><span style="font-weight: 400">The entire user interface has been revised - and streamlined.</span></li> - <li>The structure view and browser have a new UI, and offer both a file-based - and global structure views. All views expose node ordering, node - filtering, and association filtering functionality. The global views - expose a package tree as well as the global inheritance and crosscutting - structure. </li> - <li>Structure view navigation now has a history exposed by back/forward.</li> - <li>The is a new build configuration management UI.</li> - <li>The compiler preferences UI now includes access to all build options.</li> - <li>Error messages have been improved, and the structure views include - annotations of nodes with errors and warnings.</li> -</ul> - -<h4>AJDE for JBuilder</h4> - - -<p>Integration into the JBuilder IDE is more streamlined. In addition:</p> - - -<ul> - <li>The AspectJ Browser is included as a tool that replaces JBuilder's - "Project View" and can be used to navigate the global structure of your system - (including the crosscutting and inheritance structure).</li> - <li>Inline structure annotations in the editor's gutter can now expose all of - the structure presented in the structure view, and can be used to navigate in - a similar way. Note that there are preferences for toggling which of - these appear.</li> - <li>Building is better integrated and the JBuilder build toolbar is removed - when AJDE is enabled.</li> - <li>Build configurations can be selected from the build button's menu.</li> - <li>Execution is better integrated: instead of a separate "run" button - JBuilder's run and debug can be used. Note that for new projects you - will need to use the "AspectJ Runtime" library, which will be added to your - preferences automatically.</li> - <li>A new graphical build configuration editor can be used by double-clicking - ".lst" files that have been added to the project. </li> - <li>Error messages now match JBuilder's look-and-feel and behavior. - Seeking to column numbers now works in addition to line numbers.</li> -</ul> - - -<h4>AJDE for Forte/NetBeans</h4> - - -<p>Integration into the NetBeans IDE is more streamlined. In addition:</p> - - -<ul> - <li>NetBeans 3.3.2 and SunONE Studio 4 are supported.</li> - <li>Multiple filesystems are supported.</li> - <li>Default project build configurations (all project files) are now - supported.</li> - <li>Build configurations can be selected in the tool bar.</li> - <li>Regular NetBeans execution and debugging is supported. Note that you - have to add netbeans/lib/ext/aspectjrt.jar file to your project configuration.</li> - <li>Class files are generated beside source files (NetBeans/javac default). - There is currently no way to specify a target directory.</li> -</ul> - - -<h4>AJBrowser</h4> - - -<ul> - <li>The browser now supports main class execution. Set the main class in - the options dialog, and make sure that both the Java executable is on your - path, and the class that you expect to execute on your classpath.</li> - <li>The error messages UI has been improved.</li> -</ul> - - -<h3><a name="1.0.5ajdoc">Ajdoc</a></h3> -<p>Bug fixes: -</p> - <ul> - <li><a href="http://aspectj.org/bugs/resolved?id=710">710 - - compiler-generated constructor shown with class comment - </a></li> - <li><a href="http://aspectj.org/bugs/resolved?id=712">712 - - comments lost in aspect docs for methods - or constructors declared on other types. - </a></li> - <li><a href="http://aspectj.org/bugs/resolved?id=719">719 - - poor support for @link, @see tags - </a></li> - <li><a href="http://aspectj.org/bugs/resolved?id=742">742 - - crash with @see tag - </a></li> - <li><a href="http://aspectj.org/bugs/resolved?id=751">751 - - error loading doclet resource - </a></li> - </ul> - -<h3><a name="1.0.5anttasks">Ant tasks</a></h3> -<p>Bug fixes: -</p> - <ul> - <li><a href="http://aspectj.org/bugs/resolved?id=730">730 - - document all supported ajc flags <a></li> - </ul> - -<hr /> - -<h2><a name="1.0.4">1.0.4</a></h2> - -<ul> - <li><a href="#1.0.4compiler">Compiler</a></li> - <li><a href="#1.0.4ajde">AJDE</a></li> - <li><a href="#1.0.4ajdoc">Ajdoc</a></li> - <li><a href="#1.0.4taskdefs">Ant taskdefs</a></li> - <li><a href="#1.0.4doc">Documentation</a></li> -</ul> - -<h3><a name="1.0.4compiler">Compiler</a></h3> -<ul> - <li>Over a dozen people independently reported a bug in error - handling for the wrong number number of arguments to - <code>proceed</code>. This has been turned into a nice error - message. A number of other bug reports related to around advice and - proceed have also been fixed, including the ability to change the - bindings for <code>this</code> and <code>target</code> using proceed - in around advice. - </li> - <li>David Walend gets the <em>black thumb</em> award for the most - bug reports submitted by a new user. His bug report on the - behavior of after returning advice led to some valuable clarifications - of this part of the language spec. - </li> - <li>A number of places where ajc didn't fully comply with the Java - Language Spec have been fixed in this release. Thanks to Neal - Gafter for reporting many of these. - </li> -</ul> - -<h4>Incompatible changes</h4> - -<p>Two potentially surprising incompatible changes have been made to -ajc in order to bring the compiler into compliance with the 1.0 -language design. These changes will be signalled by clear warning or -error messages at compile-time and will not cause any run-time -surprises. We expect most users to never notice these changes.</p> - -<ul> - <li>The obsolete class - <code>org.aspectj.lang.MultipleAspectsBoundException</code> has been - removed from aspectjrt.jar. This class had not been used since - AspectJ-0.8 and should have been removed prior to the 1.0 release. - It is not documented as part of the 1.0 language spec. This change - will cause a compile-time type not found error in any code that - refers to this exception.</code> - - <li>The compiler was not correctly implementing the AspectJ-1.0 - language design for some uses of after returning advice. This - compiler behavior was fixed, and advice whose behavior might be - changed by this bug fix will be highlighted with a compiler - warning. More information about some of these changes can be found - in the <a href="porting.html#pre-1.0.4">porting notes</a>.</li> -</ul> - -<h3><a name="1.0.4ajde">AJDE</a></h3> - - -<p>This is the first release of AJDE support with significant external -contribution. A big thanks goes out to Phil Sager for porting the AJDE for -Forte/NetBeans support to NetBeans 3.3.1 and improving the integration into -NetBeans.</p> - - -<h4>AJDE for JBuilder</h4> - -<ul> - <li>Updates<ul> - <li>This is a bug fix release only. </li> - </ul> - </li> -</ul> - -<h4>AJDE for Forte/NetBeans</h4> - -<ul> - <li>Updates<ul> - <li>NetBeans 3.3.1 is now supported in addition to NetBeans 3.2 and Forte CE - 3.</li> - <li>Native NetBeans main class execution can now be used. After doing - a "Compile with AJC" browse to the main class in the "Filesystems" Explorer, - right-click the class and select "Execute". </li> - <li>The debugger can now be used if the project main class is set ("Project" - menu -> "Set Project Main Class...").</li> - <li>Numerous bugs have been fixed.</li> - </ul> - </li> - <li>Known limitations<ul> - <li>Breakpoint setting does not work in the debugger.</li> - <li>In the "Filesystems" Explorer red Xs appear on files with AspectJ source - code. The "AspectJ" Explorer understands the structure of AspectJ - projects and should be used for navigating structure instead.</li> - </ul> - </li> -</ul> - -<h4>AJDE for Emacs</h4> - - -<ul> - <li>This is a bug fix release only.</li> -</ul> - - -<h3><a name="1.0.4ajdoc">Ajdoc</a></h3> -<p>Ajdoc now runs under J2SE 1.4, but still requires the tools.jar - from J2SE 1.3 be on the classpath. -</p> - -<h3><a name="1.0.4taskdefs">Ant tasks</a></h3> -<ul> - <li>Repackaged to fit into the AspectJ product directory - e.g., - <code>aspectj-ant.jar</code> moved to <code>lib</code> - as expected by <code>examples/build.xml</code>. - </li> - <li>Fixed bugs, esp. <a href="http://aspectj.org/bugs/resolved?id=682">682</a>: - Throw BuildException if failonerror and ajdoc detects misconfiguration. - </li> -</ul> -<h3><a name="1.0.4doc">Documentation</a></h3> -<p>Added a 1-page quick reference guide. Improved javadoc documentation for - the org.aspectj.lang package. -</p> - - -<hr/> - -<h2><a name="1.0.3">1.0.3</a></h2> - -<ul> - <li><a href="#1.0.3compiler">Compiler</a></li> - <li><a href="#1.0.3taskdefs">Ant taskdefs</a></li> -</ul> - -<h3><a name="1.0.3compiler">Compiler</a></h3> -<p> This release fixes a single significant bug in 1.0.2 where ajc -could generate unreachable code in <code>-usejavac</code> or -<code>-preprocess</code> mode. This would happen when around advice -was placed on void methods whose body consisted solely of a -<code>while (true) {}</code> loop. We now properly handle the -flow-analysis for this case and generate code that is acceptable to -javac. Thanks to Rich Price for reporting this bug. -</p> - -<h3><a name="1.0.3taskdefs">Ant taskdefs</a></h3> -<p>Added support to the Ajc taskdef for the -source 1.4 and -X options generally. -</p> - -<hr /> - -<h2><a name="1.0.2">1.0.2</a></h2> - -<p> This release is mainly about keeping up with the Joneses. To keep -up with SUN's release candidate for J2SE1.4, we now officially support -the new 1.4 assertions and running on the 1.4 VM. In honor of the -public review of JSR-45 Debugging Support for Other Languages we -implement this spec for AspectJ. We support Borland's recent release -of JBuilder 6, and since some of our users are starting to work on Mac -OSX, AJDE now works nicely on this platform. We also fixed almost all of -the bugs you reported in 1.0.1. -</p> - -<ul> - <li><a href="#1.0.2compiler">Compiler</a></li> - <li><a href="#1.0.2ajde">AJDE</a></li> - <li><a href="#1.0.2ajdb">AJDB</a></li> -</ul> - -<h3><a name="1.0.2compiler">Compiler</a></h3> - -<ul> - <li>Official support for <code>-source 1.4</code> option to compile new - <a href="http://java.sun.com/j2se/1.4/docs/guide/lang/assert.html">1.4 assertions</a>. - This makes ajc completely compatible with j2se-1.4. - </li> - <li>Implementation of <a href="http://jcp.org/jsr/detail/45.jsp"> - JSR-45 Debugging Support for Other Languages</a> so that debuggers which - correctly implement this specification will be able to accurately debug - any AspectJ program at a source code level. We are not currently - aware of any debuggers that implement this so far, but expect that - as j2se-1.4 becomes widely available this will change. - </li> - <li>As proposed by Arno Schmidmeier and seconded by Nick Lesiecki, we now have an - experimental <code>-Xlint</code> option that will provide warnings when - type patterns used in pcds have no bindings. We are very interested in - feedback on the usefulness and suggested improvements for this feature. - </li> - <li>Several significant bugs in the implementation of around advice have been fixed. - These include issues with <a href="http://aspectj.org/jitterbug/aspectj-bugs/resolved?id=632"> - dynamic tests</a>, with - <a href="http://aspectj.org/jitterbug/aspectj-bugs/resolved?id=620"> - complicated local types in an around body</a>, and with - <a href="http://aspectj.org/jitterbug/aspectj-bugs/resolved?id=636"> - capturing proceed in a closure</a>. - </li> - <li>All but two (<a href="http://aspectj.org/jitterbug/aspectj-bugs/compiler?id=626">1</a>, - <a href="http://aspectj.org/jitterbug/aspectj-bugs/compiler?id=645">2</a>) - verified bugs in 1.0.1 have been fixed. The two outstanding bugs - have relatively easy work-arounds. Thanks as usual to everyone who - submitted a bug report. - </li> - <li>We no longer use the <code>SYNTHETIC</code> attribute to label declarations - added by the aspectj compiler. We were using this attribute in compliance - with <a href="http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#80128"> - the JVM Specification</a>; however, we've found that many tools expect - this attribute to only be used for the narrow purpose of implementing - Java's inner classes and that using it for other synthetic members can confuse - them. This led to problems both - <a href="http://aspectj.org/jitterbug/aspectj-bugs/resolved?id=649">with javap</a> and - <a href="http://aspectj.org/jitterbug/aspectj-bugs/resolved?id=646">with javac</a>. - </li> - <li>Changes required adding runtime classes, so please compile and run using the latest - <code>aspectjrt.jar</code> - </li> - -</ul> - -<h3><a name="1.0.2ajde">AJDE</a></h3> - -<p align="left">This is a bug fix release only. </p> - -<ul> - <li> - -<p align="left">Thanks to Dave Yost and Matt Drance for submitting the AJDE -patches for Mac OSX (context popup menus and keyboard shortcuts did not work). </p> - - </li> - <li> - -<p align="left">Bugs in history navigation (back-forward buttons in the -structure view) have been fixed.</p> - - </li> - <li> - -<p align="left">"Declares" are now handled properly in the structure view.</p> - - </li> - <li> - -<p align="left">Other GUI and usability improvements have been made the AspectJ -Browser and core framework.</p> - - </li> -</ul> - -<h4>AJDE for JBuilder</h4> - - -<ul> - <li>Support has been extended to JBuilder 6, and support for Enterprise - version features has been improved.</li> - <li>Fixed bug causing inline source code annotations in the editor pane to not - be updated after a recompile.</li> - <li>Keyboard shortcuts were fixed to work with Mac OSX.</li> -</ul> - - -<h4>AJDE for Forte</h4> - - -<ul> - <li>Keyboard shortcuts were fixed to work with Mac OSX.</li> -</ul> - -<h4><a name="1.0.2ajdb">AJDB</a></h4> - -<p> Some minor bug fixes, but this is still early-access software. - Please try using another JPDA-compliant debugger. If it uses - JDI correctly, then it should navigate to line numbers - when the classes are run under J2SE1.4, based on - the new JSR-45 debugging support described above. - We would appreciate any reports of success or failure. -</p> - -<hr /> - -<h2><a name="1.0.1">1.0.1</a></h2> - -<ul> - <li><a href="#1.0.1compiler">Compiler</a></li> - <li><a href="#1.0.1ajde">AJDE</a></li> - <li><a href="#1.0.1ajdb">AJDB</a></li> -</ul> - -<h3><a name="1.0.1compiler">Compiler</a></h3> - -<p> This release fixes a significant performance issue in the -compiler, reported by Rich Price, that could lead to extremely long -compiles in systems with many aspects and classes. Several other -small bugs related to reporting compilation errors have also been -fixed, see <a -href=http://aspectj.org/jitterbug/aspectj-bugs/resolved?id=610>this -bug report</a> for an example. -</p> - -<p> A new experimental flag has been added, -<code>-XaddSafePrefix</code>, that will cause the prefix -<code>aspectj$</code> to be inserted in front of all methods generated -by ajc. This mode should be helpful when using aspectj with tools -that do reflection based on method names, such as EJB tools. Thanks -to Vincent Massol for pointing out the importance of this. It is -expected that this prefix will either become the default compiler -behavior in the future or a non-experimental flag will replace it. -</p> - - -<h3><a name="1.0.1ajde">AJDE</a></h3> - -<p align="left">Minor bug fixes, including: AJDE for JBuilder failed to preserve -application parameters from project settings when executing the application.</p> - -<p align="left">Source builds were cleaned up for JBuilder and Forte sources.</p> - -<h3><a name="1.0.1ajdb">AJDB</a></h3> - -<p>Two bugs were reported and have been fixed in this release. - (Note that ajdb is still considered early-access software.)</p> - -<ul> - <li>bug 611: NullPointerException dumping non-primitive values</li> - <li>bug 617: -X and -D options not passed to debug VM correctly</li> -</ul> - -<h2><a name="1.0.0">1.0.0</a></h2> - -<ul> - <li><a href="#1.0.0language">Language</a></li> - <li><a href="#1.0.0compiler">Compiler</a></li> - <li><a href="#1.0.0ajde">AJDE</a></li> - <li><a href="#1.0.0ajdoc">AJDoc</a></li> - <li><a href="#1.0.0taskdefs">Ant taskdefs</a></li> -</ul> - -<h2><a name="1.0.0language">Language</a></h2> - -<p>There were no language changes for this release.</p> - -<h2><a name="1.0.0compiler">Compiler</a></h2> - -<p>Several minor bugs primarily in error handling were reported and -have been fixed in this release. The two most serious bugs are -described below:</p> - -<ul> - <li>Niall Smart and Stephan Schmidt reported related bugs (variants - of which are also produced by other compilers) that caused verify - errors when dealing with nested try-finally and synchronized - statements. These are now fixed. More details are available - <a href="http://aspectj.org/jitterbug/aspectj-bugs/resolved?id=601"> - here</a> and - <a href="http://aspectj.org/jitterbug/aspectj-bugs/resolved?id=595"> - here</a> - </li> - - <li>Jan Hannemann submitted a <a - href="http://aspectj.org/jitterbug/aspectj-bugs/resolved?id=600"> - succint and clear bug report</a> for a difficult intermittant bug. - The bug led to the compiler sometimes generating illegal code when - introduced methods on a class overrode introduced methods on an - interface implemented by that class. This is now fixed.</li> </ul> - -<h2><a name="1.0.0ajde">AJDE</a></h2> - -<p align="left">Numerous user interface refinements were made to the browser and -core AJDE functionality. Error handling and reporting has been improved. -All of the AJDE tools now support the ".aj" file extension.</p> - -<h4>AJDE for JBuilder</h4> - - -<ul> - <li>The AspectJ Browser now uses JBuilder's icons and distinguishes nodes by - visibility.</li> - <li>Project-setting VM parameters are now supported by the "AJDE Run" button.</li> -</ul> - - -<h4>AJDE for Forte</h4> - - -<ul> - <li>The AspectJ Browser now uses Forte's icons and distinguishes nodes by - visibility</li> -</ul> - - -<h4>AJBrowser</h4> - - -<ul> - <li>Documentation for the browser is now available at - <a href="http://aspectj.org/docs">http://aspectj.org/docs</a> </li> -</ul> - - -<h4>Emacs Support: aspectj-mode and AJDEE</h4> - -<ul> - <li>Improved updating of annotations during editing.</li> - <li>Pop-up jump menu now placed (with mouse pointer) near cursor.</li> - <li>[AJDEE only] Improved filtering of legal code completions.</li> -</ul> - -<h4><a name="1.0.0ajdoc">AJDoc</a></h4> - -<ul> - <li>Runs only in J2SE 1.3 - not 1.2 or 1.4. - You can document 1.x-reliant programs by using the options - to compile using 1.x libraries.</li> - <li>Disabled some non-functioning options, documented as - <code>unsupported</code> in the syntax message.</li> -</ul> - -<h4><a name="1.0.0taskdefs">Ant taskdefs</a></h4> -<ul> - <li>Fork is not supported in the AJDoc taskdef</li> -</ul> - -<h2><a name="1.0rc3">1.0rc3</a></h2> - -<h2><a name="1.0rc3language">Language</a></h2> - -<p>There have been several minor clarifications/changes to the -language.</p> - -<ul> - <li>Thanks to Robin Green for suggesting that we could relax the - rules for inheriting multiple concrete members in order to allow - those unambiguous cases where one member has already overridden the - other. <a href=http://aspectj.org/pipermail/users/2001/001289.html> - More details...</a></li> - - <li>Ron Bodkin encouraged us to examine the details of privileged - aspects more closely. This led to several small improvements and - clarifications to this language feature. - <a href=http://aspectj.org/pipermail/users/2001/001258.html> More - details...</a></li> -</ul> - -<h2><a name="1.0rc3compiler">Compiler</a></h2> - -<p>This release saw several changes to the compiler in order to -work-around known bugs in different JVMs, or to otherwise mimic the -behavior of javac rather than necessarily following the Java Language -Specification.</p> - -<ul> - <li>Hanson Char reported a bug where ajc's correctly generated - bytecodes for some references to interface fields result in verify - errors on certain JVMs. While this is a known bug in those JVMs, - we've modified ajc to be bug compatible with all the other Java - compilers out there to work-around this JVM bug. - <a href=http://aspectj.org/jitterbug/aspectj-bugs/resolved?id=551> - More details...</a></li> - - <li>Frank Hunleth discovered a similar bug where ajc's correct - bytecodes could lead to essentially random method dispath due to a - bad bug in the 1.3.0 JVM from Sun. Even though this bug was fixed - in the 1.3.1 and 1.2.2 JVMs, we have introduced the appropriate - work-around in ajc's code generation. <a - href=http://aspectj.org/jitterbug/aspectj-bugs/resolved?id=580>More - details...</a></li> - - <li>Thomas Haug (as well as several other members of his group) - reported a problem with name binding where ajc was behaving - differently than javac. This problem was resolved to come from a - class created by an obfuscator that conflicted with his package - names. The JLS doesn't clearly specify which of these two behaviors - is correct. Nevertheless, ajc has been changed to treat packages - more like javac does in order to minimize this sort of problem in - the future. <a - href=http://aspectj.org/jitterbug/aspectj-bugs/resolved?id=574> More - details...</a></li> - - <li>Several "real" bugs in ajc were also reported and fixed. Toby - Allsopp gets credit for reporting two of them. The most interesting - of these bugs to me was his report that we just didn't support - qualified anonymous inner constructors. This is a part of the Java - language that ajc has never supported over its almost 3 year - history. We'd just noticed this ourselves when running the jacks - compiler test suite from the jikes group, and had added the feature - days before getting our first bug report for it not being - there.</li> -</ul> - -<h2><a name="1.0rc3ajde">AJDE</a></h2> - -<ul> - <li>The structure view has been improved. </li> - <li>Multiple user-configurable views are supported.</li> - <li>Structure tree filtering and ordering has been added. </li> - <li>A split tree mode has been added to permit the navigation of multiple - views on the same structure. </li> - <li>The view can also be toggled between a file-based and a system-based mode - which determines whether the root of the structure tree is the current file or - the project root. </li> - <li>The signatures of tree nodes have been improved and several new node - associations are now navigable. </li> - <li>A depth slider for controlling tree-expansion has been added.</li> -</ul> - -<h4>AJDE for JBuilder</h4> - - -<ul> - <li>Changes:</li> - <li>Inline annotations support have been improved and made consistent with the - structure tree (annotations only show up for intra-declaration structure).</li> - <li>The current structure view persists across IDE launches.</li> - <li>An enabled AJDE no longer slows down JBuilder shutdown.</li> -</ul> - - -<h4>AJDE for Forte</h4> - - -<ul> - <li>Execution remembers main class.</li> - <li>The bug causing an error during a "Mode" and "Explorer" switch has been - fixed.</li> -</ul> - - -<h4>AJBrowser</h4> - - -<ul> - <li>AJBrowser is currently an undocumented demonstration application. To use - it type: ajbrowser <lst file1> <lst file2> ...</li> - <li>Multiple source locations can be shown by selecting multiple nodes and - right-clicking to select the "Display Sources" command.</li> -</ul> - - -<h4>Emacs Support: aspectj-mode and AJDEE</h4> - -<ul> - <li>Numerous jump-menu improvements, including operation of pop-ups.</li> - <li>For AJDEE, compatibility with JDEE 2.2.9beta4. Also, fixes in completion, - ajdoc launch, and speedbar.</li> -</ul> - -<h3><a name="1.0rc3ajdoc">AJDoc</a></h3> - -<p>Some of the more obvious NullPointerException bugs in Ajdoc were fixed, but -Ajdoc does not implement all the functionality of Javadoc and has some bugs:</p> -<ul> - <li>Split indexes do not work correctly</li> - <li>Inner classes are not listed in indexes </li> - <li>Synthetic methods are documented</li> - <li>There is no package frame even when packages are specified on the command line</li> - <li>-group option is not implemented</li> - <li>-use targets are not all calculated correctly</li> - <li>Exception information may not be printed for the @throws tag</li> - <li>Verbose output should go to stderr, not stdout</li> - <li>Extra links are generated (should be unlinked text) </li> -</ul> -<p>Further, Ajdoc has not been testing on variants of the J2SE (it uses javadoc classes). - -<h3><a name="1.0rc3taskdefs">Ant taskdefs</a></h3> -<p>The Ajc taskdef was updated to support the new compiler options and the .aj extension, -and some NullPointerException bugs were fixed (thanks to Vincent Massol for a bug -report listing the line number of the fix). The AJDoc cannot be run repeatedly -in a single Ant run, and has trouble loading the doclet unless the libraries -are installed in ${ant.home}/lib. -<p> -<hr /> -<h2><a name="1.0rc2">1.0rc2</a></h2> - - <ul> - <li><a href="#1.0rc2language">Language</a></li> - <li><a href="#1.0rc2compiler">Compiler</a></li> - <li><a href="#1.0rc2ajde">AJDE</a></li> - </ul> - -<h2><a name="1.0rc2language">Language</a></h2> - -<p>There are no language changes in this release. This is a bug fix release -only.</p> - -<h2><a name="1.0rc2compiler">Compiler</a></h2> - -<p>A bug in handling inner type names that conflict with enclosing -type names was fixed. Many error messages were improved.</p> - -<h2><a name="1.0rc2ajde">AJDE</a></h2> - -<ul> - <li>This is a bug fix release only.</li> -</ul> - -<h4>AJDE for JBuilder</h4> - -<ul> - <li>Changes:<ul> - <li>Fixed bug causing the output path to be ignored and .class files to be - generated into the JBuilder install's "bin" directory.</li> - <li>Fixed bugs in Browser listener causing NullPointerExceptions to be thrown - if no node editor was present.</li> - <li>Fixed bug permitting "-bcg" option to be passed to the compiler.</li> - <li>Fixed bug preventing ajc from compiling all of the project source files - when automatic package discovery was on (JBuilder Proffessional and Enterprise - editions).</li> - <li>If the "-preprocess" flag is used resulting source files will be placed in - the project's "Working directory".</li> -</ul> - - </li> - <li>Limitations:<ul> - <li>"Automatic package discovery" mode is not supported in this release.</li> - <li>The debugger has not seen much use and it's stability and performance is - limited.</li> - </ul> - </li> -</ul> - -<h4>AJDE for Forte</h4> - -<ul> - <li>Changes:<ul> - <li>Moved the "AspectJ" menu into the "Tools" menu in order to make it less - intrusive.</li> - <li>Added a "ctrl-alt-shift-F9" keyboard compile shortcut.</li> -</ul> - - </li> - <li>Limitations:<ul> - <li>Known bug: "Mode" switching is not supported in this version--you must - do all of your AspectJ work in the "Editing" mode. If you switch modes the - IDE has to be restarted for the AspectJ window to show again. Switching to a - different tab in the ProjectExplorer has the same effect.</li> - <li>The debugger has not seen much use and it's stability and performance is - limited.</li> - </ul> - </li> -</ul> - -<h4>AJBrowser</h4> - -<ul> - <li>Changes:<ul> - <li>...</li> -</ul> - - </li> - <li>Limitations:<ul> - <li>AJBrowser is currently an undocumented demonstration application. To use - it type:<br> - > ajbrowser <lst file1> <lst file2> ...</li> -</ul> - - </li> -</ul> - -<h4>Emacs Support: aspectj-mode and AJDEE</h4> - -<p align="left"> This release now properly displays annotations for call sites and - introductions. Robustness has been improved in several dimensions, - including performance at startup. The compile menu now recomputes - properly when changing directories.</p> - -<hr /> - -<h2><a name="1.0rc1">1.0rc1</a></h2> - - <ul> - <li><a href="#1.0rc1language">Language</a></li> - <li><a href="#1.0rc1compiler">Compiler</a></li> - <li><a href="#1.0rc1ajde">AJDE</a></li> - </ul> - -<h2><a name="1.0rc1language">Language</a></h2> - -<p>Some of the details of the specification for perthis and pertarget -have changed. These changes make these language constructs -implementable on current JVMs without memory leaks (this wasn't true -of the previous version). Most people will probably not notice these -changes, but the correct semantics are described in -<a href="progguide/semantics.html">the semantics section of the programming -guide</a>. -</p> - -<p>In a related change, aspects are not allowed to implement either -the <code>java.io.Serializable</code> or the -<code>java.lang.Cloneable</code> interface. It is unclear what the -correct behavior of a system should be when an aspect is serialized or -cloned, and rather than make an arbitrary choice right now we've -chosen to leave the most room to design them right in a future -release.</p> - -<h2><a name="1.0rc1compiler">Compiler</a></h2> - -<p>ajc now directly generates .class files without using javac as a -back-end. This should result in improved compiler performance, better -error messages and better stack-traces and debugging info in those -.class files. -preprocess mode is still available for those who want -to generate legal Java source code and a new -usejavac mode is -available if you have a requirement to continue to use javac as a -back-end.</p> - -<p>ajc now officially supports source files with the .aj extension. -We plan to extend this support to the rest of our tools as time -permits. -</p> - -<p>This release of ajc includes support for the "-source 1.4" option -that enables the new 'assert' keyword in jdk1.4. This option only -works correctly when compiling against the jdk1.4 libraries. In -addition, this release of ajc will run under SUN's jdk1.4beta2. -However, we still strongly recommend that most users use the non-beta -jdk1.3.</p> - -<h2><a name="1.0rc1ajde">AJDE</a></h2> - -<ul> - <li>The structure view can now be configured (using the "Options" dialog) to - display different kinds of associations between program elements that appear - in the tree.</li> - <li>Structure view history navigation has been added. </li> - <li>When navigating links the structure view will stay synchronized with the - editor.</li> -</ul> - -<h4>AJDE for JBuilder</h4> - -<ul> - <li>Changes:<ul> - <li>Inline structural navigation annotations appear in the gutter of the - editor and can be used to navigate associations such as advice and - introduction.</li> -</ul> - - </li> - <li>Limitations:<ul> - <li>"Automatic package discovery" mode is not supported in this release.</li> - <li>The debugger has not seen much use and it's stability and performance is - limited.</li> - </ul> - </li> -</ul> - -<h4>AJDE for Forte</h4> - -<ul> - <li>Changes:<ul> - <li>Support for Forte 3 and Netbeans 3.2 has been added.</li> - <li>The module is now installed by default on the first use without having to - go to the IDE options to enable it.</li> -</ul> - - </li> - <li>Limitations:<ul> - <li>Known bug: "Mode" switching is not supported in this version--you must - do all of your AspectJ work in the "Editing" mode. If you switch modes the - IDE has to be restarted for the AspectJ window to show again. Switching to a - different tab in the ProjectExplorer has the same effect.</li> - <li>The debugger has not seen much use and it's stability and performance is - limited.</li> - </ul> - </li> -</ul> - -<h4>AJBrowser</h4> - -<ul> - <li>Changes:<ul> - <li>Build configuration file editor added.</li> -</ul> - - </li> - <li>Limitations:<ul> - <li>AJBrowser is currently an undocumented demonstration application. To use - it type:<br> - > ajbrowser <lst file1> <lst file2> ...</li> -</ul> - - </li> -</ul> - -<h4>Aspectj-mode and AJDEE: AspectJ support in Emacs</h4> - -<p align="left">This release of AspectJ support for Emacs includes corrections to the -documentation and the appearance of annotations and jumps in the editing -view. Also, advice are now shown on non-declarations, when appropriate, -such as call advice. The internal event model has been revised to reduce -computational overhead. </p> - -<hr /> - -<h2><a name="1.0beta1">1.0beta1</a></h2> - -<ul> - <li><a href="#1.0beta1language">Language</a></li> - <li><a href="#1.0beta1compiler">Compiler</a></li> - <li><a href="#1.0beta1ajbrowser">AJBrowser</a></li> - <li><a href="#1.0beta1ajde">AJDE</a></li> -</ul> - -<h2><a name="1.0beta1language">Language</a></h2> - -<p>There is one language change since 1.0alpha1. The static modifier is -no longer needed or allowed on pointcut declarations. Name binding -for pointcut declarations works like class methods now. Thanks to -Robin Green for encouraging us to look at this one last time.</p> - -<p>The current implementation of perthis/pertarget has the possibility of -memory leaks (thanks to Arno Schmidmeier for pointing this out). The -design of this part of the language will almost certainly see some -changes in the next release to address issues of implementability on -the JVM as well as related issues.</p> - -<h2><a name="1.0beta1compiler">Compiler</a></h2> - -<p>The ajc compiler should now catch all errors in source code and you -should no longer see errors coming from files in 'ajworkingdir'. -Please report any errors in 'ajworkingdir' as bugs.</p> - -<p>All reported bugs in 1.0alpha1 have been fixed. Thanks to everyone -for your bug reports. Most notably, the 'if' pcd that was added in -1.0alpha1 should work correctly in this release. Thanks to Morgan -Deters for a very thorough bug report on this broken feature days -after the 1.0alpha1 release.</p> - -<h2><a name="1.0beta1ajbrowser">AJBrowser</a></h2> - -<ul> - <li>Support for executing classes has been added.</li> - <li>.lst can now be passed as arguments on the command line.</li> - <li>Compiler options can be set.</li> - <li>Know limitations:<ul> - <li>In order to execute classes they must be available on the classpath that - the browser is launched with.</li> - </ul> - </li> -</ul> - -<h2><a name="1.0beta1ajde">AJDE</a></h2> - -<ul> - <li>The performance and UI of the structure tree has been improved.</li> - <li>Compilation now runs in a separate thread and a progress monitor is - updated during the compile.</li> - <li>The structure view now persists across IDE launches.</li> - <li>Limitations:<ul> - <li>If an error occurs in the javac pass it will not display properly in the - error messages pane. To view the error you have check the output of the - console that the IDE was launched from. No more errors should be passed - to javac, so please report this behavior and the corresponding error message - as a bug.</li> -</ul> - - </li> -</ul> - -<h4>AJDE for JBuilder</h4> - -<ul> - <li>Known bugs have been fixed.</li> - <li>Classpath separator character is no longer hardcoded.</li> - <li>Keyboard shortcuts for compilation (ctrl-F11) and execution (ctrl-F12) - have been added.</li> - <li>Limitations:<ul> - <li>The debugger has not seen much use and it's stability and performance is - limited.</li> - </ul> - </li> -</ul> - -<h4>AJDE for Forte</h4> - -<ul> - <li>Known bugs have been fixed.</li> - <li>Limitations:<ul> - <li>"Mode" switching is not supported in this version--you must do all of your - AspectJ work in the "Editing" mode. If you switch modes the IDE has to - be restarted for the AspectJ window to show again.</li> - <li>There are no keyboard compile/execute shortcuts.</li> - <li>The debugger has not seen much use and it's stability and performance is - limited.</li> - </ul> - </li> -</ul> - -<h4>Aspectj-mode and AJDEE: AspectJ support in Emacs</h4> - -<p> AspectJ Development Environment for Emacs has been split into two pieces, -aspectj-mode (an extension of java-mode), and AJDEE (an extension of JDE). -Additionally, a switch, -emacssym, has been added to ajc that generates -AspectJ declarations information directly, thus beanshell is no longer -required for use of these modes. -</p> - -<hr /> - -<h2><a name="1.0alpha1">1.0alpha1</a></h2> - -<p> This is the first alpha release of the 1.0 language and tools. -There have been many changes in the language, and many improvements to -the tools. We wish to thank our users for putting up with the high -volatility of AspectJ in the push to 1.0. </p> - - <ul> - <li><a href="#1.0alpha1language">Language</a></li> - <li><a href="#1.0alpha1compiler">Compiler</a></li> - <li><a href="#1.0alpha1documentation">Documentation</a></li> - <li><a href="#1.0alpha1ajdoc">AJDoc</a></li> - <li><a href="#1.0alpha1ant">Ant</a></li> - <li><a href="#1.0alpha1ajbrowser">AJBrowser</a></li> - <li><a href="#1.0alpha1ajde">AJDE</a></li> - </ul> - -<h3><a name="1.0alpha1language">Language</a></h3> - -<p> There have been many changes to make the 1.0 language both simpler -and more powerful. User feedback has driven most of these design -changes. Each email we've received either making a suggestion or just -asking a question about a confusing part of the language has played a -part in shaping this design. We'd like to thank all of our users for -their contributions. - -<p>While we don't have room to thank all of our users by name, we'd -like to specifically mention a few people for their high-quality -sustained contributions to the users@aspectj.org mailing list as well -as through their feature requests and bug reports. Robin Green -(who'll be very happy to see <code>declare error</code>), Stefan -Hanenberg (who should appreciate the '+' wildcard in type patterns), -and Rich Price (who suggested final pointcuts, more flexible -dominates, and many other improvements).<p> - -<p> Note that entries into the <a href="porting.html">porting -notes</a> for this release are linked from the various language -changes. </p> - -<h4>Pointcuts</h4> - -<p> Perhaps the least interesting -- but most pervasive -- change is -that the names of the single-kinded pointcut designators (the ones -that pick out only one kind of join point) </p> - -<blockquote>calls executions gets sets handlers initializations -staticinitializations</blockquote> - -<p> have been -<a href="porting.html#1.0a1-plural-to-singular">changed</a> to be -singular rather than plural nouns </p> - -<blockquote>call execution get set handler initialization -staticinitialization</blockquote> - -<p> Although a side benefit is that the names are one character -shorter, the real benefit is that their combination with the -<CODE>&&</CODE> and <code>||</code> operators now reads much -more naturally. No longer does "and" mean "or" and "or" mean "and". -</p> - -<p> You'll notice that <code>receptions</code> doesn't appear on the -table as being shortened to <code>reception</code>. That's because -call and reception join points have been merged, and the -<code>receptions</code> pointcut declaration has been -<a href="porting.html#1.0a1-remove-receptions">eliminated</a>. Now, -<code>call</code> join points describe the action of making a call, -including both the caller and callee. Eliminating reception join -points makes AspectJ much simpler to understand (reception join points -were a commonly misunderstood feature) without giving up expressive -power.</p> - -<p> We have <a href="porting.html#1.0a1-fixing-state-access">changed -the mechanism for accessing state</a> at join points, which has the -benefit of making our treatment of signatures -<a href="porting.html#1.0a1-no-subs-in-sigs">cleaner</a> and easier to -read. As a part of this, the <code>instanceof</code> pointcut -designator has now been -<a href="porting.html#1.0a1-fixing-instanceof">split into two -different pointcut designators</a>, <code>this</code> and -<code>target</code>, corresponding to a join point's currently -executing object and target object, respectively. </p> - -<p> The new <code>args</code> pointcut adds expressive power to the -language by allowing you to capture join points based on the actual -type of an argument, rather than the declared type of its formal. So -even though the <code>HashSet.removeAll</code> method takes a -<code>Collection</code> as an argument, you can write advice that only -runs when it is actually passed a <code>HashSet</code> object. </p> - -<p> AspectJ's notion of object construction and initialization, a -complicated process in Java, has been clarified. This affects some -uses of the -<a href="porting.html#1.0a1-initializations">initializations -pointcut</a> and -<a href="porting.html#1.0a1-constructor-calls">constructor calls</a> -pointcut. </p> - -<p> The little-used pointcuts -<a href="porting.html#1.0a1-hasaspect"><code>hasaspect</code></a> and -<a href="porting.html#1.0a1-withinall"><code>withinall</code></a> have -been removed. </p> - -<p> The <code>returns</code> keyword is -<a href="porting.html#1.0a1-user-defined-returns">no longer -necessary</a> for user-defined pointcuts. </p> - -<p> Pointcuts may now be declared <code>static</code>, and -<a href="porting.html#1.0a1-static-pointcuts">only static -pointcuts</a> may be declared in classes and referred to with -qualified references (such as <code>MyAspect.move()</code>). </p> - -<p> Non-abstract pointcuts may now be declared <code>final</code>. -</p> - -<p> We have finally added an extremely general pointcut, -<code>if(<var>BooleanExpression</var>)</code>, that picks out -join points programatically. </p> - - -<h4>Type patterns</h4> - -<p> Our treatment of -<a href="porting.html#1.0a1-new-wildcards">* and ..</a> in type -patterns is cleaner. </p> - -<p> Type patterns now have the ability to include array types, and -there is a new wildcard, +, to pick out all subtypes of a given type. -Previously, the subtypes operator was only allowed in introduction, -and was <a href="porting.html#1.0a1-subtypes-to-plus">spelled -differently</a>. </p> - -<h4>Advice</h4> - -<p> Around advice is treated much more like a method, with a -<a href="porting.html#1.0a1-around-returns">return value</a> and an -optional <a href="porting.html#1.0a1-around-throws">throws clause</a>. -</p> - -<p> The advice precedence rules have been -<a href="porting.html#1.0a1-advice-precedence">changed</a>. Now, for -example, a piece of after advice that appears lexically later than -another piece of after advice will run later, as well. Previously, -the relationship was the other way around, which caused no small -amount of confusion. </p> - -<p> After returning advice has lost a -<a href="porting.html#1.0a1-after-returning">useless set of -parentheses</a> when not using the return value. </p> - -<p> The <code>thisStaticJoinPoint</code> reflective object has been -<a href="porting.html#1.0a1-this-static-join-point">renamed</a>, and -the <code>thisJoinPoint</code> object hierarchy has been -<a href="porting.html#1.0a1-this-join-point">simplified</a>. </p> - -<h4>Introduction and static crosscutting</h4> - -<p> On the static side of the language, introduction hasn't changed, -but there is now a new keyword, <code>declare</code>, that is used to -declare various statically-crosscutting properties. One of these -properties is subtyping, so we've -<a href="porting.html#1.0a1-plus-implements-extends">gotten rid of</a> -the ugly keywords <code>+implements</code> and -<code>+extends</code>. </p> - -<p> We have provided two new forms, <code>declare error</code> and -<code>declare warning</code>, for the often-asked-for property of -compile-time error detection based on crosscutting properties. </p> - -<p> AspectJ's interaction with checked exceptions is now firmly on the -side of static crosscutting, since Java treats such exceptions at -compile-time. A new form, <code>declare soft</code>, can be used to -"soften" checked exceptions into an unchecked form. This may affect -some uses of <a href="porting.html#1.0a1-now-use-soft">around -advice</a> that previously mucked with the exception checking -system.</p> - -<h4>Aspects</h4> - -<p> The "of each" modifiers have been -<a href="porting.html#1.0a1-aspects">renamed</a>. Apart from the -spelling, the main interesting difference is the splitting up of -<code>of eachobject</code> into two different modifiers, parallel with -the split of <code>instanceof</code> into <code>this</code> and -<code>target</code>. </p> - -<p> The <code>dominates</code> keyword now takes a type pattern, -rather than a type. This allows an aspect A, for example, to declare -that its advice should dominate the advice of another aspect B as well -as its subtypes, with the new + subtypes operator: <code>aspect A -dominates B+</code>. -</p> - -<h3><a name="1.0alpha1compiler">Compiler</a></h3> - -<p> The most important change in the compiler is that it supports the -new language. In addition, all reported bugs in the last release have -been fixed. Thanks for your bug reports.</p> - -<p>The compiler also gets a new <code>-encoding</code> flag in this -release for handling source files that are not in standard US-ASCII -format. Thanks to Nakamura Tadashi for both suggesting this feature -and for submitting a nice patch to implement it. - -<h4>Known Limitations</h4> - -<p> The previous compiler's limitations regarding join points that -occurred in anonymous classes have all been eliminated. -Unfortunately, eliminating this restriction has resulted in -preprocessed source code that is less readable than in previous -releases. More care will be taken in the next release to mitigate -this effect. </p> - -<p> Many semantic errors are not caught by ajc but fall through to -javac. Moreover, some errors regarding the initialization of final -fields might never show up when using ajc. This will be fixed -shortly. </p> - - -<h3><a name="1.0alpha1documentation">Documentation</a></h3> - -<p> Although we spent much of our time this release cycle updating the -documentation to the new language rather than improving its content, -we did make some structural improvements. The old <cite>Primer</cite> has been -split into a <cite>Programming Guide</cite>, covering the language, and a -<cite>Development Environment Guide</cite>, covering the develompent tools. In -addition, printable versions of both guides (in PDF) are finally -included in the documentation package. </p> - -<h3><a NAME="1.0alpha1ajdoc">Ajdoc</a></h3> - -<p> Ajdoc was rewritten to conform with the language changes and provide support -for other AspectJ/Java compilers. Our doclet is used by default creating -AspectJ-specific documentation, or Sun's standard doclet can be used by -passing the '-standard' flag to Ajdoc to produce regular Javadoc documentation -(excluding AspectJ-specifics). -</p> - -<h3><a NAME="1.0alpha1ant">Ant</a></h3> - -<p> An Ajdoc task is now available. The Ajc ant task was improved to -be completely back-compatible with the Javac task.</p> - -<h3><a NAME="1.0alpha1ajbrowser">AJBrowser</a></h3> - -<p> The "AspectJ Browser" is a new standalone source code browsing application. -It will let you compile ".lst" files, view the structure for those files and -navigate the corresponding source code.</p> - -<h3><a name="1.0alpha1ajde">AJDE</a></h3> - -<h4>AJDE for JBuilder</h4> - -<h5>Installation</h5> -<ul> - <li>Use the installer to place the "ajdeForJBuilder.jar" and "aspectjrt.jar" - in to JBuilder's lib/ext directory.</li> -</ul> - -<h5>Key Improvements</h5> - -<ul> - <li>The "AspectJ Structure View" replaces JBuilder's structure view instead of - being launched in a separate window.</li> - <li>AJDE can be toggled on/off with the "AJ" button--when it is turned off all - of the menus, resources, and event listeners that it uses will be removed.</li> - <li>Projects no longer require the manual adding of the "aspectjrt.jar" - libarary.</li> -</ul> - -<h5>Known Bugs & Limitations</h5> - -<ul> - <li>There is no compiler progress dialog--the way to tell if the compile is - finished is to watch the "status" area of the main window.</li> - <li>There are no keyboard compile/execute shortcuts.</li> - <li>The structure view is not persistent between IDE launches--you must - compile to view the structure for a program.</li> - <li>The debugger has not seen much use and it's stability and performance is - limited.</li> - <li>There is no ajdoc tool support.</li> - <li>Linux testing has been very limited.</li> -</ul> - - -<h4>AJDE for Forte</h4> - - -<h5>Installation</h5> - -<ul> - <li>Use the installer to place the "ajdeForForte.jar" in Forte's - modules directory and "aspectjrt.jar" - in to Forte's lib/ext directory.</li> - <li> - In the "Tools" menu select "Global Options"</li> - <li> - Right-click the "Modules" item and select "New Module from - File..."</li> - <li> - Find the ajdeForForte.jar in the directory that you installed into (e.g. - c:\forte4j\modules) and - select it.</li> -</ul> - -<h5>Key Improvements</h5> - -<ul> - <li>AJDE can be toggled on/off with the "AJ" button--when it is turned off all - of the menus, resources, and event listeners that it uses will be removed.</li> - <li>The AJDE functionality is now contained within it's own toolbar and menu.</li> -</ul> - -<h5>Known Bugs & Limitations</h5> - -<ul> - <li>"Mode" switching is not supported in this version--you must do all of your - AspectJ work in the "Editing" mode. If you switch modes the IDE has to - be restarted for the AspectJ window to show again.</li> - <li>There is no compiler progress dialog--the way to tell if the compile is - finished is to watch the "status" area of the main window.</li> - <li>There are no keyboard compile/execute shortcuts.</li> - <li>The structure view is not persistent between IDE launches--you must - compile to view the structure for a program.</li> - <li>The debugger has not seen much use and it's stability and performance is - limited.</li> - <li>There is no ajdoc tool support.</li> - <li>Linux testing has been very limited.</li> -</ul> - -<h4>AJDE for Emacs</h4> - -<p> AspectJ-mode now includes a toggle in the AspectJ menu that -disables its intrusive functions, enabling easy switching between Java -and AspectJ projects. See the README and CHANGES files in the -distribution for additional details. </p> - -<p> AJDEE is now compatible with JDEE 2.2.7.1, JDEE 2.2.8beta4, and speedbar -0.14alpha. It a toggle in the AspectJ menu that disables its intrusive -functions, enabling easy switching between Java and AspectJ projects. See -the README and CHANGES files in the distribution for additional details. -</p> - - -<hr /> - -</body> -</html> diff --git a/docs/dist/doc/index.html b/docs/dist/doc/index.html deleted file mode 100644 index dbcc52f90..000000000 --- a/docs/dist/doc/index.html +++ /dev/null @@ -1,350 +0,0 @@ -<html> -<head> - <title>AspectJ Documentation and Resources</title> -</head> -<body> - -<a name="top"></a> -<h1>AspectJ Documentation and Resources</h1> -<p/> - AspectJ <sup><small>tm</small></sup> - is a seamless aspect-oriented extension to - Java<sup><small>tm</small></sup>. - The compiler and development tools are available under - an open-source license, require Java 1.3 to run, and produce - code that runs in JDK 1.1 and later VM's. - For the latest materials, see - <a href="https://eclipse.org/aspectj">https://eclipse.org/aspectj</a>. - Not all of these materials have been updated for AspectJ 5. -<p/> - -<table> - <tr><td><u>Section</u></td><td><u>Contents</u></td></tr> - <tr><td><a href="#documentation">docs</a></td><td> - <a href="faq.html">FAQ</a>, - <a href="quick5.pdf">Quick Reference (AspectJ 5)</a>, - <a href="quick.pdf">Quick Reference (1.2.1)</a>, - <a href="adk15notebook/index.html">AspectJ 5 Developer's Notebook</a>, - <a href="progguide/index.html">programming</a>, - <a href="devguide/index.html">development</a> and - <a href="pdguide/index.html">problem diagnosis</a> guides, - <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> - <a href="https://eclipse.org/aspectj">AspectJ</a>; - development environment support for - <a href="https://eclipse.org/ajdt">Eclipse</a> - and - <a href="https://jdeveloperaop.dev.java.net/">JDeveloper</a>. - </td></tr> - <tr><td><a href="#resources">resources</a></td><td> - <a href="https://eclipse.org/aspectj">AspectJ project</a>, - the bug <a href="https://bugs.eclipse.org/bugs">db</a>, - and mailing lists for - <a href="mailto:aspectj-users@eclipse.org">users</a> and - <a href="mailto:aspectj-dev@eclipse.org">developers</a>. - </td></tr> - <tr><td><a href="#paths">paths</a> </td><td>for those new to AspectJ - </td></tr> -</table> -<p/> - -<a name="documentation"></a> -<h3>AspectJ documentation</h3> -<table border="1"> -<tr> <th>Documentation</th><th>Description</th> - </tr> - - -<tr> <td><a href="quick5.pdf"> AspectJ 5 Quick Reference</a> - </td> - <td>This is a four-page quick reference for the AspectJ 5 language. - </td> </tr> - -<tr> <td><a href="quick.pdf"> AspectJ Quick Reference</a> - </td> - <td>This is a two-page quick reference for the AspectJ language. - </td> </tr> - -<tr> <td><a href="adk15notebook/index.html">AspectJ 5 Developer's Notebook</a> - (printable <a href="adk15notebook/printable.html">html</a>) - </td> - <td>This describes the changes to the AspectJ language and tools introduced - in the AspectJ 5 Development Kit. These changes are additive, and are not yet - reflected in the programming guide or quick reference.</td> - </tr> - -<tr> <td><a href="progguide/index.html">Programming Guide</a> - (printable <a href="progguide/printable.html">html</a>) - </td> - <td>This introduces AOP and the AspectJ language. - <a href="progguide/starting.html">Getting Started</a> - describes basic semantics, and shows development- and production-time applications. - <a href="progguide/language.html">The AspectJ Language</a> - describes join points, pointcuts, advice, and introduction, all features new to AOP. - <a href="progguide/examples.html">Examples</a> walks you through the - examples included with the documentation, and there are two short - chapters on useful <a href="progguide/idioms.html">Idioms</a> and a - few <a href="progguide/pitfalls.html">Pitfalls</a> - The appendices have reference information: - the <a href="progguide/quick.html">Quick Reference</a> - summarizes AspectJ syntax, - the <a href="progguide/semantics.html">Language Semantics</a> - best describes AspectJ usage, and - <a href="progguide/implementation.html">Implementation Notes</a> - describes how - the current version is limited to code the compiler controls.</td> - </tr> - -<tr> <td><a href="devguide/index.html">Development Environment Guide</a> -<br/> - - (printable <a href="devguide/printable.html">html</a>) - </td> - <td>This is a guide to - <a href="devguide/ajc-ref.html">ajc</a>, the command-line compiler; - and the <a href="devguide/antTasks.html">Ant tasks</a> - for building AspectJ programs. - </td> - </tr> - -<tr> <td><a href="pdguide/index.html">Problem Diagnosis Guide</a> -<br/> - - (printable <a href="pdguide/printable.html">html</a>) - </td> - <td>This has a guide to - the various features available such as messages and trace to help you both solve problems - with you own programs and report bugs to the AspectJ team. - </td> - </tr> - -<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> - </td> - <td>Frequently-asked questions about the AspectJ language, tools, and project. - </td> </tr> - -<tr> <td>README's - </td> - <td>Changes and porting guide for AspectJ - <a href="README-1921.html">1.9.21</a>, - <a href="README-1920.html">1.9.20 and 1.9.20.1</a>, - <a href="README-1919.html">1.9.19</a>, - <a href="README-199.html">1.9.9 and 1.9.9.1</a>, - <a href="README-198.html">1.9.8</a>, - <a href="README-197.html">1.9.7</a>, - <a href="README-196.html">1.9.6</a>, - <a href="README-195.html">1.9.5</a>, - <a href="README-194.html">1.9.4</a>, - <a href="README-193.html">1.9.3</a>, - <a href="README-192.html">1.9.2</a>, - <a href="README-191.html">1.9.1</a>, - <a href="README-190.html">1.9.0</a>, - <a href="README-1811.html">1.8.11</a>, - <a href="README-1810.html">1.8.10</a>, - <a href="README-189.html">1.8.9</a>, - <a href="README-188.html">1.8.8</a>, - <a href="README-187.html">1.8.7</a>, - <a href="README-186.html">1.8.6</a>, - <a href="README-185.html">1.8.5</a>, - <a href="README-184.html">1.8.4</a>, - <a href="README-183.html">1.8.3</a>, - <a href="README-182.html">1.8.2</a>, - <a href="README-181.html">1.8.1</a>, - <a href="README-180.html">1.8.0</a>, - <a href="README-174.html">1.7.4</a>, - <a href="README-173.html">1.7.3</a>, - <a href="README-172.html">1.7.2</a>, - <a href="README-171.html">1.7.1</a>, - <a href="README-170.html">1.7.0</a>, - <a href="README-1612.html">1.6.12</a>, - <a href="README-1611.html">1.6.11</a>, - <a href="README-1610.html">1.6.10</a>, - <a href="README-169.html">1.6.9</a>, - <a href="README-168.html">1.6.8</a>, - <a href="README-167.html">1.6.7</a>, - <a href="README-166.html">1.6.6</a>, - <a href="README-165.html">1.6.5</a>, - <a href="README-164.html">1.6.4</a>, - <a href="README-163.html">1.6.3</a>, - <a href="README-162.html">1.6.2</a>, - <a href="README-161.html">1.6.1</a>, - <a href="README-160.html">1.6.0</a>, - <a href="README-154.html">1.5.4</a>, - <a href="README-153.html">1.5.3</a>, - <a href="README-152.html">1.5.2</a>, - <a href="README-151.html">1.5.1</a>, - <a href="README-150.html">1.5.0</a>, - <a href="README-121.html">1.2.1</a>, - <a href="README-12.html">1.2.0</a>, - <a href="README-11.html">1.1</a>, and - <a href="porting.html">1.0</a>. - </td> </tr> - - -<tr> <td><a href="changes.html">Changes</a> - </td> - <td>Changes between the latest releases. - </td> </tr> - -<tr> <td><a href="examples/">Examples</a> - </td> - <td>AspectJ code to demonstrate some language features and implement - JavaBean properties, the Observer pattern, a tracing library, - and a game application where aspects handle display updating. - </td> </tr> - -</table> - -<a name="distributions"></a> -<h3>AspectJ distributions</h3> -<table border="1"> -<tr> <th>Distributions</th><th>Description</th></tr> -<tr> <td><a href="https://eclipse.org/aspectj">AspectJ</a> - </td> - <td>The AspectJ distribution contains binaries for the - compiler, structure browser, and Ant taskdefs, - as well as the documentation and examples. - </td> - </tr> -<tr> <td><a href="https://eclipse.org/aspectj">AspectJ</a> source code - </td> - <td>Source code for AspectJ is available - under the open-source - <a href="https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt">Eclipse Public License v 2.0</a> - license from the Git - repositories for the AspectJ project. See the - <a href="faq.html#q:buildingsource">FAQ entry</a>. - </td> - </tr> - -<tr> <td><a href="https://eclipse.org/ajdt">AspectJ for Eclipse</a> - </td> - <td>AspectJ Development Environment support for - Eclipse is available under Eclipse Public License v 1.0 - from the eclipse.org project site - <a href="https://eclipse.org/ajdt"> - https://eclipse.org/ajdt</a> - </td> - </tr> - -<tr> <td><a href="https://jdeveloperaop.dev.java.net/"> - Support for the JDeveloper IDE</a> - </td> - <td>Support for programming in AspectJ using the JDeveloper IDE - is available under the Apache Software License - from the java.net project site - <a href="https://jdeveloperaop.dev.java.net/"> - https://jdeveloperaop.dev.java.net/</a> - </td> - </tr> - -</table> - -<a name="resources"></a> -<h3>Other AspectJ resources</h3> -<table border="1"> -<tr> <th>Resources</th><th>Description</th> - </tr> -<tr> <td>Mail lists - </td> - <td> - AspectJ users discuss tips and - best practices for writing AspectJ programs on - <a href="mailto:aspectj-users@eclipse.org"> - aspectj-users@eclipse.org</a>. - AspectJ developers discuss issues with developing - the AspectJ tools on - <a href="mailto:aspectj-dev@eclipse.org"> - aspectj-dev@eclipse.org</a>. - To get occasional emails about AspectJ releases - and relevant events, subscribe to - <tt>aspectj-announce@eclipse.org</tt>. - To view list archives or subscribe to the list, go to - <a href="https://eclipse.org/aspectj"> - the AspectJ home page</a>. - To find archived emails, use the Eclipse site - <a href="https://www.eclipse.org/search/search.cgi">search page</a>. - </td></tr> -<tr> <td><a href="https://bugs.eclipse.org/bugs">Bug database</a> - </td> - <td>Use the Eclipse project's Bugzilla database - to view and submit bugs against the AspectJ product components - <a href="https://bugs.eclipse.org/bugs/buglist.cgi?product=AspectJ&component=Compiler"> - Compiler</a> (for the AspectJ compiler, ajc) - <a href="https://bugs.eclipse.org/bugs/buglist.cgi?product=AspectJ&component=IDE"> - IDE</a> (for AJBrowser and AJDE bugs), - <a href="https://bugs.eclipse.org/bugs/buglist.cgi?product=AspectJ&component=Ant"> - Ant</a> (for the Ant tasks), - and - <a href="https://bugs.eclipse.org/bugs/buglist.cgi?product=AspectJ&component=Docs"> - Docs</a> (for the documentation). - Bugs all users should know about are - <a href="https://bugs.eclipse.org/bugs/buglist.cgi?product=AspectJ&keywords=info"> - flagged with the "info" keyword</a>. - See the - <a href="faq.html#q:ajcbugs"> - FAQ entry</a> for instructions on submitting compiler bugs. - </td> </tr> - -</table> - -<p/> -<a name="paths"></a> -<h3>Suggested paths for those new to AspectJ</h3> -<p/> - To learn the AspectJ language, read the - <a href="progguide/index.html">Programming Guide</a>, - keeping the <a href="progguide/semantics.html">Semantics appendix</a> - nearby as the best reference for AspectJ usage. - Focus initially on the join point model and - pointcuts, concepts AOP adds to OOP. - To read about how the <a href="examples/">examples</a> work, - 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="https://eclipse.org/ajdt">AJDT (AspectJ Development Tools) - in Eclipse IDE</a>. IntelliJ IDEA also offers AspectJ and Spring AOP - support. -<p/> - To start using AspectJ with your own code, - modify the example aspects to apply to your classes. - As you learn, - use the compiler's <code>-Xlint</code> flags to catch some common - mistakes. (Understand that the - <a href="progguide/implementation.html">current implementation</a> - is limited to code the compiler controls.) -<p> - To plan how to adopt AspectJ into a project, read the - <a href="progguide/index.html">Programming Guide</a> - on development- and production-time aspects - and the <a href="faq.html">FAQ</a> entries for - <a href="faq.html#q:startUsingAJ">How should I start using AspectJ?</a>, - <a href="faq.html#adoption">Deciding to adopt AspectJ</a>, - the Development tools sections - (<a href="faq.html#q:integrateWithDevTools">one</a>, - <a href="faq.html#devtools">two</a>, - <a href="faq.html#ltw">Load-time weaving</a> - ), and - <a href="faq.html#q:opensource">AspectJ as open-source</a>. -</p> -<p> -Enjoy the language! -</p> -<p> -The AspectJ Team -</p> - -<hr/> -<small> -<a href="#top">Top</a> -</small> -</body> </html> diff --git a/docs/dist/doc/porting.html b/docs/dist/doc/porting.html deleted file mode 100644 index 753ab53d9..000000000 --- a/docs/dist/doc/porting.html +++ /dev/null @@ -1,2045 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> <head> - <title>AspectJ Reference - Porting Notes</title> -</head> -<body> - -<div align=right><small> -© Copyright 1998-2002 Palo Alto Research Center Incorporated, - 2003-2004 Contributors. -All rights reserved. -</small></div> - -<h1>AspectJ Porting Notes</h1> - -<ul> - <li><a href="#pre-1.2">Pre-1.2 code</a></li> - <li><a href="#pre-1.1">Pre-1.1 code</a></li> - <li><a href="#pre-1.0.4">Pre-1.0.4 code</a></li> - <li><a href="#pre-1.0rc1">Pre-1.0rc1 code</a></li> - <li><a href="#pre-1.0beta1">Pre-1.0beta1 code</a></li> - <li><a href="#pre-1.0alpha1">Pre-1.0alpha1 code</a> - </li> - <li><a href="#pre08b3">Pre-0.8beta3 code</a></li> - - <li><a href="#pre08b1">Pre-0.8beta1 code</a></li> - - <li><a href="#pre07b11">Pre-0.7beta11 code</a></li> - - <li><a href="#pre07b10">Pre-0.7beta10 code</a></li> -</ul> - -<h2><a name="pre-1.2">Porting pre-1.2 code to AspectJ 1.2</a></h2> -<a href="README-12.html">README-12.html</a> contains a discussion -of the changes between 1.1 and 1.2. The key points are: - -<p><b>The default AspectJ compiler compliance level is now 1.4</b> (whereas in -previous releases the default compliance level was 1.3). This has a number -of implications: -</p> -<ul> -<li> class files generated by the compiler are now JRE v1.2 and upwards -compatible. (At compliance level 1.3, AspectJ generated class files that -were compatible with JRE 1.1 also).</li> -<li> <code>call</code> pointcuts may match more join points than in the same -program compiled at compliance level 1.3.</li> -</ul> -<p> -The AspectJ compiler can be restored to 1.3 compliance settings by specifying the -"-1.3" option on the command-line. -</p> -<p>The following example program illustrates the differences in join point matching -with the <code>call</code> pointcut designator between 1.4 and 1.3 compliance levels. -</p> -<pre> -<code> -01 class A { -02 public void doIt() {...}; -03 } -04 -05 class B extends A { -06 public void doThisToo() {...}; -07 } -08 -09 -10 public class CallsAandB { -11 -12 public static void main(String[] args) { -13 B b = new B(); -14 A bInDisguise = new B(); -15 -16 b.doIt(); // AspectJ 1.2 matches here -17 bInDisguise.doIt(); // this is never matched -18 } -19 -20 } -21 -22 aspect CallPCDMatchingExample { -23 -24 before() : call(* B.doIt(..)) { -25 System.out.println("About to call B.doIt(...)"); -26 } -27 -28 } -</code> -</pre> -<p> -When this program is compiled with AspectJ 1.2 using the default compiler options, -it will produce one line of output when it is executed: -</p> -<p><code>About to call B.doIt(...)</code></p> -<p>The same program compiled under AspectJ 1.1 (or using AspectJ 1.2 with the -1.3 flag specified) -does not produce any output when it is run. -</p> - -<p> -The reason for the additional call pcd match is that prior to compliance level 1.4, -Java compilers produced bytecodes that call A.doIt() (the defining type of the method), -rather than B.doIt() (the declared type in the program text). The generated call to -A.doIt() is not matched by the call pcd used in the before advice. At -compliance level 1.4, the bytecodes retain the declared type of the receiver in the -program source, generating a call to B.doIt(), which <i>is</i> matched by the call pcd. -</p> - -<p>This is a good example of why the recommended style is to use <code>call(* doIt(..)) && target(B)</code>, -which always matches based on the actual type of the receiver. -</p> - -<p><b>New warnings emitted by the compiler for unmatched call pcds.</b> Because users have found -the static type matching used for a type pattern specified in a <code>call</code> pcd confusing -(as evidenced by the example above), AspectJ 1.2 has a new Xlint warning which is enable by default. -The compiler will now produce a warning whenever a call pointcut designator does not match at a -join point, and a user may have expected it to. Compiling the above program using AspectJ 1.2 -produces the following compiler output: -</p> - -<pre> -<code> -<font color="red"> -CallsAandB.java:24 warning does not match because declaring type is A, if match desired use target(B) [Xlint:unmatchedSuperTypeInCall] -before() : call(* B.doIt(..)) { - ^^^^^^^^^^^^^^^ - - see also: CallsAandB.java:17 -</font> -<font color="blue"> -1 warning -</font> -</code> -</pre> - -The warning is telling us that the call pointcut associated with the before advice on line 24 of the source file -does not match at a join point where the user may have expected it to. The source location -corresponding to the unmatched join point is indicated by the "see also" line - in this case line 17 of the -source file. At line 17 we find a call to <code>bInDisguise.doIt()</code>. Since the static type of -<code>bInDisguise</code> is <code>A</code>, this call will never be matched. The warning also tells us -a possible solution if we intended the pointcut to match at this join point: use -<code>call(* doIt(..) && target(B)</code>. - -<p>If you find warnings of this kind coming out when you use the AspectJ 1.2 compiler, the recommended fix is to -switch to using the <code>target</code> designator in place of a type pattern in the <code>call</code> pointcut -expression. Note that there is no loss of runtime efficiency here - runtime tests are only added in the cases -where it cannot be determined at compile time whether the type of the receiver will match the type specified in -the <code>target</code> expression. Note that <code>target</code> cannot be used in <code>declare</code> statements. -</p> - -<p><b>Use of non-statically determinable pointcut expressions in declare statements</b> has always been forbidden, -but prior to 1.2 the AspectJ compiler did not raise an error if they were used. The AspectJ Language -Semantics appendix states that <code>cflow, cflowbelow, this, target, args</code> and <code>if</code> pointcut -designators cannot be used directly or indirectly (through a user-defined pointcut) inside of a <code>declare</code> -statment. When moving code from 1.1 to 1.2, additional errors may be raised due to the stricter policing of this -rule. The solution is to recode the declare statement avoiding pointcut expressions that may require a run-time test. -</p> - -<p><b>Interface constructors no longer supported</b>. -Declaring a constructor on an interface is now (correctly) prohibited, -and there will no longer be a constructor-execution join point for the interface. -To initialize a field declared on an interface, use initialization, e.g., -</p> -<pre>int I.i; -after(I i) returning: initialization(I) && this(i) { i.i = 2; }</pre> -<p>To pick out the constructor-execution for any implementation of I, try -</p> -<pre>execution(I+.new(..))</pre> - -<p>For more information, see bug - <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=49295">49295</a>. -</p> - -<p><b>Declaring a static method on an interface</b> is now (correctly) prohibited. -One workaround is to define a static method on the aspect instead. -For more information, see bug - <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=47754">47754</a>. -</p> - -<p><b>Watch for problems due to incompatible BCEL versions.</b> -AspectJ 1.2 includes a different version of BCEL than AspectJ 1.1. If you have the older -version of BCEL available earlier on your classpath than the version included in the -1.2 aspectjtools.jar then you will see errors like: - -<pre> -C:\work\test\TestAspect.aj error Internal compiler error -java.lang.NoSuchMethodError: org.apache.bcel.generic.InstructionFactory. -createNewArray(Lorg/apache/bcel/generic/Type;S)Lorg/apache/bcel/generic/Instruction; -</pre> - -This typically happens because the old version of BCEL has been included as a standard -extension in your JVM configuration. Ensure you have removed it from jre/lib/ext -under your JDK installation. - -<p>For more information, see bugs including - <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=60389">60389</a>, - <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=59921">59921</a>. -</p> - - -<h2><a name="pre-1.1">Porting pre-1.1 code to AspectJ 1.1</a></h2> -<a href="README-11.html">README-11.html</a> contains a discussion -of the language changes from 1.0 to 1.1. The high points: - -<p> -The <code>call(..)</code> pointcut designator is now implemented -only at the call site; by contrast, the AspectJ 1.0 compiler could -also implement it on the callee side. So in 1.0 if you -compiled a pointcut using <code>call(..)</code> but only passed -the compiler the code for the target of the call, the pointcut -could be implemented. This is not true for 1.1. To fix this, -use <code>execution(..)</code> in place of <code>call(..)</code>, -or include all calling clients in the compile. -(<a href="README-11.html#NO_CALLEE_SIDE_CALL">more info</a>) - -<p> -Type-patterns are no longer permitted for the defining -type of inter-type declarations. Replace the pattern with a -type. -In many cases, you can declare members on an interface type, -and then declare that the types picked out by the type-pattern -implement have the interface as their parent. -(<a href="README-11.html#SINGLE_INTERCLASS_TARGET">more info</a>) -<!-- todo code --> - -<p> -Type-patterns are no longer permitted when specifying -<code>declare soft</code>. -Replace the pattern with a literal type. -<!-- todo code --> - -<p> -Wildcards patterns (<code>foo..*</code>) are no longer -permitted for -<code>this()</code>, -<code>target()</code>, or -<code>args()</code>. -Replace the pattern with a literal type or -with a subtype wildcard (<code>Type+</code>). -(<a href="README-11.html#INSTANCEOF_ON_WILD">more info</a>) -<!-- todo code --> -<p> -Conflicts will be reported for no-argument constructors -generated by compilers when no constructor is defined -for a class. That means the following code will compile -in 1.0 but not in 1.1: -<pre> -class C {} -aspect A { - C.new() {} // permitted in 1.0; conflict in 1.1 -} -</pre> -One fix is to declare a non-conflicting constructor -by adding arguments (or defining a constructor in the -target class); a better fix might be to do the work of the -declared constructor in advice on the initialization -join point for the object. -(<a href="README-11.html#DEFAULT_CONSTRUCTOR_CONFLICT">more info</a>) - -<p> -The pointcut designators -<code>within()</code> and <code>withincode()</code> - will not pick out -code within the lexical extent of method-local -and anonymous inner types (because these are not -represented as such in bytecode form). Because -<code>within</code> forms specify staticly-determinable pointcuts, -they might be used in declare error or declare warning -statements, which might produce different results. -(<a href="README-11.html#WITHIN_MEMBER_TYPES">more info</a>) - -<p> -The compiler will report an error that -the form <code>aspect {name} dominates {list}...</code> -is no longer supported. It has -been replaced by a new declare statement: -<pre> -declare precedence : {name} {list}... -</pre> -(<a href="README-11.html#ASPECT_PRECEDENCE">more info</a>) - -<p> -The field set join point now has a return type of <code>void</code>. -Compiling programs using around advice on these join points might -cause errors unless the return type of the around advice -and the result of any proceed() call is -<code>Object</code> or <code>void</code>. -(<a href="README-11.html#VOID_FIELD_SET">more info</a>) -<p> - -The compiler cannot implement after or around advice for -the handler PCD because the end of exception handlers is -ambiguous in bytecode. Try to use before advice. -(<a href="README-11.html#AFTER_HANDLER">more info</a>) -<p> - -<h2><a name="pre-1.0.4">Porting pre-1.0.4 code</a></h2> - -<p>In versions of AspectJ prior to 1.0.4, the compiler was not -correctly implementing the AspectJ-1.0 language design for some uses -of after returning advice. -</p> - -<p> The main change that was made was of after returning advice for -constructor execution join points. Previously, this advice was legal: -</p> - -<PRE> -after() returning (Foo f): execution(Foo.new(..)) { ... } -</PRE> - -<p> However, it has always been a part of the 1.0 language design (and -of Java's language design) that constructors themselves (as opposed to -constructor calls) do not return the value of the new object. Rather, -<code>this</code> is bound to the new object, and the constructor -behaves like a void method. With that in mind, any code like the -above should be conveted to the form. </p> - -<PRE> -after(Foo f) returning: this(f) && execution(Foo.new(..)) { ... } -</PRE> - -<p> In compilers prior to 1.0.4, the following advice could pick out -join points -</p> - -<PRE> -after() returning (String s): call(void foo()) { ... } -</PRE> - -<p> This is no longer picked out. This pattern was most commonly used -in highly polymorphic contexts, such as -</p> - -<PRE> -after() returning (String s): call(* foo()) { ... } -</PRE> - -<p> If you want to capture all calls, binding null objects for those -that would otherwise have no value, you must use the -<code>Object</code> type. -</p> - -<PRE> -after() returning (Object o): call(* foo()) { ... } -</PRE> - -<p> Uses of both of these forms are highleted with compiler warnings -in the 1.0.4 compiler. -</p> - - -<hr /> - -<h2><a name="pre-1.0rc1">Porting pre-1.0rc1 code</a></h2> - -<p> Aspects can no longer be declared to implement the -<code>Serializable</code> or <code>Cloneable</code> interfaces. If -you previously used serializable or cloneable aspects, you should -refactor your code to keep the state you need to serialize or clone in -objects associated with the aspects. -</p> - -<hr /> - -<h2><a name="pre-1.0beta1">Porting pre-1.0beta1 code</a></h2> - -<p> The <code>static</code> modifier is no longer allowed on pointcut -declarations anywhere. Porting is simple; just remove the static -declarations when you find them. -</p> - -<p> Also, though the <code>returns</code> modifier on pointcuts has -not been part of the language since 1.0alpha1, the compiler still -accepted them until now. If you used this feature, now is the right -time to remove the <code>returns</code> modifier when the compiler -complains about it. -</p> - -<hr /> - -<h2><a name="pre-1.0alpha1">Porting pre-1.0alpha1 code </a></h2> - - -<p> The release of AspectJ 1.0alpha1 involved sweeping cleanups of the -language to bring it to 1.0 status. </p> - - <ul> - <li><a href="#1.0a1-pointcuts">Pointcuts</a></li> - <li><a href="#1.0a1-type-patterns">Type patterns</a></li> - <li><a href="#1.0a1-advice">Advice</a></li> - <li><a href="#1.0a1-introduction-and-static">Introduction and - static crosscutting</a></li> - <li><a href="#1.0a1-aspects">Aspects</a></li> - </ul> - -<h3><a name="1.0a1-pointcuts">Pointcuts</a></h3> - -<h4><a name="1.0a1-plural-to-singular">Removing the "s" from pointcuts</a></h4> - -<p> One of the most pervasive changes in porting code written before -1.0alpha1 is the change in some of the pointcut names from plural to -singular, that is, they lose an "s". In one sense, making this change -in your programs is easy: just go through and whever you see uses of -the pointcuts -</p> - -<blockquote>calls executions gets sets handlers initializations -staticinitializations</blockquote> - -<p> Just take off the final "s", to make one of -</p> - -<blockquote>call execution get set handler initialization -staticinitialization</blockquote> - -<p> Often, there will be other changes you should make for each of -these pointcuts, but as for the name, just take off the "s". </p> - -<p> One risk you will have when doing this is creating name conflicts. -If, for example, you named a parameter of a pointcut "set", you should -(for your own sanity -- the compiler doesn't require it) rename it in -the rewritten pointcut. </p> - -<PRE> -pointcut sort(Collection set): calls(void addAll(set)); -==> -pointcut sort(Collection mySet): call(void addAll(mySet)); -</PRE> - -<p> While converting to use singular nouns for the primitive -pointcuts, you may also want to remove the "s" from your user-defined -pointcuts. </p> - -<PRE> -pointcut publicCalls(): calls(public * *(..)); -==> -pointcut publicCall(): call(public * *(..)); -</PRE> - -<p> Of course, your naming conventions are your own, but throughout -these porting notes we will be making these changes in our example -ports. </p> - - -<h4><a name="1.0a1-remove-receptions">Removing the receptions pointcut</a></h4> - -<p> Perhaps the largest semantic change in the 1.0 language is the -removal of receptions join points. They have been merged with call -join points in AspectJ 1.0, so now a call join point doesn't represent -the "caller-side" of a call, but the call itself, both caller and -receiver. </p> - -<p> Changing code that used the <code>receptions</code> pointcut should be -fairly straightforward, depending on whether the pointcut exposed state or -not. </p> - -<h5>Not exposing state</h5> - -<p> Receptions pointcuts that did not expose state can simply be -replaced by the new <code>call</code> and <code>target</code> pointcuts:</p> - -<PRE> -receptions(void Foo.m()) -==> -target(Foo) && call(void m()) -</PRE> - -<h5>Exposing state</h5> - -<p> Some receptions pointcuts exposed the receiving object by -replacing the receiving type with a pointcut formal. These PCDs -should be rewritten to use the new <code>target</code> pointcut to expose -the receiving object. </p> - -<PRE> -pointcut fooCallees(Foo f): receptions(void f.m()); -==> -pointcut fooCallee(Foo f): target(f) && call(void m()); -</PRE> - -<p> Like <a href="#1.0a1-fixing-state-access">other pointcuts</a>, -receptions pointcuts that exposed one or more arguments should be -rewritten to use the <code>args</code> pointcut: </p> - -<PRE> -pointcut intPassers(int i, int j): receptions(void Foo.m(i, j)); -==> -pointcut intPasser(int i, int j): - args(i, j) && target(Foo) && call(void m(int, int)); -</PRE> - -<h5>Constructor receptions</h5> - -<p> There are two issues with constructor receptions in -particular. </p> - -<p>Like <a href="#1.0a1-constructor-calls">constructor calls</a>, -constructor receptions pointcuts had a dynamic character, in that -<code>receptions(C.new())</code> would capture constructions of not -only C classes, but also of classes that extended C. </p> - -<p> If you want this behaviour, then you need to use the new subtypes -operator, +, on the type name in question. So, -</p> - -<PRE> -receptions(C.new()) -==> -call(C+.new()) -</PRE> - -<p>Also like <a href="#1.0a1-constructor-calls">constructor calls</a>, -constructor receptions allowed access to the constructed object in the -same way as any other object. Since the only advice possible on -constructor receptions join points was <code>after returning</code> -advice, the object was always guaranteed to be there. But since -constructor call join points allow all kinds of advice it may be that -the object isn't constructed yet (say, in before or around advice). -This is a benefit, in that it allows caching constructed objects </p> - -<PRE> -aspect Singleton { - private C theC = null; - - C around(): call(C.new(..)) { - if (c == null) theC = proceed(); - return theC; - } -} -</PRE> - -<p> but it does require some rewriting. The new object can be -accessed as the return value in after returning advice. So, </p> - -<PRE> -after(Point p) returning (): receptions(p.new(int, int)) { ... } -==> -after() returning (Point p): call(Point+.new(int, int)) { ... } -</PRE> - -<h4><a name="1.0a1-fixing-state-access">Fixing state access</a></h4> - -<p> In previous versions of AspectJ, state such as the currently -executing object or a particular argument of a method call could be -accessed from the signatures of many pointcuts, leading to -difficult-to-read forms. In AspectJ 1.0, all state accesses now use -only three pointcuts </p> - -<blockquote>args this target</blockquote> - -<p> which pick out argument values, the currently executing object, -and the target object of a method call or field operation, -respectively. </p> - -<h5>Using args</h5> - -<p> Any time you have a pointcut that has a signature where one of the -arguments was a pointcut or advice formal, just replace that formal -with its type and add an <code>args</code> pointcut. -</p> - -<PRE> -pointcut intPassers(int i, int j): calls(void Foo.m(i, j)); -==> -pointcut intPasser(int i, int j): args(i, j) && call(void Foo.m(int, int)); -</PRE> - -<PRE> -pointcut stringPassers(String s): receptions(void Foo.m(s, ..)); -==> -pointcut stringPasser(String s): args(s, ..) && call(void Foo.m(String, ..)); -</PRE> - -<h5>Rewriting calls</h5> - -<p> If a calls pointcut exposed the the receiving object, such as </p> - -<PRE> -pointcut fooCallees(Foo f): calls(void f.m()); -</PRE> - -<p> then the new version should use the <code>target</code> pointcut -to get at that object -</p> - -<PRE> -pointcut fooCallee(Foo f): target(f) && call(void Foo.m()); -</PRE> - -<p> AspectJ's calls pointcut previously allowed the new object to be -exposed, even though it may not have been constructed yet. AspectJ -1.0 no longer allows this; you can access the new instance only in -after returning advice, when it is guaranteed that the object was -successfully constructed. So instead of using the <code>target</code> -pointcut to expose the value, you should use the normal <code>after -returning</code> mechanism: -</p> - -<PRE> -after(Point p) returning (): calls(p.new(int, int)) { ... } -==> -after() returning (Point p): call(Point+.new(int, int)) { ... } -</PRE> - - -<h5>Rewriting gets and sets</h5> - -<p> Exposing the target object of a <code>gets</code> or -<code>sets</code> pointcut should be done the same way it was for -<code>calls</code> pointcuts, with the new <code>target</code> -pointcut. </p> - -<PRE> -before(Frame f): gets(Color f.color) { ... } -==> -before(Frame f): target(f) && get(Color Frame.color) { ... } -</PRE> - -<PRE> -before(Frame f): sets(Color f.color) { ... } -==> -before(Frame f): target(f) && set(Color Frame.color) { ... } -</PRE> - -<p> In addition, the clumsy syntax for getting the old value of the -field has been eliminated. For before advice, the port is simple; -just access the field yourself in the body. Depending on the rest of -your system, you may need to restrict the advice from the aspect body -to eliminiate the circularity. </p> - -<PRE> -aspect A { - before(Frame f, Color c): gets(Color f.color)[c] { ... } -} -==> -aspect A { - before(Frame f): - target(f) && get(Color Frame.color) && !within(A) { - Color c = f.color; - ... - } -} -</PRE> - -<p> The same can be done for <code>around</code> advice. However, the -only way to port after advice that needs the old value is to convert -it to around advice. -</p> - -<PRE> -aspect A { - after(Frame f, Color c) returning (): gets(Color f.color)[c] { ... } -} -==> -aspect A { - void around(Frame f): - target(f) && get(Color Frame.color) && !within(A) { - Color c = f.color; - proceed(f); - ... - } -} -</PRE> - -<p> When porting <code>sets</code> pointcuts, the new value of a field -is still available, but not the way it was previously. Instead of -using the square bracket syntax, we use an <code>args</code> pointcut. -All set join points are assumed to have exactly one argument, which -holds the new value. So, </p> - -<PRE> -after(Color newColor): sets(Color Frame.color)[][newColor] { ... } -==> -after(Color newColor): args(newColor) && set(Color Frame.color) { ... } -</PRE> - -<p> Also, if the field was declared private, in order to get at its -old value the aspect must be declared <code>privileged</code>. -</p> - -<h5>Rewriting handlers</h5> - -<p> The value of the exception at an exception handler join point is -now accessed through the <code>args</code> pointcut; all exception -handler join points are treated as having exactly one argument, the -exception value. So, -</p> - -<PRE> -before(NotFoundException e): handlers(e) { ... } -==> -before(NotFoundException e): args(e) && handler(NotFoundException) { ... } -</PRE> - -<h5>Rewriting within</h5> - -<p> The <code>within</code> pointcut was not typically used to export -context. Though it was accidentally possible to do so in versions of -AspectJ before 1.0, it often didn't do what users expected it to. -This loophole has now been closed, and within can only take type -patterns, not pointcut or advice formals. A use of the -<code>this</code> pointcut will capture what previous implementations -did: </p> - -<PRE> -pointcut usesFoo(Foo f): within(f); -==> -pointcut usesFoo(Foo f): this(f) && within(Foo); -</PRE> - -<h4><a name="1.0a1-no-subs-in-sigs">Understanding signatures</a></h4> - -<p> Now that we have <code>this</code>, <code>target</code>, and -<code>args</code> pointcuts, all of our signatures are composed of -just types, names, and wildcards; there are no more parameters. -</p> - -<p> Also, now that we have the <code>+</code> wildcard to pick out -<a href="#1.0a1-subtypes-to-plus">subtypes</a>, we can make signature -matching much more uniform.</p> - -<p> Previously, some signatures matched based on subtypes, some based -on instanceof, and some exactly. Now, we have made all signatures -match exactly. -</p> - -<p> What does this mean for your program? Well, it means that you -may have to add <code>+</code> to some of your signatures, depending -on what you meant them to match. -</p> - -<p> For example, the pointcut -</p> - -<pre> -calls(void m(Object)) -</pre> - -<p> previously picked out all method calls to a method named m that -took one argument, which was a subtype of Object. Now, however, it -will only pick out method calls to methods that are defined to take -exactly the type Object, which may be a lot fewer join points. If you -want the old behaviour, simply convert to </p> - -<pre> -call(void m(Object+)) -</pre> - -<h4><a name="1.0a1-fixing-instanceof">Removing the instanceof pointcut</a></h4> - -<p> The intanceof pointcut has been split into two different -pointcuts, <code>this</code> and <code>target</code>. </p> - -<p> Typically, the instanceof pointcut would only exist in a compound -pointcut, composed (with <CODE>&&</CODE>) with another -pointcut. If the other pointcut was a <code>receptions</code> -pointcut, then <code>instanceof</code> should be converted to -<code>target</code> (and <code>receptions</code> converted to -<code>call</code>). So, </p> - -<PRE> -pointcut stateChanges(Subject s): - instanceof(s) && receptions(void Button.click()); -==> -pointcut stateChange(Subject s): - target(s) && call(void Button.click()); -</PRE> - -<p> In all other cases, <code>instanceof</code> referred to the -currently executing object, and so should be converted into -<code>this</code></p> - -<PRE> -before(Point p): instanceof(p) && executions(* makePolar(..)) { ... } -==> -before(Point p): this(p) && execution(* makePolar(..)) { ... } -</PRE> - -<PRE> -pointcut setup(Client c): instanceof(c) && calls(Remote Naming.lookup(String)); -==> -pointcut setup(Client c): this(c) && calls(Remote Naming.lookup(String)); -</PRE> - -<h4><a name="1.0a1-initializations">Rewriting the initializations pointcut</a></h4> - -<p> Object initialization join points are now more complicated, and -more true to Java's execution model. Now they bracket all of the -initialization that a class can do, after the return of its super -constructor call (before which no initialization can happen). Previous -versions of AspectJ had object initialization join points that only -included initialization that was made in dynamic initializers and -fields. </p> - -<p> The old behaviour can be recovered with a simple rewrite. -</p> - -<PRE> -initializations(A) -==> -initialization(A.new(..)) && !execution(A.new(..)) -</PRE> - -<h4><a name="1.0a1-constructor-calls">Understanding constructor calls</a></h4> - -<p> Previously, constructor call join points were matched by subtypes, -so <code>calls(Foo.new())</code> would match both calls to create new -<code>Foo</code> objects, and new <code>SubFoo</code> objects. The -new <code>call</code> pointcut designator matches types exactly, so if -you want the old behaviour, you should write -<code>call(Foo+.new())</code>. </p> - -<p> Similarly, constructor execution join points were matched by -subtypes. So the old <code>executions(Foo.new())</code> is now -represented by <code>execution(Foo+.new())</code>. -</p> - -<p> In both of these cases, think before using the + operator; it may -be that you didn't intend subtype matching in the first place. </p> - -<h4><a name="1.0a1-hasaspect">Removing the hasaspect pointcut</a></h4> - -<p> The <code>hasaspect</code> pointcut is no longer defined, but you -can get the same behaviour using the new <code>if</code> pointcut. -</p> - -<p> If the aspect whose presense you are checking for was defined -<code>of eachcflow</code>, <code>of eachcflowbelow</code>, or, more -unlikely, <code>of eachJVM()</code>, then the conversion is simple: -</p> - -<PRE> -hasaspect(A) -==> -if(A.hasAspect()) -</PRE> - -<p> If the aspect was defined <code>of eachobject</code>, then you -will have to expose the current object in your pointcut or advice -parameters: </p> - -<PRE> -pointcut cut(): hasaspect(A) ... ; -==> -pointcut cut(Object o): this(o) && if(A.hasAspect(o)) ... ; -or -pointcut cut(Object o): target(o) && if(A.hasAspect(o)) ... ; -</PRE> - -<p> If you were using the <code>hasaspect</code> pointcut to expose -the state of the aspect, then you can get the same state by using -<code>A.aspectOf()</code> in the body of the advice. For example, if -the aspect A were defined <code>of eachcflow</code>, then -</p> - -<PRE> -before(A myA): hasaspect(myA) { - myA.checkStatus(); -} -==> -before(): if(A.hasAspect()) { - A myA = A.aspectOf(); - myA.checkStatus(); -} -</PRE> - -<h4><a name="1.0a1-withinall">Removing the withinall pointcut</a></h4> - -<p> The withinall poinctut is no longer defined. You can use a -combination of within and the <a href="#1.0a1-subtypes-to-plus">new -subtypes operator</a>, +, instead. You'll save two characters and be -using a simpler and more orthogonal language. </p> - -<PRE> -withinall(Foo) -==> -within(Foo+) -</PRE> - -<h4><a name="1.0a1-user-defined-returns">Removing returns modifier from pointcuts</a></h4> - -<p>The returns keyword is no longer necessary for user-defined -pointcuts. Simply remove it when you find it. </p> - -<PRE> -pointcut publicIntCalls() returns int: calls(public int *(..)); -==> -pointcut publicIntCall(): call(public int *(..)); -</PRE> - -<h4><a name="1.0a1-static-pointcuts">Making some pointcuts static</a></h4> - -<p> In Java, only static members may be accessed by their declaring -type name, like the static method <code>Math.max()</code> can be -accessed. </p> - -<p> Pointcuts now have that property too. Pointcuts may be declared -to be static, in which case they can be accessed like -<code>MyAspect.move()</code>, or they can be left non-static, in which -case they can be overridden by a subaspect. </p> - -<p> In addition, while pointcuts can still be defined in classes, only -<code>static</code> pointcuts can be defined in classes. </p> - -<p> Porting should be straightforward; just make all your pointcuts in -classes <code>static</code>, and make any pointcut with a qualified -reference static. -</p> - -<h3><a name="1.0a1-type-patterns">Type patterns</a></h3> - -<h4><a name="1.0a1-new-wildcards">Understanding * and .. in type patterns</a></h4> - -<p> Previous versions of AspectJ treated * and .. too cleverly in type -patterns, placing restrictions based on what is a package and what is -a type, and basing their meanings on the definition of a package -hierarchy. </p> - -<p> In AspectJ 1.0, both of these wildcards are defined simply, and -textually: -</p> - -<ul> - <li> The * wildcard alone matches all types. </li> - - <li> The * wildcard in a pattern matches zero or more characters, - but will not match "." </li> - - <li> The .. wildcard matches any sequence of characters that begins - and ends with "." </li> -</ul> - -<p> That's it. -</p> - -<p> This change won't affect most programs, but it will make -understanding programs easier. There is one ugly idiom, however, that -this change disposes of. If your program includes the type pattern -<code>*..*</code>, which used to match all types, you can replace it with the -much simpler *. </p> - -<PRE> -pointcut unaryVoidMethods(): call(void *(*..*)); -==> -pointcut unaryVoidMethod(): call(void *(*)); -</PRE> - -<h4><a name="1.0a1-subtypes-to-plus">Fixing subtypes in introduction</a></h4> - -<p> The new + operator is used to normalize the many places you want -to use subtypes of some types. -</p> - -<p> In introduction forms, you will need to replace -<code>subtypes(<var>TypePattern</var>)</code> type patterns with the -new subtype operator, +. In the case where you wrote -<code>subtypes(Foo)</code>, i.e., the subtypes of a single type, -simply replace this with <code>Foo+</code>. Otherwise, use the -+ operator as appropriate in <var>TypePattern</var>. </p> - -<PRE> -public void (subtypes(Target0 || Target1)).accept(Visitor v) { - v.visit(this); -} -==> -public void (Target0+ || Target1+).accept(Visitor v) { - v.visit(this); -} -</PRE> - -<h3><a name="1.0a1-advice">Advice</a></h3> - -<h4><a name="1.0a1-around-returns">Moving the return type of around</a></h4> - -<p> The returns keyword is no longer used for around advice. Instead, -the return type is declared as it is for methods. So, </p> - -<PRE> -around(Point p) returns void: setters(p) { ... } -==> -void around(Point p): setter(p) { ... } -</PRE> - -<h4><a name="1.0a1-around-throws">Adding a throws clause to around</a></h4> - -<p> Around advice must now declare the checked exceptions it throws -with a <code>throws</code> clause, much like a method. -</p> - -<PRE> -char around(char c) throws java.io.CharConversionException: converter(c) { - char result; - try { result = proceed(); } - catch (Exception e) { - throw new java.io.CharConversionException(); - } - if (result == 0) throw new java.io.CharConversionException(); - return result; -} -</PRE> - -<h4><a name="1.0a1-advice-precedence">Understanding advice precedence</a></h4> - -<p> In previous versions of AspectJ, advice precedence within an -aspect was simple: if a piece of advice appeared before another piece, -it was more precedent. This made perfect sense for -<code>before</code> and <code>around</code> advice, but was the cause -of confusion (even among the AspectJ designers, more than once) for -<code>after</code> advice, as it seemed backward. </p> - -<p> In addition, advice was ordered by kind, in that around advice -always surrounded before and after advice. -</p> - -<p> AspectJ 1.0 has changed this; precedence for <code>after</code> -advice is inverted, and advice is no longer ordered by kind. -</p> - -<p>This won't matter to you unless you write pieces of advice in the -same aspect that apply to the same join point. </p> - -<p>If you do, here's what to think about: If you're looking at two -pieces of advice and want to know which has precedence, if either is -<code>after</code> advice, then the second one has precedence. -Otherwise, the first does. </p> - -<p> This allows interesting advice interaction. In the following -advice, for example, the <code>after throwing</code> advice will catch -the exception thrown by the <code>before</code> advice </p> - -<PRE> -aspect A { - before(): call(void main(..)) { - throw new RuntimeException(); - } - after() throwing(RuntimeException e): call(void main(..)) { - System.err.println("caught you!"); - } -} -</PRE> - -<p> But reversing the order will give the <code>before</code> advice -more precedence, making its exception uncatchable by the <code>after -throwing</code> advice -</p> - -<PRE> -aspect A { - after() throwing(RuntimeException e): call(void main(..)) { - System.err.println("missed you!"); - } - before(): call(void main(..)) { - throw new RuntimeException(); - } -} -</PRE> - -<p> Advice in <em>different</em> aspects is ordered by the normal aspect -precedence rules of subtyping and the <code>dominates</code> modifier. -</p> - -<h4><a name="1.0a1-after-returning">Fixing after returning</a></h4> - -<p> If you use after returning advice and do not need to expose the -return value, you no longer need to write an empty set of parentheses -to indicate that fact. So, </p> - -<pre> -after(<var>Formals</var>) returning (): <var>Pointcut</var> { ... } -==> -after(<var>Formals</var>) returning: <var>Pointcut</var> { ... } -</pre> - -<p> The same syntax is now available for after throwing advice, in -case you do not care what <code>Throwable</code> is thrown. -</p> - -<pre> -after(<var>Formals</var>) throwing: <var>Pointcut</var> { ... } -</pre> - -<h4><a name="1.0a1-this-static-join-point">Renaming thisStaticJoinPoint</a></h4> - -<p> <code>thisStaticJoinPoint</code> has been renamed -<code>thisJoinPointStaticPart</code>, to reflect that it is now -exactly the static part of <code>thisJoinPoint</code>: It will return -the same object as <code>thisJoinPoint.getStaticPart()</code>. </p> - -<h4><a name="1.0a1-this-join-point">Converting access to thisJoinPoint</a></h4> - -<p> The <code>JoinPoint</code> object hierarchy has been folded into a -single class, <code>org.aspectj.lang.JoinPoint</code>. A common -pattern in logging, for example, was </p> - -<pre> -before() executions(* myMethod()) { - ExecutionJoinPoint jp = (ExecutionJoinPoint)thisJoinPoint; - CodeSignature jp = (CodeSignature)jp.getSignature(); - System.err.println(jp.getParameters()); - System.err.println(jp.getParameterNames()); -} -</pre> - -<p> While there is still a rich hierarchy for signatures, there is -only one <code>JoinPoint</code> type, so this can be rewritten as: -</p> - -<pre> -before() executions(* myMethod()) { - JoinPoint jp = thisJoinPoint; - CodeSignature jp = (CodeSignature)jp.getSignature(); - System.err.println(jp.getArgs()); - System.err.println(jp.getParameterNames()); -} -</pre> - -<p> Some of the method names of <code>JoinPoint</code> have been -reorganized, as well. </p> - -<h3><a name="1.0a1-introduction-and-static">Introduction and static crosscutting</a></h3> - -<h4><a name="1.0a1-plus-implements-extends">Removing +implements and +extends</a></h4> - -<p> The keywords <code>+implements</code> and <code>+extends</code> no -longer exist. Instead, AspectJ uses the <code>declare</code> -form for exactly the same functionality. </p> - -<PRE> -Point +implements Serializable; -=> -declare parents: Point implements Serializable; -</PRE> - -<PRE> -MyButton +extends ButtonAdaptor; -=> -declare parents: MyButton extends ButtonAdaptor; -</PRE> - -<h4><a name="1.0a1-now-use-soft">Using declare soft</a></h4> - -<p> Around advice advice no longer effects the static exception -checking of Java. This means that the following code previously -compiled: </p> - -<PRE> -class C { - void noExceptionDeclared() { - exceptionDeclared(); - } - void exceptionDeclared() throws IOException {} -} -aspect A { - around(): call(void C.exceptionDeclared()) { - try { proceed(); } - catch (IOException e) {} - } -} -</PRE> - -<p> even though the class C is not compilable on its own (because -noExceptionDeclared actually throws an Exception). -</p> - -<p> AspectJ now firmly places everything that affects the type system -of Java, including the declared-exception checking system, into the -space of introduction and declare. So, in order to state that the -call to exceptionDeclared() will not, actually, throw an exception, we -now "soften" that exception, that is, take it out of the space of -declared exceptions. </p> - -<pre> -declare soft: <var>ExceptionType</var>: <var>Pointcut</var>; -</pre> - -<p> The pointcuts allowed here are limited; you cannot use pointcuts -that would require runtime information. But picking out method calls -is just fine. So in order to make the above example work, one new -declaration is needed: -</p> - -<PRE> -declare soft: IOException: - call(void C.exceptionDeclared()) && - withincode(void noExceptionDeclared()); -</PRE> - -<h3><a name="1.0a1-aspects">Aspects</a></h3> - -<p> The syntax of "of each" modifiers has changed. For <code>of -eachcflow</code> and <code>of eachcflowbelow</code>, you can simply -replace "of each" with "per". So, </p> - -<PRE> -aspect A of eachcflow(...) { ... } -==> -aspect A percflow(...) { ... } -</PRE> - -<p> If you have any aspects defined <code>of eachJVM()</code>, then -you should either remove that declaration entirely (because this is -the default behaviour), or replace the <code>of eachJVM()</code> -declaration with an <code>issingleton</code> declaration. -</p> - -<PRE> -aspect of eachJVM() { ... } -==> -aspect A { ... } -or -aspect A issingleton { ... } -</PRE> - -<p> The <code>of eachobject(<var>Pointcut</var>)</code> modifier has -been split into two different forms, <code>of -perthis(<var>Pointcut</var>)</code> and <code>of -pertarget(<var>Pointcut</var>)</code>. Which one you replace with -depends on the <var>Pointcut</var> you use. -</p> - -<p> If you use a pointcut that picked out reception join points, then -use <code>pertarget</code>, and rewrite the pointcut to pick out call -join points. So -</p> - -<PRE> -aspect Shadow - of eachobject(receptions(void Point.setX(int)) || - receptions(void Point.setY(int))) { - ... -} -==> -aspect Shadow pertarget(call(void Point.setX(int)) || - call(void Point.setY(int))) { - ... -} -</PRE> - -<p> Otherwise, in most cases, use <code>perthis</code>. When you -convert, remember the meaning of each of these modifiers. -<code>perthis(<var>Pointcut</var>)</code> indicates that an instance -of the aspect should be associated with every object that is -<code>this</code> at each of the join points picked out by -<var>Pointcut</var>, while <code>pertarget(<var>Pointcut</var>)</code> -associates with every object that is the target object at such join -points. </p> - -<!-- ==================================== --> -<!-- ==================================== --> -<!-- ==================================== --> - -<hr /> - -<h2><a name="pre08b3">Porting pre-0.8beta3 code</a></h2> - -<ul> - <li><a href="#cflowTerminology">Changing cflow terminology</a></li> - <li><a href="#abstractPointcuts">Overriding abstract pointcuts</a></li> - <li><a href="#recursiveAdvice">Limiting recursive advice</a></li> -</ul> - - -<p>The following changes are only required when porting code written -prior to the 0.8beta3 release of AspectJ.</p> - -<h3><a name="cflowTerminology">Changing cflow terminology</a></h3> - -<p> Changing pre-0.8beta3 code that uses AspectJ's control-flow-based -features only requires rewriting occurrences of -<code>eachcflowroot</code>, <code>cflow</code>, and -<code>cflowtop</code>. No editing of other aspect code is -necessary.</p> - -<h4>eachcflowroot</h4> - -<p> The aspect modifier "<code>of -eachcflowroot(<var>Pointcut</var>)</code>" should now be written more -as "<code>percflow(<var>Pointcut</var>)</code>". </p> - -<h4>cflow</h4> - -<p> In previous versions of AspectJ, the pointcut -<code>cflow(<var>Pointcut</var>)</code> picked out all join points in -the cflow below the join points of <var>Pointcut</var>. That is, it -did not include the join points of <var>Pointcut</var>, only the join -points in their control flow. -</p> - -<p> As of version 0.8beta3, -<code>cflowbelow(<var>Pointcut</var>)</code> has that behavior. -<code>cflow(<var>Pointcut</var>)</code> includes the join points of -<var>Pointcut</var>. </p> - -<p> In many cases, you may not care whether the points of -<var>Pointcut</var> are included or not, and so can safely leave -<code>cflow(<var>Pointcut</var>)</code> pointcut designators alone. -However, if you use the idiom -</p> - -<pre class="codeindent"> -<var>Pointcut</var> && ! cflow(<var>Pointcut</var>) -</pre> - -<p> to capture the non-recursive entries to a particular pointcut, you -will definitely want to rewrite that as -</p> - -<pre class="codeindent"> -<var>Pointcut</var> && ! cflowbelow(<var>Pointcut</var>) -</pre> - -<h4>cflowtop</h4> - -<p> The primitive pointcut designator -<code>cflowtop(<var>Pointcut</var>)</code> has been removed from the -language, as it is expressible with <code>cflow</code> or -<code>cflowbelow</code>. All uses of -<code>cflowtop(<var>Pointcut</var>)</code> can be rewritten as: -</p> - -<pre class="codeindent"> -cflowbelow(<var>Pointcut</var> && ! cflowbelow(<var>Pointcut</var>)) -</pre> - -<p> Though in most cases the following is sufficient -</p> - -<pre class="codeindent"> -cflow(<var>Pointcut</var> && ! cflowbelow(<var>Pointcut</var>)) -</pre> - -<h3><a name="abstractPointcuts">Overriding abstract pointcuts</a></h3> - -<p> In previous versions of AspectJ, a concrete aspect would -implicitly override all of its abstract pointcuts with an empty -pointcut. AspectJ 0.8beta3 enforces the restriction that a concrete -aspect may not have any abstract pointcuts. Thus the following -extension:</p> - -<pre class="codeindent"> -abstract aspect A { - abstract pointcut pc(); -} - -aspect B {} -</pre> - -<p> will no longer compile. -</p> - -<p> Adding the new empty pointcut designator -</p> - -<pre class="codeindent"> -pointcut <var>Id</var>(); -</pre> - -<p> in the declaration of the concrete aspect fixes this problem. -</p> - -<pre class="codeindent"> -abstract aspect A { - abstract pointcut pc(); -} - -aspect B { - pointcut pc(); -} -</pre> - -<h3><a name="recursiveAdvice">Limiting recursive advice</a></h3> - -<p> Previously, the compiler silently refrained from applying a piece -of advice to join points within its own advice body. So, for example, -in </p> - -<pre class="codeindent"> -class C { - static int i; -} - -aspect A { - before(): gets(int C.i) { - System.err.println("C.i was " + C.i) - } -} -</pre> - -<p> The advice would trace all references of the static field -<code>C.i</code> except those in the body of the before. </p> - -<p> The compiler has now removed this special case, and so running the -above example will now cause a <code>StackOverflowException</code> to -be thrown. </p> - -<p> Most cases of this error can be fixed by correctly specifying the -desired pointcut: In the above example, the intention is clearly not -to trace <em>all</em> references of <code>C.i</code>, just those -outside the aspect. -</p> - -<pre class="codeindent"> -class C { - static int i; -} - -aspect A { - before(): get(int C.i) && ! within(A) { - System.err.println("C.i was " + C.i) - } -} -</pre> - -<p> In a very few cases, you may want the advice to be applicable to -other code in the aspect, but not in the particular piece of advice. -In such cases, you can pull the body of the advice into a method and -restrict away from that method (and away from calls to that method): -</p> - -<pre class="codeindent"> -class C { - static int i; -} - -aspect A { - public static int getCi() { - return C.i; // will be traced - } - - before(): get(int C.i) && - ! withincode(void A.traceCi()) - ! call(void A.traceCi()) { - traceCi(); - } - private void traceCi() { - System.err.println("C.i was " + C.i) // will not be traced - } -} -</pre> - - -<!-- ============================== --> - -<hr /> -<h2><a name="pre08b1">Porting pre-0.8beta1 code</a></h2> - -<ul> - <li><a href="#introSyntax">Rewriting introductions</a></li> - <li><a href="#staticAdvice">Removing static advice</a></li> - <li><a href="#aspect-aspect">Fixing aspect-aspect inheritance</a></li> - <li><a href="#usingPrivateIntroduction">Using private introduction</a></li> -</ul> - -<p>The following changes are only required when porting code written -prior to the 0.8beta1 release of AspectJ.</p> - -<h3><a name="introSyntax">Rewriting introductions</a></h3> - -<h4>Syntax</h4> - -<p> The syntax of introduction has changed. Porting most programs -should require some simple editing. Anywhere you have an introduction -block</p> - -<pre class="codeindent"> -introduction <var>GTN</var> { - ... -} -</pre> - -<p> simply move the <var>GTN</var> down into the introduction -declarations and remove the block.</p> - -<p>For method introduction, place the <var>GTN</var> in front of the -method name, For field introduction, place the <var>GTN</var> in front -of the field name, and for constructor introduction, place the -<var>GTN</var> in front of the <code>new</code> identifier. </p> - -<pre class="codeindent"> -introduction Foo { - public void doStuff() { this.doStuffLater(); } - public int calorieCount = 3; - public new(int x) { super(); calorieCount = x; } -} - -==> - -public void Foo.doStuff() { this.doStuffLater(); } -public int Foo.calorieCount= 3; -public Foo.new(int x) { super(); calorieCount = x; } -</pre> - -<p> For implements and extends introduction, move the <var>GTN</var> -in front of the new identifiers <code>implements</code> or -<code>extends</code>, and place that in a <code>declare parents</code> -form. -</p> - -<pre class="codeindent"> -introduction Foo { - implements Comparable; - extends Goo; -} - -==> - -declare parents: Foo implements Comparable; -declare parents: Foo extends Goo; -</pre> - -<p> In all cases, if the <var>GTN</var> is just a type name, it can be -moved down on its own. However, if the <var>GTN</var> uses any of -<CODE>&&</CODE>, <code>||</code>, and <code>!</code>, it must -be parenthesized. </p> - -<pre class="codeindent"> -introduction subtypes(Foo) && !Goo { - int x; -} - -==> - -int (Foo+ && !Goo).x; -</pre> - - -<h4>Access</h4> - -<p>If you had an introduction that was referring to private or -protected members of the target class, this will no longer work. You -will either need to modify your code to avoid this accessibility -issue, or you will need to use the <code>privileged</code> modifier on -the aspect that contains the introduction.</p> - -<pre class="codeindent"> -class Counter { - private int count = 2; -} - -aspect ExposeCountersPrivates { - introduction Counter { - public int getCount() { return count; } - } -} - -==> -// in 0.8, only privileged aspects can expose a class's privates -privileged aspect ExposeCountersPrivates { - public int Counter.getCount() { return count; } -} -</pre> - - -<p> If you have introduced private or package-protected members, you -will probably have to re-write some code. Most previous uses of -introducing privates can be improved by using private introduction -instead.</p> - -<pre class="codeindent"> -class C { -} - -aspect AddCounter { - introduction C { - private int count; - public int getCount() { return count; } - } -} - -==> -aspect AddCounter { - private int Counter.count; - public int Counter.getCount() { return count; } -} -</pre> - -<p> There is one case that we know of where the inability to perform -the introduction of private members makes 0.7 code difficult to -port to 0.8. If you were using the introduction of a <code>private -void writeObject(..)</code> or a <code>private void -readObject(..)</code> method to interact with Java's serialization -API, you will need to come up with an alternative design. Using some -combination of <code>Externalizable</code>, -<code>writeReplace(..)</code> and/or <code>readResolve(..)</code> -methods should allow you to port your code. If you find this isn't -the case, we'd like to hear about it. - - -<p> If you were introducing either a protected member or a -package-private member onto a class in order to override a protected -member that was inherited from a superclass, you will have to make -this introduction public. <p> - - -<h3><a name="staticAdvice">Removing static advice</a></h3> - -<p> Static advice has been removed from the language. Now, every -piece of advice is non-static, meaning that it will run in the context -of an aspect instance. -</p> - -<p> If you have an aspect that only contains static advice, has no -"of" clause or is declared "of eachJVM()", and is not extended by -another aspect, simply remove the keyword "static" from all pieces of -advice, and make sure the aspect is not defined with the "abstract" -modifier. </p> - -<pre class="codeindent"> -aspect Tracing { - static before(): executions(* *(..)) { - System.out.println("Got Here! " + thisJoinPoint); - } -} - -==> - -aspect Tracing { - before(): execution(* *(..)) { - System.out.println("Got Here! " + thisJoinPoint); - } -} -</pre> - -<p> Otherwise, if you have an aspect contains both static and -non-static advice, is extended, or is "of eachObject(...)" or "of -eachcflowroot(...)", you should group your static advice together and -put it in a new aspect, possibly even an inner aspect. </p> - -<pre class="codeindent"> -aspect ComplexTracing of eachobject(cflow(executions(void Main.main(..)))) { - static before(): executions(* *(..)) { - System.out.println("Got Here! " + thisJoinPoint); - } - static after(): executions(* *(..)) { - System.out.println("Returned! " + thisJoinPoint); - } - - // some other dynamic advice, fields, etc -} - -==> - -aspect ComplexTracing of eachobject(cflow(executions(void Main.main(..)))) { - static aspect AlwaysTracing { - before(): execution(* *(..)) { - System.out.println("Got Here! " + thisJoinPoint); - } - after(): execution(* *(..)) { - System.out.println("Returned! " + thisJoinPoint); - } - } - - // some other dynamic advice, fields, etc -} -</pre> - -<h3><a name="aspect-aspect">Fixing aspect-aspect inheritance</a></h3> - -<p> Aspects can now only extend abstract aspects. This restriction -may cause some redesign of aspect hierarchies. You will probably find -that for the majority of your code the most serious change this -requires is to add an explicit <code>abstract</code> modifier to a -super-aspect that was already implicitly abstract.</p> - -<pre class="codeindent"> -aspect BaseTracing { - abstract pointcut traced(); - before(): traced() { - System.out.println("Got Here! " + thisJoinPoint); - } -} - -==> - -// make this abstract aspect explicitly abstract -abstract aspect BaseTracing { - ... -} -</pre> - - -<p> This change has also affected the <code>getAspect</code> static -method. Now, <code>getAspect</code> is only defined on non-abstract -aspects. Previously, you could call <code>getAspect</code> on an -abstract superaspect and (sometimes) get an instance of a subaspect -back. </p> - -<p>This pattern was used in the Spacewar example in the AspectJ -distribution. We had the class hierarchy </p> - -<pre> - SpaceObject (abstract) - |- Ship - |- Bullet - |- EnergyPellet -</pre> - -<p> And the aspect hierarchy -</p> - -<pre> - SpaceObjectDA (abstract) - |- ShipDA of eachobject(instanceof(Ship)) - |- BulletDA of eachobject(instanceof(Ship)) - |- EnergyPacketDA of eachobject(instanceof(Ship)) -</pre> - -<p> And we would call <code>SpaceObjectDA.getAspect(SpaceObject)</code> to access -the aspect associated with a ship, bullet, or energy pellet. This -pattern depended on the <code>SpaceObjectDA</code> aspect hierarchy -exactly mirroring the <code>SpaceObject</code> hierarchy, and being -maintained that way. </p> - -<p> A better way to implement this kind of design aspect is to use -private introduction, a new feature of AspectJ. -</p> - -<h3><a name="usingPrivateIntroduction">Using private introduction</a></h3> - -<p> A common pattern for AspectJ programs that need to associate some -state with every object of a particular type has been to use aspects -that are defined <code>of eachobject(instanceof(...))</code>. A prime -example of this was the <code>BoundPoint</code> aspect of the bean -example: which needed to associate each point with a -<code>PropertyChangeSupport</code> object. </p> - -<pre class="codeindent"> -aspect BoundPoint of eachobject(instanceof(Point)) { - - java.beans.PropertyChangeSupport support = null; - - after() returning(Point p): receptions(p.new(..)){ - support = new PropertyChangeSupport(myPoint); - } - - around(Point p) returns void: receptions(void p.set*(*)) { - // code that uses support - } -} -</pre> - -<p> In the new version of AspectJ, a better way of accomplishing many -of these state association is to use privately introduced fields. -Instead of creating an aspect instance for every <code>Point</code> -object, store the <code>PropertyChagneSupport</code> object in the -<code>Point</code> objects themselves. -</p> - -<pre class="codeindent"> -aspect BoundPoint { - private PropertyChangeSupport Point.support = new PropertyChangeSupport(this); - - void around(Point p): setters(p) { - // code that uses p.support - } -} -</pre> - -<p> Just as in the past, the PropertyChangeSupport object is not -accessable to anyone but the aspect, but now less mechanism is needed. -</p> - -<p> There are times when changing aspects that are defined <code>of -eachobject(instanceof(...))</code> may not be reasonable. If the -aspect instance is stored or passed to other methods, then having a -real <code>of eachobject(instanceof(...))</code>, now written -<code>perthis(this(...))</code>, association may capture the -crosscutting concern best. </p> - -<!-- ============================== --> - -<hr /> -<h2><a name="pre07b11">Porting pre-0.7beta11 code</a></h2> - -<ul> - <li><a href="#twoArgumentCalls">Removing two-argument calls</a></li> - <li><a href="#adviceInClasses">Removing advice from Class declarations</a></li> -</ul> - -<p>The following changes are only required when porting code written -prior to the 0.7beta11 release of AspectJ.</p> - -<h3><a name="twoArgumentCalls">Removing two-argument calls</a></h3> - -<p> In AspectJ 0.7beta11, the two-argument <code>calls</code> -primitive pointcut designator was deprecated. Removing these -designators will require different cases depending on what the -original pointcut did. </p> - -<h4>Calls to static methods</h4> - -<p> For pointcuts denoting calls to particular static methods, such as -</p> - -<blockquote><pre> -calls(String, static String valueOf(int)) // deprecated -</pre></blockquote> - -<p> the transformation is easy. Simply make the desired signature -explicit. Instead of catching all calls to any static method that -happens to have the signature <code>String valueOf(int)</code>, catch -calls to that exact method defined in the String class. </p> - -<blockquote><pre> -call(static String String.valueOf(int)) -</pre></blockquote> - -<p> Pointcuts denoting calls to classes of static methods can also be -rewritten with these rules. For example, </p> - -<blockquote><pre> -calls(my.package.*, static * get*(..)) // deprecated -</pre></blockquote> - -<p> should now be written </p> - -<blockquote><pre> -call(static * my.package.*.get*(..)) -</pre></blockquote> - -<h4>Calls to non-static methods</h4> - -<p> Many pointcuts denoting calls to non-static methods can be -fixed the same way that those pointcuts denoting calls to static -methods are fixed. So, -</p> - -<blockquote><pre> -calls(Thread, int getPriority()) // deprecated -</pre></blockquote> - -<p> which denotes all calls to nullary int methods named <code>getPriority</code> -when the called object is an instance of the <code>Thread</code> type, -can almost always be rewritten </p> - -<blockquote><pre> -call(int Thread.getPriority()) -</pre></blockquote> - -<p> which denotes all calls to the nullary int <code>Thread.getPriority()</code> -method. -</p> - -<p> Expanding the signature picks out slightly different join points -than the original two-argument form. This won't matter for most -programs, but in some cases the differences may be noticable. In -particular, the expanded-signature form only picks out those calls -where the called object is statically typed to <code>Thread</code> -when its <code>int getPriority()</code> method is called. If you want -to capture calls to the <code>int Thread.getPriority()</code> method, -regardless of how the called object is statically typed, you shoud use -the different translation: </p> - -<blockquote><PRE> -call(int getPriority()) && target(Thread) -</PRE></blockquote> - -<p> This will capture all call join points of methods with signature -<code>int Thread.getPriority()</code>. </p> - -<p> It will also denote any join points if the Thread type does not -define (possibly abstractly) some <code>int getPriority()</code> -method, though. </p> - - -<h3><a name="adviceInClasses">Removing advice from Class declarations</a></h3> - -<p> The simplest way to remove an advice declaration from a class is -to simply define the advice declaration in an inner aspect. So, -instead of </p> - -<blockquote><pre> -class C { - static before(): executions(C.new()) { ... } // deprecated -} -</pre></blockquote> - -<p> write </p> - -<blockquote><pre> -class C { - static aspect ConstructionProtocol { - static before(): executions(C.new()) { ... } - } -} -</pre></blockquote> - -<p> If your advice doesn't refer to any inner classes or interfaces of -C, you can move the inner aspect out of the class entirely. </p> - -<blockquote><pre> -class C { ... } - -aspect ConstructionProtocol { - static before(): execution(C.new()) { ... } -} -</pre></blockquote> - -<p> Your code will be clearer if you consider the purpose of each -piece of advice when you make this change. It may be that some of the -advice naturally belongs to another aspect, perhaps already existing. -Or it may be that some pieces of advice in a class are associated to -one concern and some to another; in which case more than aspect would -be appropriate. </p> - -<!-- ============================== --> -<hr /> -<h2><a name="pre07b10">Porting pre-0.7beta10 code</a></h2> - -<ul> - <li><a href="#joinPoints">Changing access to thisJoinPoint</a></li> -</ul> - -<p>The following changes are only required when porting code written -prior to the 0.7beta10 release of AspectJ.</p> - - -<h3><a name="joinPoints">Changing access to thisJoinPoint</a></h3> - -<p> In AspectJ 0.7beta10, access to the reflective object -<code>thisJoinPoint</code> substantially changed. The two parts of -this change were the elimination of the <code>runNext()</code> static -method, and the use of an interface hierarchy represent the join point -object. </p> - -<h4><a name="proceed"><code>thisJoinPoint.runNext()</code> to -<code>proceed()</code></a></h4> - -<p> The elimination of the <code>runNext()</code> static method -requires almost no porting work. An automatic replacement of the -string -</p> - -<blockquote><code>thisJoinPoint.runNext</code></blockquote> - -<p> with the string -</p> - -<blockquote><code>proceed</code></blockquote> - -<p> will do the job. However, if any around advice used the -identifier "<code>proceed</code>" as a formal parameter or local -variable, it must be renamed, and if any aspect used it as a field, -then references to the field in around advice should be made explicit -(prefixing the reference with the aspect name or "<code>this</code>", -depending on whether the field is static or not). </p> - -<h4><a name="thisJoinPoint">Using <code>thisJoinPoint</code></a></h4> - -<p> While access to reflective information through -<code>thisJoinPoint</code> is more powerful and regular through its -interface hierarchy, the previous uses must be rewritten. Changing -your code will likely require manual editing, but in doing so your -code should get simpler and cleaner. </p> - -<!-- --> - -<p> Many existing uses of the fields on join points can be re-written -to use one of: -</p> - -<ul> - <li><code>thisJoinPoint.toString()</code></li> - <li><code>thisJoinPoint.toShortString()</code></li> - <li><code>thisJoinPoint.toLongString()</code></li> - <li><code>thisJoinPoint.getSignature().toString()</code></li> - <li><code>thisJoinPoint.getSignature().toShortString()</code></li> - <li><code>thisJoinPoint.getSignature().toLongString()</code></li> -</ul> - -<p>For example: -</p> - -<blockquote><pre> -System.out.println(thisJoinPoint.className + "." + - thisJoinPoint.methodName) -</pre></blockquote> - -<p> can be replaced with -</p> - -<blockquote><code>System.out.println(thisJoinPoint)</code></blockquote> - -<p> or -</p> - -<blockquote><code>System.out.println(thisJoinPoint.getSignature().toShortString())</code></blockquote> - -<p> with comparable behavior. -</p> - -<!-- --> - -<p> Accesses to the parameters field of join points should be changed -as follows. A field access like: -</p> - - -<blockquote><code>thisJoinPoint.parameters</code></blockquote> - -<p> must be changed to: -</p> -<ul> - <li><code>thisJoinPoint.getArgs()</code></li> -</ul> - -<!-- --> - -<p> Accesses to the methodName and className fields of join points -that are not suitable for replacement with a toString method, -should be changed as follows. Field accesses like: -</p> - -<ul> - <li><code>thisJoinPoint.className</code></li> - <li><code>thisJoinPoint.methodName</code></li> -</ul> - -<p> must be changed to: -</p> - -<ul> - <li><code>thisJoinPoint.getSignature().getDeclaringType().getName()</code></li> - <li><code>thisJoinPoint.getSignature().getName()</code></li> -</ul> - -<!-- --> - -<p> Accessses to the parameterNames and parameterTypes fields of -join points, that are not suitable for conversion to one of the -toString() methods should be changed as follows. Field access -like: -</p> - -<ul> - <li><code>thisJoinPoint.parameterNames</code></li> - <li><code>thisJoinPoint.parameterTypes</code></li> -</ul> - -<p> must be changed to: -</p> - -<ul> - <li><code>((CodeSignature)thisJoinPoint.getSignature()).getParameterNames()</code></li> - <li><code>((CodeSignature)thisJoinPoint.getSignature()).getParameterTypes()</code></li> -</ul> - -</body> -</html> |