Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Issues with @DeclareParents and @DeclareMixin

Quite a few issues in that email - but let's tackle them one at a time.

Firstly on compiler versions - is your ASPECTJ_HOME set to pick up
something old, or something wierd lying around on your classpath?

I download aspectj-1.6.4.jar from the eclipse.org/aspectj downloads
page.  After install:

ajc -version
AspectJ Compiler 1.6.4 (1.6.4 - Built: Thursday Apr 2, 2009 at
16:03:17 GMT) - Eclipse Compiler 0.785_R33x, 3.3

(version and date are correct)

I then downloaded the latest dev build (aspectj-DEVELOPMENT-20090616201206.jar):

ajc -version
AspectJ Compiler 1.6.5 (DEVELOPMENT - Built: Wednesday Jun 17, 2009 at
00:23:49 GMT) - Eclipse Compiler 0.785_R33x, 3.3

(version and date are as expected - timestamp on the jar is a timezone
or two behind the compiler date reported)

The fact that you see this:

>\development\aspectj1.6.4\bin\ajc -version
AspectJ Compiler 1.6.3 (1.6.3 - Built: Tuesday Dec 23, 2008 at
17:12:30 GMT) - Eclipse Compiler 0.785_R33x, 3.3

suggests to me that your ASPECTJ_HOME is pointing to 1.6.3 or that the
aspectjtools.jar from that version is on your classpath.

You do appear to have found a bug with annotation style decp  - i'll
report back on that tomorrow.
If you are just on AspectJ1.6.3 - that will be (as Andrew says) why
@DeclareMixin is not doing anything.

With 1.6.4 or a dev build, I then work on your MixinAspect:

ajc -outjar aspects2.jar MixinAspect.aj -1.5
F:\aspectj164\x\MixinAspect.aj:1 [warning] no match for this type
name: test.Foo [Xlint:invalidAbsoluteTypeName]
(no source information available)
        [Xlint:invalidAbsoluteTypeName]

1 warning


F:\aspectj164\x>ajc Foo.java -1.5 -aspectpath aspects2.jar -d bin -showWeaveInfo
<Unknown> [warning] no match for this type name: test.Foo
[Xlint:invalidAbsoluteTypeName]

Mixing interface 'java.lang.Runnable' (MixinAspect.aj) into type
'test.Foo' (Foo.java)

Type 'test.Foo' (Foo.java) has intertyped method from 'MixinAspect'
(MixinAspect.aj:'void java.lang.Runnable.run()')


1 warning

and run it:

cd bin
java test.Foo
[interface java.lang.Runnable]
Hi there from MixinAspect

Andy


2009/6/16 Dunstan, Tom (SACE Board) <TomD@xxxxxxxxxxxxxxxxxxx>:
>
>> This is odd.  I won't be able to try this out until tomorrow, but it will
>> help if you can tell me what version of Eclipse / AJDT you are using.
>
> Eclipse 3.4.2. JDT plugin version 3.4.2.r342_v20081217-7o7tEAoEEDWEm5HTrKn-svO4BbDI, Build id: M20090211-1700.
>
> AJDT Feature details reports:
> Version: 1.6.4.20090313172428
> AspectJ version: 1.6.4.20090304172355
>
> The eclipse image that I'm using is one that is distributed to developers here - it's prepopulated with some updates and a bunch of relevant plugins. I'll try downloading the latest vanilla ganymede J2EE build from eclipse.org and see if that behaves any differently.
>
>> Also, are you getting a compiler error or an editor error (ie- is it appearing in the editor only, or does it also appear in the problems view)?
>
> Red underline in editor (with associated quick fix icon in left border) plus line in problems view.
>
> To further explain the eclipse setup, I've got two projects: one with the aspects and the other with the first in its Aspect Path in the AspectJ Build section of the project properties. I haven't done anything else to link the two.
>
> Thanks very much for taking the time to check it out.
>
> Regards
>
> Tom
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top