Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [ajdt-dev] New AJDT dev build available.


Actually, I see you aren't using @annotation binding, you are using @target binding.

This variant of your code works for me:

MyClass.java:
---------------8<------------
package test;
public class MyClass {
@MyAnnotation public String _myField;
               
public static void main(String[] args) {
  new MyClass().setMyField("test");
}                
public void setMyField(String nv) {
  this._myField = nv;
}
}

---------------8<------------

MyAspect.aj:

---------------8<------------
package test;

public aspect MyAspect {
                after(test.MyAnnotation ma) : set (public String test.MyClass._myField) && @annotation(ma){
                                 System.err.println("pointcut matching : " + ma);
                }
}

---------------8<------------


Although it may not achieve what you want as I have annotated the field
directly rather than the MyClass type.  

Andy.



Rifflard Mickaël <Mickael.rifflard@xxxxxxxxxxxxxx>
Sent by: ajdt-dev-admin@xxxxxxxxxxx

07/02/2005 10:02

Please respond to
ajdt-dev@xxxxxxxxxxx

To
<ajdt-dev@xxxxxxxxxxx>
cc
Subject
RE: [ajdt-dev] New AJDT dev build available.





Andy,

I have got a problem with @annotation variable binding.

Here is my sample :

MyClass.java :

package test;

@MyAnnotation public class MyClass {

                public String _myField;
               
                public static void main(String[] args) {
                                 new MyClass().setMyField("test");
                }
               
                public void setMyField(String nv) {
                                 this._myField = nv;
                }
}



MyAspect.java :

package test;

public aspect MyAspect {
               
                after(test.MyAnnotation ma) : set (public String test.MyClass._myField) && @target(ma){
                                 System.err.println("pointcut matching : " + ma);
                }
}

When I execute this sample, after a successfully weaving, I receive this error :

Exception in thread "main" java.lang.NoClassDefFoundError: MyAnnotation
                at test.MyClass.setMyField(MyClass.java:19)
                at test.MyClass.main(MyClass.java:15)

When I look at the weaving class MyClass, this one start with the _expression_

                import MyAnnotation;

but MyAnnotation is in test package.

Is there another way of using @annotation variable binding ?

Regards,

Mickaël Rifflard
(Atos Origin)



-----Message d'origine-----
De : ajdt-dev-admin@xxxxxxxxxxx [mailto:ajdt-dev-admin@xxxxxxxxxxx]De la
part de Rifflard Mickaël
Envoyé : lundi 7 février 2005 10:16
À : ajdt-dev@xxxxxxxxxxx
Objet : RE: [ajdt-dev] New AJDT dev build available.


Exactly what I needed.
I will update AJDT immediately.

Thanks Andy,

Mickaël Rifflard
(Atos Origin)

-----Message d'origine-----
De : ajdt-dev-admin@xxxxxxxxxxx [mailto:ajdt-dev-admin@xxxxxxxxxxx]De la
part de Andrew Clement
Envoyé : lundi 7 février 2005 10:03
À : ajdt-dev@xxxxxxxxxxx
Objet : RE: [ajdt-dev] New AJDT dev build available.






Hi Mickaël,

There is now a later build of AJDT available:

Version 1.2.0.20050204153223

(From 3.30pm on Friday)

This includes @target(), @this(), @annotation(), @args() variable binding
and
improved incremental compilation speed.

regards,
Andy.



                                                                         
            Rifflard Mickaël                                              
            <Mickael.rifflard                                            
            @atosorigin.com>                                           To
            Sent by:                  <ajdt-dev@xxxxxxxxxxx>              
            ajdt-dev-admin@ec                                          cc
            lipse.org                                                    
                                                                  Subject
                                      RE: [ajdt-dev] New AJDT dev build  
            07/02/2005 08:08          available.                          
                                                                         
                                                                         
            Please respond to                                            
            ajdt-dev@eclipse.                                            
                   org                                                    
                                                                         
                                                                         




Hi Andy,

Is this version contains @target variable binding ?

Exemple : pointcut(MyAnnotation ma) : @target(ma) && ... { ... }

Regards,

Mickaël Rifflard
(Atos Origin)


-----Message d'origine-----
De : ajdt-dev-admin@xxxxxxxxxxx [mailto:ajdt-dev-admin@xxxxxxxxxxx]De la
part de Andrew Clement
Envoyé : mercredi 2 février 2005 17:43
À : ajdt-dev@xxxxxxxxxxx; aspectj-dev@xxxxxxxxxxx
Objet : [ajdt-dev] New AJDT dev build available.



There is a new AJDT dev build available that includes @annotation and
@target binding support.

See the AJDT download page for details. It is version:

ajdt_1.2.0.20050202134544

cheers,
Andy.



pope <alexandru.popescu@xxxxxxxxx>
Sent by: ajdt-dev-admin@xxxxxxxxxxx
01/02/2005 01:11 Please respond to
ajdt-dev@xxxxxxxxxxx

TodevAJDT <ajdt-dev@xxxxxxxxxxx>
cc
Subject[ajdt-dev] integrating last AspectJ development







-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

I was wondering if there is a possibility to integrate the latest AspectJ
development distro into an
existing AJDT install.

Actually I am using:
Eclipse 3.1M4
AJDT: ajdt_1.2.0.20050124144759_archive.zip

tia,
- --
:pope
[the_mindstorm]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)

iD8DBQFB/tdKTTDTje0R2dgRAmPkAJ4v/imgcHwx5KCRyaA0EGO58FsP1gCeMrX0
X6PbB4nwGM2WDKSyO9KvY0E=
=vKHe
-----END PGP SIGNATURE-----
_______________________________________________
ajdt-dev mailing list
ajdt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/ajdt-dev
_______________________________________________
ajdt-dev mailing list
ajdt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/ajdt-dev


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


Back to the top