[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[aspectj-users] Re: [aspectj-dev] weaving incompatibility?
- From: Adrian Colyer <adrian_colyer@xxxxxxxxxx>
- Date: Fri, 17 Dec 2004 09:18:12 +0000
- Delivered-to: email@example.com
You've touched on an important issue (I'm cc'ing aspectj-users for wider
In AspectJ 1.2.1 we changed the binary format of (some attributes in)
aspects, and also introduced a version attribute in the class files we
generate so that we would know which version of AspectJ created it. In
AspectJ 5 M1 we changed the binary format of (some attributes in) aspects
again (for example, to record annotation patterns in pointcut
expressions). What we didn't do in that milestone release is rev the
class file version number (probably should have, certainly will before a
Our binary compatibility policy is as follows:
* An aspect created by version n of the AspectJ compiler can be consumed
by an AspectJ compiler (weaver) of version v, where v >= n. (At some
point in the future, we may have to change this policy to
n <= v >= (n+2), ie. backwards compatibility with two previous versions,
but we haven't needed to make this restriction yet and will be sure to
communicate clearly if we ever think we need to do so).
* We do not guarantee that an aspect created by version n of the AspectJ
compiler can be consumed by an AspectJ compiler (weaver) of version v,
where v < n. (This is like the Java rules - a 1.5 class cannot be loaded
into a 1.4 vm).
* An AspectJ weaver of version v, that reads in an aspect of version n,
where n < v, will write out that same aspect at version v if it needs to
write out any changes to it.
* An AspectJ program should always be run with the aspectjrt.jar runtime
library that accompanies the distribution containing the compiler/weaver
used to build it.
A long answer to the question
> Should it be possible to weave AspectJ 5 aspects with an older weaver?
To which the short answer is "no".
However, instead of some IOException, what you should see is a nice
message saying that the aspect was produced by a more recent version of
AspectJ and cannot be read. Likewise, if you load a pre-aspectj 5 aspect
into the AspectJ 5 weaver right now, you'll also see an IOException
(odds-on). In M2 we'll detect that and use the back-level loaders to read
Martin Lippert <lippert@xxxxxxx>
Sent by: aspectj-dev-admin@xxxxxxxxxxx
Please respond to
AspectJ Dev List <aspectj-dev@xxxxxxxxxxx>
[aspectj-dev] weaving incompatibility?
I just observed a possible incompatibility between different AspectJ
versions and would like to ask you whether this is a bug or not. I got
problems in my load-time weaving environment (which is based on the
AspectJ 1.2 code) when trying to load AJDT 1.2.0M2 compiled aspects. Any
idea? Should it be possible to weave AspectJ 5 aspects with an older
Thanks a lot for the help!!!
aspectj-dev mailing list