AJDT 1.2.0 M3 - New and Noteworthy


Overview

In addition to supporting the latest AspectJ 5 milestone release, the focus is still very much on working with the rest of Eclipse, and the JDT in particular, instead of trying to change its default behaviour. This means the best arrangement is to only put plain Java code in .java files using the Java editor, and to use .aj files and the AspectJ editor for everything else. Furthermore, the structure of the current document (whether it's a .java or .aj file) is consistently shown in the standard Outline view, and the additional crosscutting information is shown alongside this in the new Cross References view.

Being a milestone release, this is a work in progress, but feedback on these changes is very welcome. The newsgroup and mailing lists are the best places for this.


Quick Cross References

This view, which was introduced in M2, is now also available in-place, like the quick outline.

The default key binding to show this view is "Ctrl+Alt+X". This can be customized via Preferences > Workbench > Keys. Pressing the key combination once shows you the crosscutting information for the current element, pressing it a second time will show the crosscutting information for the entire file.

Various other improvements and fixes have been made to the Cross References view, including the addition of a toggle button to show the crosscutting information for the entire file, instead of only for the current element.


Errors as you type

Return of the red squiggles! Early problem indication has typically been turned off when working with AJDT because the Java eager parser doesn't understand AspectJ syntax. But now it can be turned back on if desired, because aspects contained in .aj files and opened with the AspectJ editor can now make use of an AspectJ eager parser to highlight syntax problems as you type.

The AspectJ early problem indication support is enabled and disabled using the same option as the Java support. With Eclipse 3.0 this option is Preferences > Java > Editor > Typing > Analyze annotations while typing, and with Eclipse 3.1, it's Preferences > Java > Editor > Typing > Other settings > Report problems as you type.


Visible Project options

Project-specific AspectJ compiler options and other project settings are now saved in preference files under a ".settings" folder in the project. This enables the settings to be shared between workspaces and other developers, by committing the preference files to CVS. The mechanism used is the same as for Java compiler settings in Eclipse 3.1, although the AJDT behaviour is the same across Eclipse 3.0 and 3.1.

The ".settings" folder is only created when required. If you define project-specific AspectJ compiler settings, they will be stored in a file called "org.eclipse.ajdt.core.prefs". Other project settings, such as aspect-path and in-path will be stored in a "org.eclipse.ajdt.ui.prefs" file. These files are for sharing settings, they are not designed to be edited by hand - any such edits are likely to be overwritten.


Toolbar shortcuts

Shortcuts have been added to the toolbar to open the New AspectJ Project wizard, and the New Aspect wizard (in the New Type dropdown).


Incremental compilation

Incremental compilation is now set as the default mode of operation. Both the generated class files and the structure model (used to display the advice markers, and populate the cross references view and visualiser etc) should be incrementally updated as required. Work has also been done to improve the performance of incremental builds, particularly in the case of simple changes to classes. The main remaining limitation relates to project dependencies - an incremental build of one project will trigger a full build of dependent projects (because it doesn't know what has changed in the first project). The only workaround for now is to close the dependent projects, so that you get fast incremental builds of the one project you are currently working on.


Updated project wizard

The "New AspectJ Project" wizard has been updated to match the current appearance and functionality of the wizard which creates new Java projects. This includes the option to create separate source and output folders.


Plugin builds

If you have an AspectJ plug-in project, you can now generate a build.xml file that can build the project correctly, using the iajc ant task. This operation is available by right-clicking on your plugin.xml file and selecting PDE tools > Create Ant Build File with AspectJ support.


AspectJ 5 M2

The second milestone release of AspectJ 5 is included, with all the accompanying documentation available in the Eclipse help system, including the latest version of the AspectJ 5 Developer's Notebook.

The new pertypewithin instantiation model is supported by highlighting this new keyword, and adding it to the instantiation options in the New Aspect wizard.

All AspectJ 5 features that require a Java 5 JRE also require Eclipse support for Java 5 projects, which currently means Eclipse 3.1M6. This means that if running on Eclipse 3.0, the "5.0" tab for AspectJ compiler settings is not present. With Eclipse 3.1M6 the "5.0" tab is present, and now contains the new Xlint warning options added in AspectJ 5 M2, including a warning when advice does not affect any join points, which can be suppressed using the @SuppressAjWarnings annotation. Also, there is no longer a "1.5" option on this page, as the Java Compiler setting for JDK compliance level is used instead.

The new declare annotation statements are fully supported (when using Eclipse 3.1M6 and an AspectJ project with a Java compliance setting of 5.0, and a 1.5.0 JRE). The outline view and package explorer structure has been updated to include these new declare statements. Markers are added to the edge of the editor to indicate the source and targets of these statements, as shown below. The context menu for these markers contains "Annotates" and "Annotated by" submenus to allow navigation of these relationships.

The "Annotates" and "Annotated by" relationships are also shown in the Cross References view:


AspectPath directories

With AspectJ 5 M2 you can now specify directories on the aspect path, instead of just jars or zips. To make use of this in AJDT, right-click on a project and select Properties, then go to the AspectJ Aspect Path section. On the Libraries tab there is now a Add Class Folder... button, which you can use to add the output "bin" directory of another project, for example. This allows you to apply the aspects from another project without requiring that other project to send its class files to an output jar.


Builder change

The project builder that AJDT registers with Eclipse has been moved from the AJDT UI plugin to the AJDT Core plugin. This means that the builder id has changed from org.eclipse.ajdt.ui.ajbuilder to org.eclipse.ajdt.core.ajbuilder. If a project is found with the old builder, you will be asked whether to keep the reference to the old builder. This is only useful if you are sharing the project with someone who may be using an earlier version of AJDT. Otherwise, it is best to remove the old reference. You can chose to automatically perform the same operation on other projects.


Bug fixes

As usual this release also contains a number of bug fixes. The full list is available in Bugzilla. The more notable ones are:

  • 74426 deleting aj files does not work in package explorer
  • 78182 editor tabs for .aj files are not marked with an error
  • 78579 build does not handle resource files automatically
  • 80920 The visualiser menu is reset using the Resources and Markers provider
  • 80923 ajdoc doesn't work with IBM's sdk
  • 83082 NullPointerException from the Cross Reference view
  • 84310 Non-deterministic selection of build configurations
  • 84967 Headless build process fails
  • 86941 "Cleaning" project does not work
  • 89798 Visualiser Menu does not show inner aspects correctly


Previous releases

See also information about the previous releases:

AJDT v1.2.0 M2 - New and Noteworthy

AJDT v1.2.0 M1 - New and Noteworthy