[[readme-1_1]]
-== AspectJ 1.1 Readme
+== AspectJ 1.1
-[.small]#© Copyright 2002 Palo Alto Research Center, Incorporated, 2003
-Contributors. All rights reserved.#
+_© Copyright 2002 Palo Alto Research Center, Incorporated, 2003
+Contributors. All rights reserved._
This is the initial release of AspectJ 1.1. It includes a small number
of new language features as well as major improvements to the
-[.small]#© Copyright 2003,2004 Contributors. All rights reserved.#
+== AspectJ 1.2
-== AspectJ 1.2 Readme
+_© Copyright 2003,2004 Contributors. All rights reserved._
The definition of the AspectJ language is unchanged in the 1.2 release.
Instead, AspectJ 1.2 provides major improvements to the functionality of
-[.small]#© Copyright 2004 Contributors. All rights reserved.#
+== AspectJ 1.2.1
-== AspectJ 1.2.1 Readme
+_© Copyright 2004 Contributors. All rights reserved._
AspectJ 1.2.1 is largely a bug-fix release and the definition of the
AspectJ language is unchanged from the 1.2.0 release (with the exception
-[.small]#© Copyright 2005 Contributors. All rights reserved.#
+== AspectJ 5
-== AspectJ 5 Readme
+_© Copyright 2005 Contributors. All rights reserved._
AspectJ 5 introduces several important changes to the language and tools
in order to support Java 5 and extend the capabilities of AspectJ in
Some of the other documentation has not been updated for AspectJ 5. For
the latest documentation, see
-http://eclipse.org/aspectj/doc/next/index.html , linked off
-http://eclipse.org/aspectj/docs.php[the AspectJ documentation home page]
-.
+http://eclipse.org/aspectj/doc/next/index.html, linked off
+http://eclipse.org/aspectj/docs.php[the AspectJ documentation home page].
For information on bug fixes in AspectJ 5 v1.5.0, see the
link:changes.html[changes] document.
-[.small]#© Copyright 2006 Contributors. All rights reserved.#
-
== AspectJ 5 v1.5.1 Readme
+_© Copyright 2006 Contributors. All rights reserved._
+
This release is primarily a bug fix and performance / memory usage
release. Over 70 fixes and enhancements have been incorporated since
1.5.0, you can see the list through
-[.small]#© Copyright 2006 Contributors. All rights reserved.#
-
== AspectJ 5 v1.5.2 Readme
+_© Copyright 2006 Contributors. All rights reserved._
+
This release is primarily a bug fix release. It includes approximately
60 fixes and enhancements that have been incorporated since the 1.5.1
release. You can see the full list through
-[.small]#© Copyright 2006 Contributors. All rights reserved.#
-
== AspectJ 5 v1.5.3 Readme
+_© Copyright 2006 Contributors. All rights reserved._
+
This release includes a number of bug fixes and enhancements (over 80).
The full list of resolved issues can be found with
https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=&product=AspectJ&target_milestone=1.5.3&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=[this
-[.small]#© Copyright 2006 Contributors. All rights reserved.#
-
== AspectJ 5 v1.5.4 Readme
+_© Copyright 2006 Contributors. All rights reserved._
+
This release includes a number of bug fixes and enhancements. The full
list of resolved issues can be found with
https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=&product=AspectJ&target_milestone=1.5.4&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=[this
-[.small]#© Copyright 2008 Contributors. All rights reserved.#
+== AspectJ 1.6.0
-== AspectJ v1.6.0 Readme
+_© Copyright 2008 Contributors. All rights reserved._
=== AspectJ v1.6.0 - 23 Apr 2008
-[.small]#© Copyright 2008 Contributors. All rights reserved.#
+== AspectJ 1.6.1
-== AspectJ 1.6.1 Readme
+_© Copyright 2008 Contributors. All rights reserved._
The main themes of AspectJ1.6.1 are better memory usage and faster
weaving. This has been achieved through profiling of the weaving process
-[.small]#© Copyright 2010 Contributors. All rights reserved.#
+== AspectJ 1.6.10
-== AspectJ 1.6.10 Readme
+_© Copyright 2010 Contributors. All rights reserved._
The full list of resolved issues in 1.6.10 is available
https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;bug_status=RESOLVED;bug_status=VERIFIED;bug_status=CLOSED;product=AspectJ;target_milestone=1.6.10;target_milestone=1.6.10M1;target_milestone=1.6.10M2;target_milestone=1.6.10RC1[here]
+_Release info: 1.6.10 available 17-Nov-2010_
+
=== Changes
1.6.10 is primilarily just bug fixes for AspectJ, mainly in the areas of
-[.small]#© Copyright 2010-2011 Contributors. All rights reserved.#
+== AspectJ 1.6.11
-== AspectJ 1.6.11 Readme
+_© Copyright 2010-2011 Contributors. All rights reserved._
The full list of resolved issues in 1.6.11 is available
https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;bug_status=RESOLVED;bug_status=VERIFIED;bug_status=CLOSED;product=AspectJ;target_milestone=1.6.11;[here]
-.
-
-=== 1.6.11 available 15-03-2011
+_Release info: 1.6.11 available 15-Mar-2011_
=== Notable Changes
-[.small]#© Copyright 2010-2011 Contributors. All rights reserved.#
+== AspectJ 1.6.12
-== AspectJ 1.6.12 Readme
+_© Copyright 2010-2011 Contributors. All rights reserved._
The full list of resolved issues in 1.6.12 is available
https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;bug_status=RESOLVED;bug_status=VERIFIED;bug_status=CLOSED;product=AspectJ;target_milestone=1.6.12;[here]
-.
+_Release info:_
-=== 1.6.12 released 18-Oct-2011
-
-=== 1.6.12.RC1 available 3-Oct-2011
-
-=== 1.6.12.M2 available 18-Aug-2011
-
-=== 1.6.12.M1 available 7-Jun-2011
+ * _1.6.12 available 18-Oct-2011_
+ * _1.6.12.RC1 available 3-Oct-2011_
+ * _1.6.12.M2 available 18-Aug-2011_
+ * _1.6.12.M1 available 7-Jun-2011_
=== Notable Changes
-[.small]#© Copyright 2008 Contributors. All rights reserved.#
+== AspectJ 1.6.2
-== AspectJ 1.6.2 Readme
+_© Copyright 2008 Contributors. All rights reserved._
The main theme of AspectJ1.6.2 was improved IDE incremental performance
and a number of changes have gone in to improve how AspectJ and AJDT
-[.small]#© Copyright 2008 Contributors. All rights reserved.#
+== AspectJ 1.6.3
-== AspectJ 1.6.3 Readme
+_© Copyright 2008 Contributors. All rights reserved._
* xref:#split[Split matching/weaving]
* xref:#bugsfixed[Bugs fixed]
-[.small]#© Copyright 2009 Contributors. All rights reserved.#
+== AspectJ 1.6.4
-== AspectJ 1.6.4 Readme
+_© Copyright 2009 Contributors. All rights reserved._
* xref:#compilation[Compilation times]
* xref:#language[Language enhancements]
-[.small]#© Copyright 2009 Contributors. All rights reserved.#
+== AspectJ 1.6.5
-== AspectJ 1.6.5 Readme
+_© Copyright 2009 Contributors. All rights reserved._
[[bugsfixed]]
=== Bugs fixed
-[.small]#© Copyright 2009 Contributors. All rights reserved.#
+== AspectJ 1.6.6
-== AspectJ 1.6.6 Readme
+_© Copyright 2009 Contributors. All rights reserved._
[[bugsfixed]]
=== Bugs fixed
-[.small]#© Copyright 2009 Contributors. All rights reserved.#
+== AspectJ 1.6.7
-== AspectJ 1.6.7 Readme
+_© Copyright 2009 Contributors. All rights reserved._
AspectJ 1.6.7 includes some radical internal changes. These improvements
enable faster compilation, faster binary weaving, faster load time
-[.small]#© Copyright 2009 Contributors. All rights reserved.#
+== AspectJ 1.6.8
-== AspectJ 1.6.8 Readme
+_© Copyright 2009 Contributors. All rights reserved._
The first sentence in the 1.6.7 readme was 'AspectJ 1.6.7 includes some
radical internal changes.'
-[.small]#© Copyright 2010 Contributors. All rights reserved.#
+== AspectJ 1.6.9
-== AspectJ 1.6.9 Readme
+_© Copyright 2010 Contributors. All rights reserved._
The full list of resolved issues in 1.6.9 is available
https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;bug_status=RESOLVED;bug_status=VERIFIED;bug_status=CLOSED;product=AspectJ;target_milestone=1.6.9;target_milestone=1.6.9M1;target_milestone=1.6.9M2;target_milestone=1.6.9RC1[here]
-[.small]#© Copyright 2011 Contributors. All rights reserved.#
+== AspectJ 1.7.0
-== AspectJ 1.7.0 Readme
+_© Copyright 2011 Contributors. All rights reserved._
The full list of resolved issues in 1.7.0 is available
https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;bug_status=RESOLVED;bug_status=VERIFIED;bug_status=CLOSED;product=AspectJ;target_milestone=1.7.0;[here]
-.
+_Release info:_
-* 1.7.0 available 2-Jul-2012
-* 1.7.0.RC1 available 25-May-2012
-* 1.7.0.M1 available 16-Dec-2011
+* _1.7.0 available 2-Jul-2012_
+* _1.7.0.RC1 available 25-May-2012_
+* _1.7.0.M1 available 16-Dec-2011_
=== Notable Changes
-[.small]#© Copyright 2011 Contributors. All rights reserved.#
+== AspectJ 1.7.1
-== AspectJ 1.7.1 Readme
+_© Copyright 2011 Contributors. All rights reserved._
The full list of resolved issues in 1.7.1 is available
https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;bug_status=RESOLVED;bug_status=VERIFIED;bug_status=CLOSED;product=AspectJ;target_milestone=1.7.1;[here]
-.
-
-* 1.7.1 available 6-Sep-2012
+_Release info: 1.7.1 available 6-Sep-2012_
=== Changes
-[.small]#© Copyright 2011 Contributors. All rights reserved.#
+== AspectJ 1.7.2
-== AspectJ 1.7.2 Readme
+_© Copyright 2011 Contributors. All rights reserved._
The full list of resolved issues in 1.7.2 is available
https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;bug_status=RESOLVED;bug_status=VERIFIED;bug_status=CLOSED;product=AspectJ;target_milestone=1.7.2;[here]
-.
-
-* 1.7.2 available 13-Feb-2013
+_Release info: 1.7.2 available 13-Feb-2013_
=== Fixes:
-[.small]#© Copyright 2011 Contributors. All rights reserved.#
+== AspectJ 1.7.3
-== AspectJ 1.7.3 Readme
+_© Copyright 2011 Contributors. All rights reserved._
-Available 13-Jun-2013
+_Release info: 1.7.3 available 13-Jun-2013_
The list of resolved issues in 1.7.3 is available
https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;bug_status=RESOLVED;bug_status=VERIFIED;bug_status=CLOSED;product=AspectJ;target_milestone=1.7.3;[here]
-
-.
-[.small]#© Copyright 2013 Contributors. All rights reserved.#
+== AspectJ 1.7.4
-== AspectJ 1.7.4 Readme
-
-Available 24-Oct-2013
+_© Copyright 2013 Contributors. All rights reserved._
The list of resolved issues in 1.7.4 is available
https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;bug_status=RESOLVED;bug_status=VERIFIED;bug_status=CLOSED;product=AspectJ;target_milestone=1.7.4;[here]
-.
+_Release info: 1.7.4 available 24-Oct-2013_
*Notes*
-[.small]#© Copyright 2014 Contributors. All rights reserved.#
+== AspectJ 1.8.0
-== AspectJ 1.8.0 Readme
+_© Copyright 2014 Contributors. All rights reserved._
The full list of resolved issues in 1.8.0 is available
https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;bug_status=RESOLVED;bug_status=VERIFIED;bug_status=CLOSED;product=AspectJ;target_milestone=1.8.0.M1;target_milestone=1.8.0;[here]
-.
+_Release info:_
-* 1.8.0 available 17-Apr-2014
-* 1.8.0.RC1 available 18-Mar-2014
-* 1.8.0.M1 available 29-Jul-2013
+* _1.8.0 available 17-Apr-2014_
+* _1.8.0.RC1 available 18-Mar-2014_
+* _1.8.0.M1 available 29-Jul-2013_
=== Notable changes
-[.small]#© Copyright 2014 Contributors. All rights reserved.#
+== AspectJ 1.8.1
-== AspectJ 1.8.1 Readme
+_© Copyright 2014 Contributors. All rights reserved._
The full list of resolved issues in 1.8.1 is available
https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;bug_status=RESOLVED;bug_status=VERIFIED;bug_status=CLOSED;product=AspectJ;target_milestone=1.8.1;[here]
-.
-
-* 1.8.1 available 20-Jun-2014
+_Release info: 1.8.1 available 20-Jun-2014_
=== Notable changes
-[.small]#© Copyright 2016 Contributors. All rights reserved.#
+== AspectJ 1.8.10
-== AspectJ 1.8.10 Readme
+_© Copyright 2016 Contributors. All rights reserved._
The full list of resolved issues in 1.8.10 is available
https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;bug_status=RESOLVED;bug_status=VERIFIED;bug_status=CLOSED;product=AspectJ;target_milestone=1.8.10;[here]
-.
-
-* 1.8.10 available 9-Dec-2016
+_Release info: 1.8.10 available 9-Dec-2016_
=== Notable changes
-[.small]#© Copyright 2017 Contributors. All rights reserved.#
+== AspectJ 1.8.11
-== AspectJ 1.8.11 Readme
+_© Copyright 2017 Contributors. All rights reserved._
+
+_Release info: 1.8.11 available 26-Sep-2017_
This release is a small compatibility release to improve the behaviour
of the AspectJ 1.8 line on JDK9. Importantly it includes a change that
annotation retention there may still be issues. If you experience
problems or need to do actual weaving on JDK9, please use AspectJ9
instead.
-
-* 1.8.11 available 26-Sep-2017
-[.small]#© Copyright 2014 Contributors. All rights reserved.#
+== AspectJ 1.8.2
-== AspectJ 1.8.2 Readme
+_© Copyright 2014 Contributors. All rights reserved._
The full list of resolved issues in 1.8.2 is available
https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;bug_status=RESOLVED;bug_status=VERIFIED;bug_status=CLOSED;product=AspectJ;target_milestone=1.8.2;[here]
-.
-
-* 1.8.2 available 14-Aug-2014
+_Release info: 1.8.2 available 14-Aug-2014_
=== Notable changes
-[.small]#© Copyright 2014 Contributors. All rights reserved.#
+== AspectJ 1.8.3
-== AspectJ 1.8.3 Readme
+_© Copyright 2014 Contributors. All rights reserved._
The full list of resolved issues in 1.8.3 is available
https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;bug_status=RESOLVED;bug_status=VERIFIED;bug_status=CLOSED;product=AspectJ;target_milestone=1.8.3;[here]
-.
-
-* 1.8.3 available 22-Oct-2014
+_Release info: 1.8.3 available 22-Oct-2014_
=== Notable changes
-[.small]#© Copyright 2014 Contributors. All rights reserved.#
+== AspectJ 1.8.4
-== AspectJ 1.8.4 Readme
+_© Copyright 2014 Contributors. All rights reserved._
The full list of resolved issues in 1.8.4 is available
https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;bug_status=RESOLVED;bug_status=VERIFIED;bug_status=CLOSED;product=AspectJ;target_milestone=1.8.4;[here]
-.
-
-* 1.8.4 available 6-Nov-2014
+_Release info: 1.8.4 available 6-Nov-2014_
=== Notable changes
-[.small]#© Copyright 2015 Contributors. All rights reserved.#
+== AspectJ 1.8.5
-== AspectJ 1.8.5 Readme
+_© Copyright 2015 Contributors. All rights reserved._
The full list of resolved issues in 1.8.5 is available
https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;bug_status=RESOLVED;bug_status=VERIFIED;bug_status=CLOSED;product=AspectJ;target_milestone=1.8.5;[here]
-.
-
-* 1.8.5 available 28-Jan-2015
+_Release info: 1.8.5 available 28-Jan-2015_
=== Notable changes
-[.small]#© Copyright 2015 Contributors. All rights reserved.#
+== AspectJ 1.8.6
-== AspectJ 1.8.6 Readme
+_© Copyright 2015 Contributors. All rights reserved._
+
+_Release info: 1.8.6 available 5-Jun-2015_
The full list of resolved issues in 1.8.6 is available
https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;bug_status=RESOLVED;bug_status=VERIFIED;bug_status=CLOSED;product=AspectJ;target_milestone=1.8.6;[here]
-
-.
-
-* 1.8.6 available 5-Jun-2015
-[.small]#© Copyright 2015 Contributors. All rights reserved.#
+== AspectJ 1.8.7
-== AspectJ 1.8.7 Readme
+_© Copyright 2015 Contributors. All rights reserved._
The full list of resolved issues in 1.8.7 is available
https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;bug_status=RESOLVED;bug_status=VERIFIED;bug_status=CLOSED;product=AspectJ;target_milestone=1.8.7;[here]
-.
-
-* 1.8.7 available 9-Sep-2015
+_Release info: 1.8.7 available 9-Sep-2015_
=== Notable changes
-[.small]#© Copyright 2016 Contributors. All rights reserved.#
+== AspectJ 1.8.8
-== AspectJ 1.8.8 Readme
+_© Copyright 2016 Contributors. All rights reserved._
The full list of resolved issues in 1.8.8 is available
https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;bug_status=RESOLVED;bug_status=VERIFIED;bug_status=CLOSED;product=AspectJ;target_milestone=1.8.8;[here]
-.
-
-* 1.8.8 available 7-Jan-2016
+_Release info: 1.8.8 available 7-Jan-2016_
=== Notable changes
-[.small]#© Copyright 2016 Contributors. All rights reserved.#
+== AspectJ 1.8.9
-== AspectJ 1.8.9 Readme
+_© Copyright 2016 Contributors. All rights reserved._
The full list of resolved issues in 1.8.9 is available
https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;bug_status=RESOLVED;bug_status=VERIFIED;bug_status=CLOSED;product=AspectJ;target_milestone=1.8.9;[here]
-.
-
-* 1.8.9 available 14-Mar-2016
+_Release info: 1.8.9 available 14-Mar-2016_
=== Notable changes
-[.small]#© Copyright 2018 Contributors. All rights reserved.#
+== AspectJ 1.9.0
+
+_© Copyright 2018 Contributors. All rights reserved._
The full list of resolved issues in 1.9.0 is available
https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&f0=OP&f1=OP&f3=CP&f4=CP&j1=OR&list_id=16866879&product=AspectJ&query_format=advanced&target_milestone=1.9.0[here]
-.
-
-== AspectJ 1.9.0
+_Release info: 1.9.0 available 2-Apr-2018_
=== Improved runtime interface
New factory methods have been added to the AspectJ runtime. This is an
-attempt to more optimally create thisJoinPoint and
-thisEnclosingJoinPoint objects. The generated code that invokes these
-now also uses the ability for the LDC bytecode instruction to load class
+attempt to more optimally create `thisJoinPoint` and
+`thisEnclosingJoinPoint` objects. The generated code that invokes these
+now also uses the ability for the `LDC` bytecode instruction to load class
constants directly (this replaces what was happening previously where
-generated code referenced string classnames and classloading was being
-done from the aspectj runtime as the woven application was starting).
+generated code referenced string class names and class-loading was being
+done from the AspectJ runtime as the woven application was starting).
-This is turned on by using -Xajruntimetarget:1.9. This option was used
+This is turned on by using `-Xajruntimetarget:1.9`. This option was used
previously to enable users to target an old runtime if they knew that
old runtime is all that was available at some deployed target. The new
generation mechanism is not the default, not until it has had a bit more
more instructions involved in preparing the data for invocation of the
new joinpoint factory methods. It is possible if you have a lot of
joinpoints that we might blow the 64k instruction limit for the
-ajc$preClinit method (where the factory invocation code is generated).
+`ajc$preClinit` method (where the factory invocation code is generated).
Please provide feedback if this happens to you!
In anticipation of not all build plugins supporting that
--Xajruntimetarget option, you can now specify these kinds of option in
-the ASPECTJ_OPTS environment variable. Set that in your environment:
+`-Xajruntimetarget` option, you can now specify these kinds of option in
+the `ASPECTJ_OPTS` environment variable. Set that in your environment:
[source, text]
....
And it should get picked up by AspectJ when it runs.
-* 1.9.0 available 2-Apr-2018
-
== AspectJ 1.9.0.RC4
-Primary changes in RC4 are to add support for <compilerArg> in the Ant
+_Release info: 1.9.0.RC4 available 21-Feb-2018_
+
+Primary changes in RC4 are to add support for `<compilerArg>` in the Ant
task. This enables users of the Ant task to pass in options supported by
the underlying AspectJ but not yet surfaced elsewhere. Particularly
useful with Java9 which includes a number of module related commands.
-For example, here is an iajc usage with compilerArg that is passing
---add-modules java.xml.bind:
+For example, here is an `iajc` usage with `compilerArg` that is passing
+`--add-modules java.xml.bind`:
[source, xml]
....
<iajc destdir="bin" failonerror="true"
- showWeaveInfo="true" source="1.9" target="1.9"
- debug="true" fork="true" maxmem="256m">
- <compilerArg value="--add-modules"/>
- <compilerArg value="java.xml.bind"/>
+ showWeaveInfo="true" source="1.9" target="1.9"
+ debug="true" fork="true" maxmem="256m">
+
+ <compilerArg value="--add-modules"/>
+ <compilerArg value="java.xml.bind"/>
<src path="src" />
<classpath>
- <pathelement location="${aspectj.home}/lib/aspectjrt.jar"/>
+ <pathelement location="${aspectj.home}/lib/aspectjrt.jar"/>
</classpath>
+
</iajc>
....
-1.9.0.RC4 available 21-Feb-2018
-
== AspectJ 1.9.0.RC3
+_Release info: 1.9.0.RC3 available 5-Feb-2018_
+
Primary changes in RC3 are to upgrade JDT and pickup all the fixes for
Java9 that have gone into it over the last few months.
-1.9.0.RC3 available 5-Feb-2018
-
== AspectJ 1.9.0.RC2
-* 1.9.0.RC2 available 9-Nov-2017
+_Release info: 1.9.0.RC2 available 9-Nov-2017_
Key change in 1.9.0.RC2 is actually to be more tolerant of JDK10. The
version handling has been somewhat overhauled so AspectJ 9 will behave
== AspectJ 1.9.0.RC1
-* 1.9.0.RC1 available 20-Oct-2017
+_Release info: 1.9.0.RC1 available 20-Oct-2017_
This is the first release candidate of AspectJ 1.9.0 - the version of
AspectJ to be based on Java9. It includes a recent version of the
AspectJ can now be used with the new module system available in Java9.
The key jars in AspectJ have been given automatic module names. The
-automatic module name is org.aspectj.runtime for the aspectjrt module:
+automatic module name is `org.aspectj.runtime` for the `aspectjrt` module:
[source, text]
....
org.aspectj.runtime file:///<pathto>/lib/aspectjrt.jar automatic
....
-And similarly org.aspectj.weaver and org.aspectj.tools for aspectjweaver
-and aspectjtools respectively:
+And similarly `org.aspectj.weaver` and `org.aspectj.tools` for `aspectjweaver`
+and `aspectjtools`, respectively:
[source, text]
....
...
....
- +
- +
-
=== Building woven modules
-AspectJ understands module-info.java source files and building modules
+AspectJ understands `module-info.java` source files and building modules
that include aspects. Here is an example:
[source, java]
....
-module-info.java
+// module-info.java
module demo {
- exports pkg;
- requires org.aspectj.runtime;
+ exports pkg;
+ requires org.aspectj.runtime;
}
-
-pkg/Demo.java
+// pkg/Demo.java
package pkg;
public class Demo {
- public static void main(String[] argv) {
- System.out.println("Demo running");
- }
+ public static void main(String[] argv) {
+ System.out.println("Demo running");
+ }
}
-
-otherpkg/Azpect.java
+// otherpkg/Azpect.java
package otherpkg;
public aspect Azpect {
- before(): execution(* *(..)) && !within(Azpect) {
- System.out.println("Azpect running");
- }
+ before(): execution(* *(..)) && !within(Azpect) {
+ System.out.println("Azpect running");
+ }
}
....
...
....
-Wait, that failed! Yes, aspectjrt.jar (which includes the required
-org.aspectj.weaver module) wasn't supplied. We need to pass it on the
+Wait, that failed! Yes, `aspectjrt.jar` (which includes the required
+`org.aspectj.weaver` module) wasn't supplied. We need to pass it on the
module-path:
[source, text]
That's it!
- +
- +
-
=== Binary weaving with modules
-A module is really just a jar with a module-info descriptor. As such you
-can simply pass a module on the inpath and binary weave it with other
+A module is really just a jar with a _module-info_ descriptor. As such, you
+can simply pass a module on the _inpath_ and binary-weave it with other
aspects. Take the module we built above, let's weave into it again:
[source, java]
package extra;
public aspect AnotherAzpect {
- before(): execution(* *(..)) && !within(*Azpect) {
- System.out.println("AnotherAzpect running");
- }
+ before(): execution(* *(..)) && !within(*Azpect) {
+ System.out.println("AnotherAzpect running");
+ }
}
....
$ ajc -inpath demo.jar AnotherAzpect.java -outjar newdemo.jar
....
-Notice how there was no complaint here that the org.aspectj.runtime
+Notice how there was no complaint here that the `org.aspectj.runtime`
module hadn't been passed in. That is because inpath was being used
which doesn't treat specified jars as modules (and so does not check
-dependencies). There is no module-inpath right now.
+dependencies). There is no _module-inpath_ right now.
-Because the new jar produced includes the compiled aspect, the
-module-info specification inside is still correct, so we can run it
+Because the new JAR produced includes the compiled aspect, the
+_module-info_ specification inside is still correct, so we can run it
exactly as before:
[source, text]
=== Faster Spring AOP
-Dave Syer recently created a series of benchmarks for checking the speed
-of Spring-AspectJ: https://github.com/dsyer/spring-boot-aspectj
+Dave Syer recently created a https://github.com/dsyer/spring-boot-aspectj[series of benchmarks] for checking the speed
+of Spring-AspectJ.
Here we can see the numbers for AspectJ 1.8.11 (on an older Macbook
Pro):
* Eclipse JDT Java 9 support is still being actively worked on and lots
of fixes will be coming through over the next few months and included in
AspectJ 1.9.X revisions.
-* AspectJ does not currently modify module-info.java files. An aspect
+
+* AspectJ does not currently modify `module-info.java` files. An aspect
from one module applying to code in another module clearly introduces a
dependency between those two modules. There is no reason - other than
time! - that this can't be done.
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=526244[Issue 526244])
+
* Related to that AspectJ, on detection of aspects should be able to
-automatically introduce the requires org.aspectj.runtime to the
-module-info. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=526242[Issue
+automatically introduce the `requires org.aspectj.runtime` to the
+_module-info_. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=526242[Issue
526242])
-* Module aware variants of AspectJ paths: --module-inpath,
---module-aspectpath.
-(https://bugs.eclipse.org/bugs/show_bug.cgi?id=526243[Issue 526243])
- +
- +
+* Module-aware variants of AspectJ paths: `--module-inpath`,
+`--module-aspectpath`.
+(https://bugs.eclipse.org/bugs/show_bug.cgi?id=526243[Issue 526243])
-[.small]#© Copyright 2018 Contributors. All rights reserved.#
+== AspectJ 1.9.1
+
+_© Copyright 2018 Contributors. All rights reserved._
The full list of resolved issues in 1.9.1 is available
https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&f0=OP&f1=OP&f3=CP&f4=CP&j1=OR&list_id=16866879&product=AspectJ&query_format=advanced&target_milestone=1.9.1[here]
-.
-
-== AspectJ 1.9.1
+_Release info: 1.9.1 available 20-Apr-2018_
=== Java 10 support
AspectJ has updated to a recent JDT compiler version (commit
#abe06abe4ce1 - 9-Apr-2018). With this update it now supports Java10.
-This means you can use the 'var' support. A simple example of combining
+This means you can use the `var` support. A simple example of combining
var with an aspect:
[source, java]
....
public class Code3 {
- public static void main(String []argv) {
- var x = "hello";
- System.out.println(x.getClass());
- }
+ public static void main(String []argv) {
+ var x = "hello";
+ System.out.println(x.getClass());
+ }
}
aspect X {
- before(): call(* *.getClass()) && target(String) {
- System.out.println(thisJoinPointStaticPart);
- }
+ before(): call(* *.getClass()) && target(String) {
+ System.out.println(thisJoinPointStaticPart);
+ }
}
....
-
-Available: 1.9.1 available 20-Apr-2018
-
- +
- +
-[.small]#© Copyright 2018 Contributors. All rights reserved.#
+== AspectJ 1.9.2
+
+_© Copyright 2018 Contributors. All rights reserved._
The full list of resolved issues in 1.9.2 is available
https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&f0=OP&f1=OP&f3=CP&f4=CP&j1=OR&list_id=16866879&product=AspectJ&query_format=advanced&target_milestone=1.9.2[here]
-.
-
-== AspectJ 1.9.2
-
=== Java 11 support
AspectJ now supports Java11. It has been updated to a more recent JDT
compiler that supports Java 11 (JDTCore #6373b82afa49b).
Available: 1.9.2 available Oct-2018
-
- +
- +
-[.small]#© Copyright 2018 Contributors. All rights reserved.#
+== AspectJ 1.9.3
+
+_© Copyright 2018 Contributors. All rights reserved._
The full list of resolved issues in 1.9.3 is available
https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&f0=OP&f1=OP&f3=CP&f4=CP&j1=OR&list_id=16866879&product=AspectJ&query_format=advanced&target_milestone=1.9.3[here]
-.
+_Release info: 1.9.3 available 4-Apr-2019_
AspectJ 1.9.3 supports Java12. Java12 introduces the new switch
expression syntax, but you must activate support for that via an
---enable-preview flag when using the compiler and attempting to run the
-resultant classes: Here is Switch3.java:
+`--enable-preview` flag when using the compiler and attempting to run the
+resultant classes: Here is `Switch3.java`:
[source, java]
....
-// =========8<=========
public class Switch3 {
- public static void main(String[] argv) {
- System.out.println(one(Color.R));
- System.out.println(one(Color.G));
- System.out.println(one(Color.B));
- System.out.println(one(Color.Y));
- }
-
- public static int one(Color color) {
- int result = switch(color) {
- case R -> foo(0);
- case G -> foo(1);
- case B -> foo(2);
- default -> foo(3);
- };
- return result;
- }
-
- public static final int foo(int i) {
- return i+1;
- }
+ public static void main(String[] argv) {
+ System.out.println(one(Color.R));
+ System.out.println(one(Color.G));
+ System.out.println(one(Color.B));
+ System.out.println(one(Color.Y));
+ }
+
+ public static int one(Color color) {
+ int result = switch(color) {
+ case R -> foo(0);
+ case G -> foo(1);
+ case B -> foo(2);
+ default -> foo(3);
+ };
+ return result;
+ }
+
+ public static final int foo(int i) {
+ return i+1;
+ }
}
enum Color {
- R, G, B, Y;
+ R, G, B, Y;
}
aspect X {
- int around(): call(* foo(..)) {
- return proceed()*3;
- }
+ int around(): call(* foo(..)) {
+ return proceed()*3;
+ }
}
-// =========8<=========
....
Compile it with:
9
12
....
-
-Available: 1.9.3.RC1 available 7-Mar-2019
-
- +
- +
-[.small]#© Copyright 2019 Contributors. All rights reserved.#
-
== AspectJ 1.9.4
+_© Copyright 2019 Contributors. All rights reserved._
+
The full list of resolved issues in 1.9.4 is available
https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&f0=OP&f1=OP&f3=CP&f4=CP&j1=OR&list_id=16866879&product=AspectJ&query_format=advanced&target_milestone=1.9.4[here]
-.
+_Release info: 1.9.4 available 10-May-2019_
AspectJ 1.9.4 has a couple of important fixes in it:
* Due to the new maven build process being used to build release
-artifacts for the first time, there were errors in the aspectjweaver jar
+artifacts for the first time, there were errors in the _aspectjweaver_ JAR
that affected the ability to use it on the command line as an agent,
this is now fixed.
-* A number of users were noticing a ClassCastException problem, which I
+
+* A number of users were noticing a `ClassCastException` problem, which I
believe was due to trying to run AspectJ on one level of the JDK whilst
-targeting another. This can happen quite easily in eclipse if running
+targeting another. This can happen quite easily in Eclipse if running
your Eclipse on Java 8 but developing projects targeting Java 11. The
class cast is because Java8 couldn't understand the packaging of system
-classes post Java9 and so couldn't find java.lang.Object. This has now
+classes post Java9 and so couldn't find `java.lang.Object`. This has now
all been tidied up and should work much better. More details in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=546807[546807], thanks to
Denys Khanzhyiev for some tips on getting to the right solution.
-
-Available: 1.9.4 available 10-May-2019
-
- +
- +
-[.small]#© Copyright 2019 Contributors. All rights reserved.#
-
== AspectJ 1.9.5
+_© Copyright 2019 Contributors. All rights reserved._
+
The full list of resolved issues in 1.9.5 is available
https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&f0=OP&f1=OP&f3=CP&f4=CP&j1=OR&list_id=16866879&product=AspectJ&query_format=advanced&target_milestone=1.9.5[here]
-.
+_Release info: 1.9.5 available 28-Nov-2019_
AspectJ 1.9.5 supports Java13. Java13 introduces text blocks, but you
-must activate support for that via an --enable-preview flag when using
+must activate support for that via an `--enable-preview` flag when using
the compiler and attempting to run the resultant classes: Here is
-Code.java:
+`Code.java`:
[source, java]
....
-// =======8<=========
public class Code {
- public static void main(String[] argv) {
- }
+ public static void main(String[] argv) {}
static aspect X {
before(): execution(* Code.main(..)) {
}
}
-// =========8<=========
....
Compile it with:
multiple
lines
....
-
-Available: 1.9.5 available 28-Nov-2019
-
- +
- +
-[.small]#© Copyright 2020 Contributors. All rights reserved.#
-
== AspectJ 1.9.6
+_© Copyright 2020 Contributors. All rights reserved._
+
The full list of resolved issues in 1.9.6 is available
https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&f0=OP&f1=OP&f3=CP&f4=CP&j1=OR&list_id=16866879&product=AspectJ&query_format=advanced&target_milestone=1.9.6[here]
-.
+_Release info: 1.9.6 available 22-Jul-2020_
AspectJ 1.9.6 supports Java14. Java14 introduces records, but you must
-activate support for that via an --enable-preview flag when using the
-compiler and attempting to run the resultant classes: Here is Code.java:
+activate support for that via an `--enable-preview` flag when using the
+compiler and attempting to run the resultant classes: Here is `Code.java`:
[source, java]
....
-// =======8<=========
public record Person(String firstName, String lastName, int age) {}
-// =======8<=========
-// =======8<=========
public class UsingPersonRecord {
public static void main(String[] argv) {
Person p = new Person("A","B",99);
System.out.println(p.firstName());
}
}
-// =======8<=========
-// =======8<=========
public aspect TraceRecordComponents {
before(): execution(public * *()) {
System.out.println(thisJoinPointStaticPart);
}
}
-// =======8<=========
....
Compile it with:
execution(String Person.firstName())
A
....
-
-Available: 1.9.6 available 22-Jul-2020
-
- +
- +
-[.small]#© Copyright 2021 Contributors. All rights reserved.#
-
== AspectJ 1.9.7
+_© Copyright 2021 Contributors. All rights reserved._
+
+_Release info: 1.9.7 available 24-Jun-2021_
+
AspectJ (binaries, source code, documentation) is now distributed under
the https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt[Eclipse
Public License v 2.0].
-Please note that going forward Bugzilla for issue management is
-deprecated and new issues should be filed as
+Please note, that going forward Bugzilla for issue management is
+deprecated, and new issues should be filed as
https://github.com/eclipse/org.aspectj/issues/new[GitHub issues]. The
list of issues addressed for 1.9.7 can be found
https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&f0=OP&f1=OP&f3=CP&f4=CP&j1=OR&list_id=16866879&product=AspectJ&query_format=advanced&target_milestone=1.9.7[here
* sealed classes (preview 15, preview 16)
For features marked as preview on a given JDK, you need to compile with
-ajc --enable-preview and run with java --enable-preview on that JDK.
+`ajc --enable-preview` and run with `java --enable-preview on` that JDK.
Please note that you cannot run code compiled with preview features on
any other JDK than the one used for compilation. For example, records
Please note that if you want to use load-time weaving on Java 16+, the
weaving agent collides with https://openjdk.java.net/jeps/396[JEP 396
(Strongly Encapsulate JDK Internals by Default)]. Therefore, you need to
-set the JVM parameter --add-opens java.base/java.lang=ALL-UNNAMED in
+set the JVM parameter `--add-opens java.base/java.lang=ALL-UNNAMED` in
order to enable aspect weaving. This is due to the fact that the weaver
uses internal APIs for which we have not found an adequate replacement
yet when defining classes in different classloaders.
* Remove legacy JRockit support.
* Support Windows 10 and Windows Server 2016/2019 in installer. Those
versions were not detected until now, which led to bogus Windows batch
-files forwarding only 9 AJC parameters to the Java process via %1 %2 %3
-%4 %5 %6 %7 %8 %9 instead of %*.
+files forwarding only 9 AJC parameters to the Java process via `%1 %2 %3
+%4 %5 %6 %7 %8 %9` instead of `%*`.
* AJdoc (AspectJ's javadoc generator add-on for aspects) now supports
the JDK 16 javadoc generator.
-* Fix serialVersionUID initialization for Java 9+
+* Fix `serialVersionUID` initialization for Java 9+
* AJC (AspectJ Compiler) usage texts sometimes used to be printed twice
and they were printed too often, e.g. on top of every compile error.
This has been fixed. Furthermore, the partly outdated usage text is now
been relocated.
* Fix sample code formatting issues (indentation) throughout the
documentation.
-
-Available: 1.9.7 available 24-Jun-2021
-[.small]#© Copyright 1998-2002 Palo Alto Research Center Incorporated
-2003-2008 Contributors. All rights reserved.#
-
== Changes in AspectJ
+_© Copyright 1998-2002 Palo Alto Research Center Incorporated
+2003-2008 Contributors. All rights reserved._
+
* xref:#_1_6_0[1.6.0] (released 2008-04)
* xref:#_1_5_4[1.5.4] (released 2007-12)
* xref:#_1_5_3[1.5.3] (released 2006-11)
** ...
* Limitations:
** AJBrowser is currently an undocumented demonstration application. To
-use it type: +
-> ajbrowser <lst file1> <lst file2> ...
+use it type:
++
+[source, text]
+....
+ajbrowser <lst file1> <lst file2> ...
+....
=== Emacs Support: aspectj-mode and AJDEE
** Build configuration file editor added.
* Limitations:
** AJBrowser is currently an undocumented demonstration application. To
-use it type: +
-> ajbrowser <lst file1> <lst file2> ...
+use it type:
++
+[source, text]
+....
+ajbrowser <lst file1> <lst file2> ...
+....
=== Aspectj-mode and AJDEE: AspectJ support in Emacs
-[.small]#© Copyright 1998-2002 Palo Alto Research Center Incorporated,
-2003-2004 Contributors. All rights reserved.#
-
== AspectJ Porting Notes
+_© Copyright 1998-2002 Palo Alto Research Center Incorporated,
+2003-2004 Contributors. All rights reserved._
+
* xref:#pre-1_2[Pre-1.2 code]
* xref:#pre-1_1[Pre-1.1 code]
* xref:#pre-1_0_4[Pre-1.0.4 code]
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
-
-____
-calls executions gets sets handlers initializations
-staticinitializations
-____
+your programs is easy: Just go through and whever you see uses of the
+pointcuts `calls, executions, gets, sets, handlers, initializations,
+staticinitializations`.
-Just take off the final "s", to make one of
-
-____
-call execution get set handler initialization staticinitialization
-____
+Just take off the final "s", to make one of `call, execution, get, set, handler, initialization, staticinitialization`.
Often, there will be other changes you should make for each of these
pointcuts, but as for the name, just take off the "s".
[source, java]
....
aspect Singleton {
- private C theC = null;
+ private C theC = null;
- C around(): call(C.new(..)) {
- if (c == null) theC = proceed();
- return theC;
- }
+ C around(): call(C.new(..)) {
+ if (c == null) theC = proceed();
+ return theC;
+ }
}
....
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
-
-____
-args this target
-____
-
+AspectJ 1.0, all state accesses now use only three pointcuts `args, this, target`
which pick out argument values, the currently executing object, and the
target object of a method call or field operation, respectively.
[source, java]
....
aspect A {
- before(Frame f, Color c): gets(Color f.color)[c] { ... }
+ 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;
- ...
- }
+ before(Frame f):
+ target(f) && get(Color Frame.color) && !within(A)
+ {
+ Color c = f.color;
+ // ...
+ }
}
....
[source, java]
....
aspect A {
- after(Frame f, Color c) returning (): gets(Color f.color)[c] { ... }
+ 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);
- ...
- }
+ void around(Frame f):
+ target(f) && get(Color Frame.color) && !within(A)
+ {
+ Color c = f.color;
+ proceed(f);
+ // ...
+ }
}
....
[source, java]
....
pointcut stateChanges(Subject s):
- instanceof(s) && receptions(void Button.click());
+ instanceof(s) && receptions(void Button.click());
+
// ==>
+
pointcut stateChange(Subject s):
- target(s) && call(void Button.click());
+ target(s) && call(void Button.click());
....
In all other cases, `instanceof` referred to the currently executing
[source, java]
....
before(A myA): hasaspect(myA) {
- myA.checkStatus();
+ myA.checkStatus();
}
// ==>
before(): if(A.hasAspect()) {
- A myA = A.aspectOf();
- myA.checkStatus();
+ A myA = A.aspectOf();
+ myA.checkStatus();
}
....
The withinall poinctut is no longer defined. You can use a combination
of within and the xref:#_1_0a1-subtypes-to-plus[new subtypes operator],
-+, instead. You'll save two characters and be using a simpler and more
+`+`, instead. You'll save two characters and be using a simpler and more
orthogonal language.
[source, java]
[source, java]
....
public void (subtypes(Target0 || Target1)).accept(Visitor v) {
- v.visit(this);
+ v.visit(this);
}
// ==>
public void (Target0+ || Target1+).accept(Visitor v) {
- v.visit(this);
+ v.visit(this);
}
....
[source, java]
....
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;
+ char result;
+ try { result = proceed(); }
+ catch (Exception e) {
+ throw new java.io.CharConversionException();
+ }
+ if (result == 0) throw new java.io.CharConversionException();
+ return result;
}
....
[source, java]
....
aspect A {
- before(): call(void main(..)) {
- throw new RuntimeException();
- }
- after() throwing(RuntimeException e): call(void main(..)) {
- System.err.println("caught you!");
- }
+ before(): call(void main(..)) {
+ throw new RuntimeException();
+ }
+ after() throwing(RuntimeException e): call(void main(..)) {
+ System.err.println("caught you!");
+ }
}
....
[source, java]
....
aspect A {
- after() throwing(RuntimeException e): call(void main(..)) {
- System.err.println("missed you!");
- }
- before(): call(void main(..)) {
- throw new RuntimeException();
- }
+ after() throwing(RuntimeException e): call(void main(..)) {
+ System.err.println("missed you!");
+ }
+ before(): call(void main(..)) {
+ throw new RuntimeException();
+ }
}
....
[source, java]
....
before() executions(* myMethod()) {
- ExecutionJoinPoint jp = (ExecutionJoinPoint)thisJoinPoint;
- CodeSignature jp = (CodeSignature)jp.getSignature();
- System.err.println(jp.getParameters());
- System.err.println(jp.getParameterNames());
+ ExecutionJoinPoint jp = (ExecutionJoinPoint)thisJoinPoint;
+ CodeSignature jp = (CodeSignature)jp.getSignature();
+ System.err.println(jp.getParameters());
+ System.err.println(jp.getParameterNames());
}
....
[source, java]
....
before() executions(* myMethod()) {
- JoinPoint jp = thisJoinPoint;
- CodeSignature jp = (CodeSignature)jp.getSignature();
- System.err.println(jp.getArgs());
- System.err.println(jp.getParameterNames());
+ JoinPoint jp = thisJoinPoint;
+ CodeSignature jp = (CodeSignature)jp.getSignature();
+ System.err.println(jp.getArgs());
+ System.err.println(jp.getParameterNames());
}
....
[source, java]
....
Point +implements Serializable;
-=>
+// ==>
declare parents: Point implements Serializable;
....
[source, java]
....
MyButton +extends ButtonAdaptor;
-=>
+// ==>
declare parents: MyButton extends ButtonAdaptor;
....
[source, java]
....
class C {
- void noExceptionDeclared() {
- exceptionDeclared();
- }
- void exceptionDeclared() throws IOException {}
+ void noExceptionDeclared() {
+ exceptionDeclared();
+ }
+ void exceptionDeclared() throws IOException {}
}
+
aspect A {
- around(): call(void C.exceptionDeclared()) {
- try { proceed(); }
- catch (IOException e) {}
- }
+ around(): call(void C.exceptionDeclared()) {
+ try { proceed(); }
+ catch (IOException e) {}
+ }
}
....
-even though the class C is not compilable on its own (because
-noExceptionDeclared actually throws an Exception).
+even though the class `C` is not compilable on its own (because
+`noExceptionDeclared` actually throws an `Exception`).
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
+`exceptionDeclared()` will not, actually, throw an exception, we now
"soften" that exception, that is, take it out of the space of declared
exceptions.
[source, java]
....
declare soft: IOException:
- call(void C.exceptionDeclared()) &&
- withincode(void noExceptionDeclared());
+ call(void C.exceptionDeclared()) &&
+ withincode(void noExceptionDeclared());
....
[[_1_0a1-aspects]]
[source, java]
....
aspect Shadow
- of eachobject(receptions(void Point.setX(int)) ||
- receptions(void Point.setY(int))) {
- ...
+ 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))) {
- ...
+aspect Shadow
+ pertarget(
+ call(void Point.setX(int)) ||
+ call(void Point.setY(int))
+ )
+{
+ // ...
}
....
[source, java]
----
abstract aspect A {
- abstract pointcut pc();
+ abstract pointcut pc();
}
aspect B {}
[source, java]
----
abstract aspect A {
- abstract pointcut pc();
+ abstract pointcut pc();
}
aspect B {
- pointcut pc();
+ pointcut pc();
}
----
[source, java]
----
class C {
- static int i;
+ static int i;
}
aspect A {
- before(): gets(int C.i) {
- System.err.println("C.i was " + C.i)
- }
+ before(): gets(int C.i) {
+ System.err.println("C.i was " + C.i)
+ }
}
----
[source, java]
----
class C {
- static int i;
+ static int i;
}
aspect A {
- before(): get(int C.i) && ! within(A) {
- System.err.println("C.i was " + C.i)
- }
+ before(): get(int C.i) && ! within(A) {
+ System.err.println("C.i was " + C.i)
+ }
}
----
[source, java]
----
class C {
- static int i;
+ 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
- }
+ 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
+ }
}
----
[source, java]
----
introduction GTN {
- // ...
+ // ...
}
----
[source, java]
----
introduction Foo {
- public void doStuff() { this.doStuffLater(); }
- public int calorieCount = 3;
- public new(int x) { super(); calorieCount = x; }
+ public void doStuff() { this.doStuffLater(); }
+ public int calorieCount = 3;
+ public new(int x) { super(); calorieCount = x; }
}
// ==>
[source, java]
----
introduction Foo {
- implements Comparable;
- extends Goo;
+ implements Comparable;
+ extends Goo;
}
// ==>
[source, java]
----
introduction subtypes(Foo) && !Goo {
- int x;
+ int x;
}
// ==>
[source, java]
----
class Counter {
- private int count = 2;
+ private int count = 2;
}
aspect ExposeCountersPrivates {
- introduction Counter {
- public int getCount() { return count; }
- }
+ 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; }
+ public int Counter.getCount() { return count; }
}
----
[source, java]
----
-class C {
-}
+class C {}
aspect AddCounter {
- introduction C {
- private int count;
- public int getCount() { return count; }
- }
+ introduction C {
+ private int count;
+ public int getCount() { return count; }
+ }
}
// ==>
aspect AddCounter {
- private int Counter.count;
- public int Counter.getCount() { return count; }
+ private int Counter.count;
+ public int Counter.getCount() { return count; }
}
----
[source, java]
----
aspect Tracing {
- static before(): executions(* *(..)) {
- System.out.println("Got Here! " + thisJoinPoint);
- }
+ static before(): executions(* *(..)) {
+ System.out.println("Got Here! " + thisJoinPoint);
+ }
}
// ==>
aspect Tracing {
- before(): execution(* *(..)) {
- System.out.println("Got Here! " + thisJoinPoint);
- }
+ before(): execution(* *(..)) {
+ System.out.println("Got Here! " + thisJoinPoint);
+ }
}
----
[source, java]
----
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
+ 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);
- }
+ static aspect AlwaysTracing {
+ before(): execution(* *(..)) {
+ System.out.println("Got Here! " + thisJoinPoint);
+ }
+ after(): execution(* *(..)) {
+ System.out.println("Returned! " + thisJoinPoint);
}
+ }
- // some other dynamic advice, fields, etc
+ // some other dynamic advice, fields, etc
}
----
[source, java]
----
aspect BaseTracing {
- abstract pointcut traced();
- before(): traced() {
- System.out.println("Got Here! " + thisJoinPoint);
- }
+ abstract pointcut traced();
+ before(): traced() {
+ System.out.println("Got Here! " + thisJoinPoint);
+ }
}
// ==>
// make this abstract aspect explicitly abstract
abstract aspect BaseTracing {
- // ...
+ // ...
}
----
----
aspect BoundPoint of eachobject(instanceof(Point)) {
- java.beans.PropertyChangeSupport support = null;
+ java.beans.PropertyChangeSupport support = null;
- after() returning(Point p): receptions(p.new(..)){
- support = new PropertyChangeSupport(myPoint);
- }
+ after() returning(Point p): receptions(p.new(..)){
+ support = new PropertyChangeSupport(myPoint);
+ }
- around(Point p) returns void: receptions(void p.set*(*)) {
- // code that uses support
- }
+ around(Point p) returns void: receptions(void p.set*(*)) {
+ // code that uses support
+ }
}
----
[source, java]
----
aspect BoundPoint {
- private PropertyChangeSupport Point.support = new PropertyChangeSupport(this);
+ private PropertyChangeSupport Point.support = new PropertyChangeSupport(this);
- void around(Point p): setters(p) {
- // code that uses p.support
- }
+ void around(Point p): setters(p) {
+ // code that uses p.support
+ }
}
----
For pointcuts denoting calls to particular static methods, such as
-____
+[source, java]
....
calls(String, static String valueOf(int)) // deprecated
....
-____
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 `String valueOf(int)`, catch calls to that exact method
defined in the String class.
-____
+[source, java]
....
call(static String String.valueOf(int))
....
-____
Pointcuts denoting calls to classes of static methods can also be
rewritten with these rules. For example,
-____
+[source, java]
....
calls(my.package.*, static * get*(..)) // deprecated
....
-____
should now be written
-____
+[source, java]
....
call(static * my.package.*.get*(..))
....
-____
===== Calls to non-static methods
same way that those pointcuts denoting calls to static methods are
fixed. So,
-____
+[source, java]
....
calls(Thread, int getPriority()) // deprecated
....
-____
which denotes all calls to nullary int methods named `getPriority` when
the called object is an instance of the `Thread` type, can almost always
be rewritten
-____
+[source, java]
....
call(int Thread.getPriority())
....
-____
which denotes all calls to the nullary int `Thread.getPriority()`
method.
`int Thread.getPriority()` method, regardless of how the called object
is statically typed, you shoud use the different translation:
-____
+[source, java]
....
call(int getPriority()) && target(Thread)
....
-____
This will capture all call join points of methods with signature
`int Thread.getPriority()`.
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
-____
+[source, java]
....
class C {
- static before(): executions(C.new()) { ... } // deprecated
+ static before(): executions(C.new()) { /*...*/ } // deprecated
}
....
-____
write
-____
+[source, java]
....
class C {
- static aspect ConstructionProtocol {
- static before(): executions(C.new()) { ... }
- }
+ static aspect ConstructionProtocol {
+ static before(): executions(C.new()) { /*...*/ }
+ }
}
....
-____
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.
-____
+[source, java]
....
-class C { ... }
+class C { /*...*/ }
aspect ConstructionProtocol {
- static before(): execution(C.new()) { ... }
+ static before(): execution(C.new()) { /*...*/ }
}
....
-____
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
The elimination of the `runNext()` static method requires almost no
porting work. An automatic replacement of the string
-____
-`thisJoinPoint.runNext`
-____
+[source, java]
+....
+thisJoinPoint.runNext
+....
with the string
-____
-`proceed`
-____
+[source, java]
+....
+proceed
+....
will do the job. However, if any around advice used the identifier
-"`proceed`" as a formal parameter or local variable, it must be renamed,
+`proceed` 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 "`this`", depending on whether the field is static or
+aspect name or `this`, depending on whether the field is static or
not).
[[thisJoinPoint]]
For example:
-____
-....
-System.out.println(thisJoinPoint.className + "." +
- thisJoinPoint.methodName)
-....
-____
+* `System.out.println(thisJoinPoint.className + "." + thisJoinPoint.methodName)`
can be replaced with
-____
-`System.out.println(thisJoinPoint)`
-____
-
-or
-
-____
-`System.out.println(thisJoinPoint.getSignature().toShortString())`
-____
+* `System.out.println(thisJoinPoint)` or
+* `System.out.println(thisJoinPoint.getSignature().toShortString())`
with comparable behavior.
Accesses to the parameters field of join points should be changed as
follows. A field access like:
-____
-`thisJoinPoint.parameters`
-____
+* `thisJoinPoint.parameters`
must be changed to: