import java.util.*; /** * - args(List) matches List but not List * - args(List) matches List with unchecked warning * - args(List) matches List with unchecked warning * - args(List) matches List with unchecked warning * - args(List) matches List (String is final) */ public aspect ArgsParameterized { public static void main(String[] args) { List ls = new ArrayList(); // ls.add("one"); // ls.add("two"); // ls.add("three"); Generic g = new Generic(); g.foo(ls); g.bar(ls); g.tada(ls); g.afar(new ArrayList()); g.something(ls); MustBeString mbs = new MustBeString(); mbs.listit(ls); } before(List ls) : call(* *(..)) && args(ls) { System.out.println("args(List matched at " + thisJoinPointStaticPart); ls.add("four"); String s = ls.get(0); } } class Generic { void foo(List lt) { ; } void bar(List ls) { ; } void tada(List l) { ; } void afar(List ln) { ; } void something(List ls) { ; } } class MustBeString { void listit(List lt) { ; } }