Browse Source

added bug db links and notes wrt newly-enforced limits for declarations on interfaces

tags/Root_ajdt_support
wisberg 20 years ago
parent
commit
b2befd4b1f
2 changed files with 44 additions and 11 deletions
  1. 16
    5
      docs/dist/doc/README-12.html
  2. 28
    6
      docs/dist/doc/porting.html

+ 16
- 5
docs/dist/doc/README-12.html View File

@@ -22,7 +22,8 @@ All rights reserved.

<p> The definition of the AspectJ language is unchanged in the 1.2 release.
Instead, AspectJ 1.2 provides major improvements to the functionality of the
supporting tools.
supporting tools
and enforces some language limits that went unchecked before.
This document describes the tools differences between
AspectJ versions 1.2 and 1.1.1.
Users new to AspectJ need only read
@@ -31,7 +32,8 @@ since it describes the 1.2 language.
Users familiar with AspectJ 1.1 may find this document
a quicker way to learn what changed in the tools,
and should use it as a guide for porting
programs from 1.1 to 1.2.
programs from 1.1 to 1.2,
together with <a href="porting.html">porting.html</a>.
</p>

<p>This document first summarizes changes from the 1.1.1 release in
@@ -45,8 +47,8 @@ programs from 1.1 to 1.2.
</ul>

<p> then <a href="#details">details</a> some of the changes,
and finally points readers to the bug database for any
<a href="#knownLimitations">known limitations</a>.
and finally points readers to the bug database for
<a href="#allchanges">all the changes</a>.
</p>

<!-- ============================== -->
@@ -513,7 +515,7 @@ s1.area() = 1.0
scripts.</p>
<!-- ============================== -->
<hr>
<hr/>
<h3><a name="SOFTEX">SoftException now supports getCause()</a></h3>
@@ -528,5 +530,14 @@ s1.area() = 1.0
to integrate load-time weaving into an existing class loader hierachy. The package implementation
is included in <code>aspectjtools.jar</code>. For an example of how to use these APIs, see the
<code>org.aspectj.weaver.WeavingURLClassLoader</code> implementation.

<hr/>
<a name="allchanges"></a>
<h2>All changes are listed in the bug database</h2>
For a complete list of changes in the 1.2 release, search for
<code>target 1.2</code> in the bug database:
<a href="https://bugs.eclipse.org/bugs/buglist.cgi?product=AspectJ&component=Compiler&target_milestone=1.2">
https://bugs.eclipse.org/bugs/buglist.cgi?product=AspectJ&component=Compiler&target_milestone=1.2
</a>
</body> </html>

+ 28
- 6
docs/dist/doc/porting.html View File

@@ -1,6 +1,5 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> <head>
<meta http-equiv="Content-Language" content="en-us">
<title>AspectJ Reference - Porting Notes</title>
</head>
<body>
@@ -37,19 +36,21 @@ 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).
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.
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 {
@@ -82,22 +83,27 @@ with the <code>call</code> pointcut designator between 1.4 and 1.3 compliance le
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><code>About to call B.doIt(...)</code>
</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
@@ -105,6 +111,7 @@ the static type matching used for a type pattern specified in a <code>call</code
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>
@@ -144,6 +151,21 @@ statment. When moving code from 1.1 to 1.2, additional errors may be raised due
rule. The solution is to recode the declare statement avoiding pointcut expressions that may require a run-time test.
</p>

<p><b>Declaring a constructor on an interface</b> is now (correctly) prohibited.
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>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>

<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:

Loading…
Cancel
Save