Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] [aspect-users] Static initialization with JDK 1.5 annotation


Also ...

following on from my last post, this will work for you with the dev build:

after(): within(@Entity *) && staticinitialization(*) {
}

And I meant to mention earlier that @within should also work:

after(): @within(@Entity) && staticinitialization(*) {
}


And for @within to work, you can use base 1.5.0M1 - you don't need to download the latest dev build.

Andy.
---



Rifflard Mickaël <Mickael.Rifflard@xxxxxxxxxxxxxx>
Sent by: aspectj-users-admin@xxxxxxxxxxx

13/01/2005 09:19

Please respond to
aspectj-users@xxxxxxxxxxx

To
<aspectj-users@xxxxxxxxxxx>
cc
Subject
[aspectj-users] [aspect-users] Static initialization with JDK 1.5 annotation





Hi all,

I'm currently trying to match static initialization of objects with annotation.

I try this

                public aspect StaticInit {

                                 after() : staticinitialization(@Entity test.*) {
                                                  System.out.println(thisJoinPoint.getSignature().toString());
                                 }
                }

If I execute this aspect on source code :

                @Entity
                public class A {}
and
                public class B {
                                 public static void main(String[] args) {
                                                  A a = new A();
                                 }
                }

I obtain

                B.<clinit>
                A.<clinit>

I don't understand why my aspect match B initialization whereas this object does not have the annotation.

Is this a bad writing ? If so, what is the good writing ?

Thanks,

Mickaël RIFFLARD
Atos Origin

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top