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 that AspectJ 1.2.1 permits the use of the '+' operator to concatenate the messages for declare error and warning statements). This document describes the tools differences between AspectJ versions 1.2 and 1.2.1. Users familiar with AspectJ 1.2 may find this document a quicker way to learn what changed in the tools.
This document summarizes changes in:
See the changes document for more details, or all the changes as detailed in the bugzilla database.
The AspectJ 1.2.1 compiler can produce informational messages about the weaving process. To see these messages, use the -showWeaveInfo compiler option, or set showweaveinfo=true in the iajc ant task.
The following is an example of the messages produced when this option is enabled:
C:\aspectj1.2.1\doc\examples\tjp>ajc -showWeaveInfo *.java Type 'tjp.Demo' (Demo.java:20) advised by around advice from 'tjp.GetInfo' (GetInfo.java:26) [RuntimeTest=true] Type 'tjp.Demo' (Demo.java:30) advised by around advice from 'tjp.GetInfo' (GetInfo.java:26) [RuntimeTest=true] Type 'tjp.Demo' (Demo.java:34) advised by around advice from 'tjp.GetInfo' (GetInfo.java:26) [RuntimeTest=true]
In the event of a compiler crash, AspectJ 1.2.1 will produce a dump file giving important information about the state of the compiler at the time of the crash. These dump files should enable us to analyze problems more effectively. In the rare event that you witness a compiler crash, please attach the dump file to the bug report.
In addition to producing a dump file when an abort condition is detected, the AspectJ 1.2.1 compiler can also be requested to create a dump file on detection of a compilation error. Set the property org.aspectj.weaver.Dump.condition=error to enable this behaviour.
AspectJ 1.2.1 is based on the Eclipse 3.0 final JDT compiler.
For source files compiled by ajc (as opposed to binary inputs to the compiler compiled with some other java compiler), ajc now emits better line number information for execution join points. In particular, for a method, constructor or advice execution join point (as matched for example by a declare error or declare warning statement), ajc 1.2.1 reports the first line number of the declaration, as opposed to the line number of the first line of code in the body.
AspectJ 1.2.1 contains a small number of runtime performance optimisations, including optimisations of if(true) and if(false) pointcut expressions, caching of getSignature() and toString() results on JoinPoint objects, and an optimised implementation of cflow.
In the case where there are no arguments bound in the cflow pointcut, programs compiled under AspectJ 1.2.1 and that make heavy use of cflow will run significantly faster. Thanks to the abc compiler team for detecting this performance related bug and for piloting the fix.
String concatentation in declare error and warning statements is now supported. For example, you can write:
declare warning : jdbcCall() && !inDataLayer() : "Please don't make calls to JDBC " + "outside of the data layer.";
The AspectJ 1.2.1 distribution contains a new jar in the lib directory, aspectjweaver.jar, that contains the subset of aspectjtools.jar needed for weaving only. This jar may be used in situations where you wish to exploit AspectJ's binary weaving capabilities, but do not want the full aspectjtools.jar around (aspectjweaver.jar is approx. 5 times smaller).
In addition, the load-time weaving "aj" script which was included in the doc/examples/ltw directory in the 1.2 distribution has been moved into the regular bin directory. See README-12 for details of using this script.
AspectJ 1.2.1 introduces a backwards-incompatible change to the class file format generated by the AspectJ compiler. Classes generated by ajc v1.2.1 cannot be used on the inpath or aspectpath of a weaver from a prior version of the compiler. Classes generated by prior versions of the compiler can of course be placed on the inpath or aspectpath of the 1.2.1 weaver.
As ever, you should use the AspectJ runtime library (aspectjrt.jar) that comes with the distribution you used to build your application.
target 1.2.1in the bug database: https://bugs.eclipse.org/bugs/buglist.cgi?product=AspectJ&target_milestone=1.2.1&bug_status=RESOLVED&resolution=FIXED