@@ -1,32 +0,0 @@ | |||
// Simple aspect that tramples all over Simple.java | |||
public aspect AspectAdvice { | |||
// Go through all the kinds of things that might affect a type: | |||
pointcut methodRunning(): execution(* *(..)) && !execution(* main(..)); | |||
before(): methodRunning() { | |||
System.err.println("BEFORE ADVICE"); | |||
} | |||
after(): methodRunning() { | |||
System.err.println("AFTER ADVICE"); | |||
} | |||
after() returning: methodRunning() { | |||
System.err.println("AFTER RETURNING ADVICE"); | |||
} | |||
after() throwing : methodRunning() { | |||
System.err.println("AFTER THROWING ADVICE"); | |||
} | |||
void around(): execution(* main(..)) && !cflow(adviceexecution()){ | |||
System.err.println("AROUND ADVICE"); | |||
proceed(); | |||
} | |||
interface markerInterface { | |||
} | |||
} |
@@ -1,24 +0,0 @@ | |||
// Simple aspect that tramples all over Simple.java | |||
public aspect AspectDeclare { | |||
pointcut methodRunning(): execution(* *(..)); | |||
declare parents: Simple implements MarkerInterface; | |||
// declare parents: Simple extends InTheWay; | |||
// declare soft: | |||
// | |||
// declare precedence: | |||
// | |||
// declare warning: | |||
// | |||
// declare error: | |||
// | |||
} | |||
interface MarkerInterface {} | |||
class InTheWay {} |
@@ -1,25 +0,0 @@ | |||
// little aspect and class for testing declaration of annotations | |||
@interface anInterface {} | |||
public aspect AspectDeclareAnnotations{ | |||
declare @type : Test : @anInterface; | |||
declare @constructor : Test.new(String,int) : @anInterface; | |||
declare @method : int Test.fac(int) : @anInterface; | |||
declare @field : int Test.a : @anInterface; | |||
} | |||
class Test{ | |||
public Test(String say, int something){ | |||
System.out.println(say + something); | |||
} | |||
public int fac(int n){ | |||
return (n == 0)? 1 : n * fac(n-1); | |||
} | |||
public int a = 1; | |||
} |
@@ -1,22 +0,0 @@ | |||
// Simple aspect that tramples all over Simple.java | |||
public aspect AspectDeclareExtends { | |||
pointcut methodRunning(): execution(* *(..)); | |||
declare parents: Simple extends InTheWay; | |||
// declare soft: | |||
// | |||
// declare precedence: | |||
// | |||
// declare warning: | |||
// | |||
// declare error: | |||
// | |||
} | |||
interface MarkerInterface {} | |||
class InTheWay {} |
@@ -1,9 +0,0 @@ | |||
public aspect AspectDeclareSoft { | |||
declare soft: MyException: execution(* main(..)); | |||
declare soft: Exception+: execution(* main(..)); | |||
} | |||
class MyException extends Exception {} |
@@ -1,17 +0,0 @@ | |||
// Simple aspect that tramples all over Simple.java | |||
public aspect AspectITD { | |||
int Simple.fieldint = 5; | |||
String Simple.fieldstring = "hello"; | |||
public int Simple.returnint() { | |||
return 5; | |||
} | |||
public String Simple.returnstring() { | |||
return "abc"; | |||
} | |||
} |
@@ -1,10 +0,0 @@ | |||
package pkg; | |||
public aspect AspectInPackage { | |||
pointcut p() : execution(* *.*(..)); | |||
before() : p() { | |||
} | |||
} |
@@ -1 +0,0 @@ | |||
-showWeaveInfo |
@@ -1,3 +0,0 @@ | |||
Simple.java | |||
-showWeaveInfo | |||
AspectDeclareSoft.aj |
@@ -1,3 +0,0 @@ | |||
AspectDeclareExtends.aj | |||
Simple.java | |||
-showWeaveInfo |
@@ -1,3 +0,0 @@ | |||
AspectAdvice.aj | |||
Simple.java | |||
-showWeaveInfo |
@@ -1,2 +0,0 @@ | |||
-1.5 | |||
AspectDeclareAnnotations.aj |
@@ -1,21 +0,0 @@ | |||
// A simple class, interfered with by all sorts of advice ! | |||
public class Simple { | |||
public void m1() { | |||
} | |||
public String m2() { | |||
return "a"; | |||
} | |||
public static void main(String[] argv) { | |||
} | |||
private void mSecret() { | |||
} | |||
} |
@@ -1,3 +0,0 @@ | |||
-showWeaveInfo | |||
-1.5 | |||
AspectDeclareAnnotations.aj |
@@ -1,3 +0,0 @@ | |||
AspectDeclare.aj | |||
Simple.java | |||
-showWeaveInfo |
@@ -1,3 +0,0 @@ | |||
AspectITD.aj | |||
Simple.java | |||
-showWeaveInfo |
@@ -1,2 +0,0 @@ | |||
Simple.jar | |||
-showWeaveInfo |
@@ -1,18 +0,0 @@ | |||
<project name="aspectj-examples" default="spacewar" basedir="."> | |||
<!--target name="init.taskdefs"--> | |||
<taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties"> | |||
<classpath> | |||
<pathelement path="c:\aspectj1.2\lib\aspectjtools.jar"/> | |||
</classpath> | |||
</taskdef> | |||
<!--/target--> | |||
<target name="spacewar"> | |||
<iajc destdir="." argfiles="Two.lst" debug="off" | |||
fork="true" forkclasspath="c:\aspectj1.2\lib\aspectjtools.jar" | |||
classpath="c:\aspectj1.2\lib\aspectjrt.jar"/> | |||
</target> | |||
</project> |
@@ -1,13 +0,0 @@ | |||
Join point 'method-execution(void Simple.m1())' in Type 'Simple' (no debug info available) advised by before advice from 'AspectAdvice' (AspectAdvice_nodebug.jar!AspectAdvice.class:8(from AspectAdvice.aj)) | |||
Join point 'method-execution(void Simple.m1())' in Type 'Simple' (no debug info available) advised by after advice from 'AspectAdvice' (AspectAdvice_nodebug.jar!AspectAdvice.class:12(from AspectAdvice.aj)) | |||
Join point 'method-execution(void Simple.m1())' in Type 'Simple' (no debug info available) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice_nodebug.jar!AspectAdvice.class:16(from AspectAdvice.aj)) | |||
Join point 'method-execution(void Simple.m1())' in Type 'Simple' (no debug info available) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice_nodebug.jar!AspectAdvice.class:20(from AspectAdvice.aj)) | |||
Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (no debug info available) advised by before advice from 'AspectAdvice' (AspectAdvice_nodebug.jar!AspectAdvice.class:8(from AspectAdvice.aj)) | |||
Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (no debug info available) advised by after advice from 'AspectAdvice' (AspectAdvice_nodebug.jar!AspectAdvice.class:12(from AspectAdvice.aj)) | |||
Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (no debug info available) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice_nodebug.jar!AspectAdvice.class:16(from AspectAdvice.aj)) | |||
Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (no debug info available) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice_nodebug.jar!AspectAdvice.class:20(from AspectAdvice.aj)) | |||
Join point 'method-execution(void Simple.main(java.lang.String[]))' in Type 'Simple' (no debug info available) advised by around advice from 'AspectAdvice' (AspectAdvice_nodebug.jar!AspectAdvice.class:24(from AspectAdvice.aj)) [with runtime test] | |||
Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (no debug info available) advised by before advice from 'AspectAdvice' (AspectAdvice_nodebug.jar!AspectAdvice.class:8(from AspectAdvice.aj)) | |||
Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (no debug info available) advised by after advice from 'AspectAdvice' (AspectAdvice_nodebug.jar!AspectAdvice.class:12(from AspectAdvice.aj)) | |||
Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (no debug info available) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice_nodebug.jar!AspectAdvice.class:16(from AspectAdvice.aj)) | |||
Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (no debug info available) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice_nodebug.jar!AspectAdvice.class:20(from AspectAdvice.aj)) |
@@ -1,4 +0,0 @@ | |||
Join point 'method-execution(void Simple.m1())' in Type 'Simple' (Simple.java:5) advised by before advice from 'pkg.AspectInPackage' (AspectInPackage.jar!AspectInPackage.class:7(from AspectInPackage.aj)) | |||
Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (Simple.java:9) advised by before advice from 'pkg.AspectInPackage' (AspectInPackage.jar!AspectInPackage.class:7(from AspectInPackage.aj)) | |||
Join point 'method-execution(void Simple.main(java.lang.String[]))' in Type 'Simple' (Simple.java:13) advised by before advice from 'pkg.AspectInPackage' (AspectInPackage.jar!AspectInPackage.class:7(from AspectInPackage.aj)) | |||
Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (Simple.java:17) advised by before advice from 'pkg.AspectInPackage' (AspectInPackage.jar!AspectInPackage.class:7(from AspectInPackage.aj)) |
@@ -1,4 +0,0 @@ | |||
Join point 'method-execution(void Simple.m1())' in Type 'Simple' (Simple.java:5) advised by before advice from 'pkg.AspectInPackage' (AspectInPackage.class:7(from AspectInPackage.aj)) | |||
Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (Simple.java:9) advised by before advice from 'pkg.AspectInPackage' (AspectInPackage.class:7(from AspectInPackage.aj)) | |||
Join point 'method-execution(void Simple.main(java.lang.String[]))' in Type 'Simple' (Simple.java:13) advised by before advice from 'pkg.AspectInPackage' (AspectInPackage.class:7(from AspectInPackage.aj)) | |||
Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (Simple.java:17) advised by before advice from 'pkg.AspectInPackage' (AspectInPackage.class:7(from AspectInPackage.aj)) |
@@ -1,13 +0,0 @@ | |||
Join point 'method-execution(void Simple.m1())' in Type 'Simple' (Simple.java:5) advised by before advice from 'AspectAdvice' (AspectAdvice.jar!AspectAdvice.class:8(from AspectAdvice.aj)) | |||
Join point 'method-execution(void Simple.m1())' in Type 'Simple' (Simple.java:5) advised by after advice from 'AspectAdvice' (AspectAdvice.jar!AspectAdvice.class:12(from AspectAdvice.aj)) | |||
Join point 'method-execution(void Simple.m1())' in Type 'Simple' (Simple.java:5) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice.jar!AspectAdvice.class:16(from AspectAdvice.aj)) | |||
Join point 'method-execution(void Simple.m1())' in Type 'Simple' (Simple.java:5) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice.jar!AspectAdvice.class:20(from AspectAdvice.aj)) | |||
Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (Simple.java:9) advised by before advice from 'AspectAdvice' (AspectAdvice.jar!AspectAdvice.class:8(from AspectAdvice.aj)) | |||
Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (Simple.java:9) advised by after advice from 'AspectAdvice' (AspectAdvice.jar!AspectAdvice.class:12(from AspectAdvice.aj)) | |||
Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (Simple.java:9) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice.jar!AspectAdvice.class:16(from AspectAdvice.aj)) | |||
Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (Simple.java:9) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice.jar!AspectAdvice.class:20(from AspectAdvice.aj)) | |||
Join point 'method-execution(void Simple.main(java.lang.String[]))' in Type 'Simple' (Simple.java:13) advised by around advice from 'AspectAdvice' (AspectAdvice.jar!AspectAdvice.class:24(from AspectAdvice.aj)) [with runtime test] | |||
Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (Simple.java:17) advised by before advice from 'AspectAdvice' (AspectAdvice.jar!AspectAdvice.class:8(from AspectAdvice.aj)) | |||
Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (Simple.java:17) advised by after advice from 'AspectAdvice' (AspectAdvice.jar!AspectAdvice.class:12(from AspectAdvice.aj)) | |||
Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (Simple.java:17) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice.jar!AspectAdvice.class:16(from AspectAdvice.aj)) | |||
Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (Simple.java:17) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice.jar!AspectAdvice.class:20(from AspectAdvice.aj)) |
@@ -1,13 +0,0 @@ | |||
Join point 'method-execution(void Simple.m1())' in Type 'Simple' (Simple.java:5) advised by before advice from 'AspectAdvice' (AspectAdvice.aj:8) | |||
Join point 'method-execution(void Simple.m1())' in Type 'Simple' (Simple.java:5) advised by after advice from 'AspectAdvice' (AspectAdvice.aj:12) | |||
Join point 'method-execution(void Simple.m1())' in Type 'Simple' (Simple.java:5) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice.aj:16) | |||
Join point 'method-execution(void Simple.m1())' in Type 'Simple' (Simple.java:5) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice.aj:20) | |||
Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (Simple.java:9) advised by before advice from 'AspectAdvice' (AspectAdvice.aj:8) | |||
Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (Simple.java:9) advised by after advice from 'AspectAdvice' (AspectAdvice.aj:12) | |||
Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (Simple.java:9) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice.aj:16) | |||
Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (Simple.java:9) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice.aj:20) | |||
Join point 'method-execution(void Simple.main(java.lang.String[]))' in Type 'Simple' (Simple.java:13) advised by around advice from 'AspectAdvice' (AspectAdvice.aj:24) [with runtime test] | |||
Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (Simple.java:17) advised by before advice from 'AspectAdvice' (AspectAdvice.aj:8) | |||
Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (Simple.java:17) advised by after advice from 'AspectAdvice' (AspectAdvice.aj:12) | |||
Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (Simple.java:17) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice.aj:16) | |||
Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (Simple.java:17) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice.aj:20) |
@@ -1,4 +0,0 @@ | |||
'Test' (AspectDeclareAnnotations.aj:14) is annotated with @anInterface type annotation from 'AspectDeclareAnnotations' (AspectDeclareAnnotations.aj:7) | |||
'public void Test.new(String,int)' (AspectDeclareAnnotations.aj:16) is annotated with @anInterface constructor annotation from 'AspectDeclareAnnotations' (AspectDeclareAnnotations.aj:8) | |||
'public int Test.fac(int)' (AspectDeclareAnnotations.aj:20) is annotated with @anInterface method annotation from 'AspectDeclareAnnotations' (AspectDeclareAnnotations.aj:9) | |||
'public int a' of type 'Test' (AspectDeclareAnnotations.aj) is annotated with @anInterface field annotation from 'AspectDeclareAnnotations' (AspectDeclareAnnotations.aj:10) |
@@ -1 +0,0 @@ | |||
Setting superclass of type 'Simple' (Simple.java) to 'InTheWay' (AspectDeclareExtends.aj) |
@@ -1,2 +0,0 @@ | |||
Softening exceptions in type 'Simple' (no debug info available) as defined by aspect 'AspectDeclareSoft' (AspectDeclareSoft_nodebug.jar!AspectDeclareSoft.class:4(from AspectDeclareSoft.aj)) | |||
Softening exceptions in type 'Simple' (no debug info available) as defined by aspect 'AspectDeclareSoft' (AspectDeclareSoft_nodebug.jar!AspectDeclareSoft.class:6(from AspectDeclareSoft.aj)) |
@@ -1,2 +0,0 @@ | |||
Softening exceptions in type 'Simple' (Simple.java:13) as defined by aspect 'AspectDeclareSoft' (AspectDeclareSoft.jar!AspectDeclareSoft.class:4(from AspectDeclareSoft.aj)) | |||
Softening exceptions in type 'Simple' (Simple.java:13) as defined by aspect 'AspectDeclareSoft' (AspectDeclareSoft.jar!AspectDeclareSoft.class:6(from AspectDeclareSoft.aj)) |
@@ -1,2 +0,0 @@ | |||
Softening exceptions in type 'Simple' (no debug info available) as defined by aspect 'AspectDeclareSoft' (AspectDeclareSoft.aj:4) | |||
Softening exceptions in type 'Simple' (no debug info available) as defined by aspect 'AspectDeclareSoft' (AspectDeclareSoft.aj:6) |
@@ -1,2 +0,0 @@ | |||
Softening exceptions in type 'Simple' (Simple.java:13) as defined by aspect 'AspectDeclareSoft' (AspectDeclareSoft.aj:6) | |||
Softening exceptions in type 'Simple' (Simple.java:13) as defined by aspect 'AspectDeclareSoft' (AspectDeclareSoft.aj:4) |
@@ -1 +0,0 @@ | |||
Extending interface set for type 'Simple' (no debug info available) to include 'MarkerInterface' (AspectDeclare.aj) |
@@ -1 +0,0 @@ | |||
Extending interface set for type 'Simple' (Simple.java) to include 'MarkerInterface' (AspectDeclare.aj) |
@@ -1,4 +0,0 @@ | |||
Type 'Simple' (no debug info available) has intertyped field from 'AspectITD' (AspectITD.aj:'int Simple.fieldint') | |||
Type 'Simple' (no debug info available) has intertyped field from 'AspectITD' (AspectITD.aj:'java.lang.String Simple.fieldstring') | |||
Type 'Simple' (no debug info available) has intertyped method from 'AspectITD' (AspectITD.aj:'int Simple.returnint()') | |||
Type 'Simple' (no debug info available) has intertyped method from 'AspectITD' (AspectITD.aj:'java.lang.String Simple.returnstring()') |
@@ -1,4 +0,0 @@ | |||
Type 'Simple' (Simple.java) has intertyped field from 'AspectITD' (AspectITD.aj:'int Simple.fieldint') | |||
Type 'Simple' (Simple.java) has intertyped field from 'AspectITD' (AspectITD.aj:'java.lang.String Simple.fieldstring') | |||
Type 'Simple' (Simple.java) has intertyped method from 'AspectITD' (AspectITD.aj:'int Simple.returnint()') | |||
Type 'Simple' (Simple.java) has intertyped method from 'AspectITD' (AspectITD.aj:'java.lang.String Simple.returnstring()') |