Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Strange error with parameter annotation

Thanks a lot!

Andy Clement escreveu:
I've also now fixed the other cases - your test program will work fine
with the next dev build.

Andy.

On 25/04/2008, Andy Clement <andrew.clement@xxxxxxxxx> wrote:
  
That's a bug, well two bugs.  I've now fixed all except cases 2 and 7
 in your test program (so I've fixed 5,8,10,11).  2 and 7 are a
 different issue, completely unrelated to the new parameter annotation
 matching, they indicate a bug in annotation matching in general when !
 is used.  I've raised
 https://bugs.eclipse.org/bugs/show_bug.cgi?id=228980 to track the
 problem.

 thanks for the cool test program. the fixes will be in the next AJ dev build.

 cheers,
 Andy.


 On 25/04/2008, Manuel Menezes de Sequeira <Manuel.Sequeira@xxxxxxxx> wrote:
 >
 >  Hi all!
 >
 >  I'm having some problems with parameter annotations. My original idea was
 > to use
 >
 > declare error : execution(* *(@A (!(Object+)), ..)) : "@A annotated value
 > parameter!" to match executions of methods with an @A annotated,
 > non-reference typed, first parameter. It did not work, at least with my AJDT
 > version (Version: 1.5.2.200804241330, AspectJ version:
 > 1.6.0.20080423100000). I made a few more tests and detected a few more
 > strange cases (see code below). What am I doing wrong?
 >
 >  Regards,
 >
 >  Manuel
 >
 >  ----- Test.aj -----
 >
 >  import java.lang.annotation.ElementType;
 >  import java.lang.annotation.Retention;
 >  import java.lang.annotation.RetentionPolicy;
 >  import java.lang.annotation.Target;
 >
 >  public aspect Test {
 >      // OK (matches f1 and f2):
 >      declare error : execution(* *(!(Object+), ..)) : "Value parameter.";
 >
 >      // Wrong (matches f1 and f2, should match only f1):
 >      declare error : execution(* *(@A (!(Object+)), ..)) : "@A annotated
 > value parameter!";
 >
 >      // OK (matches f1):
 >      declare error : execution(* *(@A (*), ..)) && execution(* *(!(Object+),
 > ..)): "@A annotated value parameter.";
 >
 >      // OK (matches f3 and f4):
 >      declare error : execution(* *(Object+, ..)) : "Reference parameter.";
 >
 >      // Wrong (no matches, should match f3):
 >      declare error : execution(* *(@A (Object+), ..)) : "@A annotated
 > reference parameter!";
 >
 >      // OK (matches f3):
 >      declare error : execution(* *(@A (*), ..)) && execution(* *(Object+,
 > ..)): "@A annotated reference parameter.";
 >
 >      // Wrong (matches f1 and f2, should match only f2):
 >      declare error : execution(* *(!@A (!(Object+)), ..)) : "Non-@A
 > annotated value parameter!";
 >
 >      // Wrong (matches f1 and f2, should match only f2):
 >      declare error : execution(* *(!@A (*), ..)) && execution(*
 > *(!(Object+), ..)): "Non-@A annotated value parameter.";
 >
 >      // OK (matches f2):
 >      declare error : !execution(* *(@A (*), ..)) && execution(*
 > *(!(Object+), ..)): "Non-@A annotated value parameter.";
 >
 >      // Wrong (matches f3 and f4, should match only f4):
 >      declare error : execution(* *(!@A (Object+), ..)) : "Non-@A annotated
 > reference parameter!";
 >
 >      // Wrong (matches f3 and f4, should match only f4):
 >      declare error : execution(* *(!@A (*), ..)) && execution(* *(Object+,
 > ..)): "Non-@A annotated reference parameter.";
 >
 >      // OK (matches f4):
 >      declare error : !execution(* *(@A (*), ..)) && execution(* *(Object+,
 > ..)): "Non-@A annotated reference parameter.";
 >
 >      void f1(@A int i) {}
 >
 >      void f2(int i) {}
 >
 >      void f3(@A Integer i) {}
 >
 >      void f4(Integer i) {}
 >
 >      @Retention(RetentionPolicy.RUNTIME)
 >      @Target({ElementType.PARAMETER})
 >      private static @interface A {
 >
 >      }
 >  }
 >
 >

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

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

  
begin:vcard
fn:Manuel Menezes de Sequeira
n:Menezes de Sequeira;Manuel
org:ISCTE;DSI
adr;quoted-printable:;;Av.=C2=AA das For=C3=A7as Armadas;Lisboa;;1649-026;Portugal
email;internet:Manuel.Sequeira@xxxxxxxx
tel;work:+351 217903085
tel;fax:+351 217903927
tel;cell:+351 962337428
url:http://iscte.pt/~mms/
version:2.1
end:vcard

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


Back to the top