Community
Participate
Working Groups
---------------------- Aspect.aj ---------------------- public aspect Aspect { void around(): call(* Def.def(..)) { System.out.println("aspect"); } } ------------------------------------------------------- ---------------------- Def.java ----------------------- class Clazz<T> { } public class Def { public static void def(Clazz<?>[] c) { System.out.println("def"); } } ------------------------------------------------------- ---------------------- Use.java ----------------------- public class Use { public static void main(String[] argv) { Def.def(null); } } ------------------------------------------------------- When placing Def after Use, compiler does not apply the advice, i.e. $ ajc -1.6 Aspect.aj Use.java Def.java .../Aspect.aj:2 [warning] advice defined in Aspect has not been applied [Xlint:adviceDidNotMatch] ... $ java Use def When placing Use after Def compiler works correctly: $ ajc -1.6 Aspect.aj Def.java Use.java $ java Use aspect Compiler accepts any order if method Def.def does not have an argument of type Clazz<?>[]
thanks for the great testcase!