@@ -0,0 +1,17 @@ | |||
public aspect Asp2 { | |||
before(): execution(* fo*(..)) {} | |||
} |
@@ -0,0 +1,6 @@ | |||
package pkg; | |||
public aspect Asp { | |||
before(): execution(* fo*(..)) {} | |||
} |
@@ -0,0 +1,7 @@ | |||
public class C { | |||
public static void main(String []argv) { | |||
new C().foo(); | |||
} | |||
public void foo() {} | |||
} |
@@ -0,0 +1,13 @@ | |||
package p; | |||
import java.util.ArrayList; | |||
public class ErrorAspect { | |||
ArrayList arr = new ArrayList() { | |||
public boolean add(Object o) { | |||
doNothing(); | |||
super.add(o); | |||
}; | |||
} | |||
} | |||
@@ -0,0 +1,7 @@ | |||
package p; | |||
aspect GetInfo { | |||
declare warning : set(int Demo.x) : "field set"; | |||
declare warning : set(int Demo.x) : "field set"; | |||
declare parents : Demo implements Serializable; | |||
} |
@@ -0,0 +1,16 @@ | |||
package spacewar; | |||
class C { | |||
public void m() { | |||
foo(12); | |||
foo(14); | |||
} | |||
public void foo(int i) {} | |||
} | |||
aspect X { | |||
before(): call(* foo(..)) {} | |||
} | |||