Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Understanding generic types in args(..) construction

2008/11/3 Bruno De Fraine <Bruno.De.Fraine@xxxxxxxxx>
Hello Fernando,


On 2-nov-08, at 02:27, Fernando Rubbo wrote:
There exists a formal description saying how args(..) and after(..) returning (..) must works?

The best description is probably:
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.
 
1) AspectJ should employ the unerased version of signatures (which, as you point, is available) to determine args() matching

2) args() should have matching behavior closely related to "casting conversion" in Java: http://java.sun.com/docs/books/jls/third_edition/html/conversions.html#5.5

Yes, I don't see what an alternative behaviour could be.


class C{
  void m(List<Integer> e){}
}

args(List<Integer>): Should match (it does)
args(ArrayList<Integer>): Should runtime check (it does give a spurious warning however!)
args(List<Number>): Should not match (but it does!)
args(ArrayList<Number>): Should not match (it does not)
args(List<? extends Number>): Should match (it does)
args(ArrayList<? extends Number>): Should runtime check (it does not match!)

indeed.  All fixed in HEAD, some of those cases are regressions based on some fixes for other bugs.  The third case was working in AspectJ 1.5.3 and broke at some point since then.  If anyone wants to help out by contributing testcases in this space, feel free to try things out on a dev build (the fixes for the above situation will be in a dev build later today) - there are no doubt still cases that don't work correctly as the testing is hardly exhaustive in this space.  Please add your test programs to the bug Fernando raised: https://bugs.eclipse.org/bugs/show_bug.cgi?id=253109

thanks,
Andy.



Back to the top