| Re: [aspectj-users] Understanding generic types in args(..) construction |
Hi Andy,,
I did a simple test on this new aspectj development build and it is not working for runtime check.
public class C {
void m1(List<Integer> e){}
}
aspect AC{
void around(): execution(* C.m1(..)) && args(List<Integer>){} //: Should match (it does)
void around(): execution(* C.m1(..)) && args(ArrayList<Integer>){}//: Should runtime check (it does not match!)
void around(): execution(* C.m1(..)) && args(List<Number>){}//: Should not match (it does not!)
void around(): execution(* C.m1(..)) && args(ArrayList<Number>){}//: Should not match (it does not)
void around(): execution(* C.m1(..)) && args(List<? extends Number>){}//: Should match (it does)
void around(): execution(* C.m1(..)) && args(ArrayList<? extends Number>){}//: Should runtime check (it does not match!)
void around(): execution(* C.m1(..)) && args(List){}//: Should match (it does)
void around(): execution(* C.m1(..)) && args(ArrayList){}//: Should runtime check (it does not match!)
void around(): execution(* C.m1(..)) && args(List<?>){}//: Should match (it does)
void around(): execution(* C.m1(..)) && args(ArrayList<?>){}//: Should runtime check (it does not match!)
void around(): execution(* C.m1(..)) && args(ArrayList<String>){}//: Should not match (it does not match!)
}
Thanks,
FernandoOn Tue, Nov 4, 2008 at 2:29 PM, Andy Clement <andrew.clement@xxxxxxxxx> wrote:
Try it with the dev build from yesterday that includes the latest set of 253109 fixes2008/11/3 Fernando Rubbo <fernando.rubbo@xxxxxxxxx>
I think we have a similar issue with the around's return. Look it out.
public class B {
List<Number> m(){ return null;}
}
aspect AB{
List<Integer> around() : execution(List<*> B.*(..)) {
return proceed();
}
}
List<Integer> is not subtype of List<Number>.
Fernando RubboOn Mon, Nov 3, 2008 at 9:08 PM, Fernando Rubbo <fernando.rubbo@xxxxxxxxx> wrote:
On 2-nov-08, at 02:27, Fernando Rubbo wrote:The best description is probably:
There exists a formal description saying how args(..) and after(..) returning (..) must works?
http://www.eclipse.org/aspectj/doc/released/adk15notebook/generics-inAspectJ5.html#d0e2512
That is quite old, but is currently the best we have written down. Anyone wishing to help us update the doc, please let me know.
If it will gonna respect Java subtyping it is simple to document. We just need to put a note informing that and a reference for Java spec (The Java Language Specification Third Edition) chapter 4.10 - Subtyping.
Fernando Rubbo
_______________________________________________
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
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users