Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Generics without erasure

Currently looking in detail at the changes there is not on my radar, but on first impressions not much would necessarily change.  AspectJ matches against the generic declarations as well, not just the erasure:

-- A.java --
import java.util.*;

public class A {
  List<String> ls;
  List<Integer> ln;

  public void foo() {
    ls = new ArrayList<String>();
    ln = new ArrayList<Integer>();
  }
}

aspect X {
  before(): set(List<String> *) {}
  before(): set(List<Integer> *) {}
  before(): set(List<Number+> *) {}
}
-- end of A.java --

C:\temp>ajc -1.5 A.java -showWeaveInfo
Join point 'field-set(java.util.List A.ls)' in Type 'A' (A.java:8) advised by before advice from 'X' (A.java:14)

Join point 'field-set(java.util.List A.ln)' in Type 'A' (A.java:9) advised by before advice from 'X' (A.java:16)

Join point 'field-set(java.util.List A.ln)' in Type 'A' (A.java:9) advised by before advice from 'X' (A.java:15)


Andy.

2008/9/23 Mohan Radhakrishnan <radhakrishnan.mohan@xxxxxxxxx>
Hi,
         Aspectj matches against the erasure (e.g) Erasure of
List<String> is List.

         How would AspectJ change if Generics without erasure is
implemented as everyone is demanding it ?


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


Back to the top