--- /dev/null
+// Simple aspect that tramples all over Simple.java\r
+\r
+public aspect AspectAdvice {\r
+\r
+ // Go through all the kinds of things that might affect a type:\r
+ pointcut methodRunning(): execution(* *(..)) && !execution(* main(..));\r
+ \r
+ before(): methodRunning() {\r
+ System.err.println("BEFORE ADVICE");\r
+ }\r
+ \r
+ after(): methodRunning() {\r
+ System.err.println("AFTER ADVICE");\r
+ }\r
+\r
+ after() returning: methodRunning() {\r
+ System.err.println("AFTER RETURNING ADVICE");\r
+ }\r
+\r
+ after() throwing : methodRunning() {\r
+ System.err.println("AFTER THROWING ADVICE");\r
+ }\r
+ \r
+ void around(): execution(* main(..)) && !cflow(adviceexecution()){\r
+ System.err.println("AROUND ADVICE");\r
+ proceed();\r
+ }\r
+ \r
+ \r
+ interface markerInterface { \r
+ } \r
+}\r
--- /dev/null
+// Simple aspect that tramples all over Simple.java\r
+\r
+public aspect AspectDeclare {\r
+ \r
+ pointcut methodRunning(): execution(* *(..));\r
+ \r
+ declare parents: Simple implements MarkerInterface;\r
+ \r
+// declare parents: Simple extends InTheWay;\r
+ \r
+// declare soft: \r
+// \r
+// declare precedence:\r
+// \r
+// declare warning:\r
+// \r
+// declare error:\r
+// \r
+}\r
+\r
+ \r
+interface MarkerInterface {}\r
+\r
+class InTheWay {}
\ No newline at end of file
--- /dev/null
+// Simple aspect that tramples all over Simple.java\r
+\r
+public aspect AspectDeclareExtends {\r
+ \r
+ pointcut methodRunning(): execution(* *(..));\r
+ \r
+ declare parents: Simple extends InTheWay;\r
+ \r
+// declare soft: \r
+// \r
+// declare precedence:\r
+// \r
+// declare warning:\r
+// \r
+// declare error:\r
+// \r
+}\r
+\r
+ \r
+interface MarkerInterface {}\r
+\r
+class InTheWay {}\r
--- /dev/null
+\r
+public aspect AspectDeclareSoft {\r
+ \r
+ declare soft: MyException: execution(* main(..));\r
+\r
+ declare soft: Exception+: execution(* main(..));\r
+\r
+}\r
+class MyException extends Exception {}\r
--- /dev/null
+// Simple aspect that tramples all over Simple.java\r
+\r
+public aspect AspectITD {\r
+ \r
+ int Simple.fieldint = 5;\r
+ \r
+ String Simple.fieldstring = "hello";\r
+ \r
+ public int Simple.returnint() {\r
+ return 5;\r
+ }\r
+ \r
+ public String Simple.returnstring() {\r
+ return "abc";\r
+ }\r
+ \r
+}
\ No newline at end of file
--- /dev/null
+-showWeaveInfo\r
--- /dev/null
+Simple.java\r
+-showWeaveInfo\r
+AspectDeclareSoft.aj\r
--- /dev/null
+AspectDeclareExtends.aj\r
+Simple.java\r
+-showWeaveInfo\r
--- /dev/null
+AspectAdvice.aj\r
+Simple.java\r
+-showWeaveInfo\r
--- /dev/null
+// 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() {
+
+ }
+
+}
\ No newline at end of file
--- /dev/null
+AspectDeclare.aj\r
+Simple.java\r
+-showWeaveInfo\r
--- /dev/null
+AspectITD.aj\r
+Simple.java\r
+-showWeaveInfo\r
--- /dev/null
+Simple.jar\r
+-showWeaveInfo\r
--- /dev/null
+<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>
--- /dev/null
+Type 'Simple' (no debug info available) advised by before advice from 'AspectAdvice' (AspectAdvice.aj:8)
+Type 'Simple' (no debug info available) advised by after advice from 'AspectAdvice' (AspectAdvice.aj:12)
+Type 'Simple' (no debug info available) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice.aj:16)
+Type 'Simple' (no debug info available) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice.aj:20)
+Type 'Simple' (no debug info available) advised by before advice from 'AspectAdvice' (AspectAdvice.aj:8)
+Type 'Simple' (no debug info available) advised by after advice from 'AspectAdvice' (AspectAdvice.aj:12)
+Type 'Simple' (no debug info available) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice.aj:16)
+Type 'Simple' (no debug info available) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice.aj:20)
+Type 'Simple' (no debug info available) advised by around advice from 'AspectAdvice' (AspectAdvice.aj:24)
+Type 'Simple' (no debug info available) advised by before advice from 'AspectAdvice' (AspectAdvice.aj:8)
+Type 'Simple' (no debug info available) advised by after advice from 'AspectAdvice' (AspectAdvice.aj:12)
+Type 'Simple' (no debug info available) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice.aj:16)
+Type 'Simple' (no debug info available) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice.aj:20)
--- /dev/null
+Type 'Simple' (Simple.java:7) advised by before advice from 'AspectAdvice' (AspectAdvice.aj:8)
+Type 'Simple' (Simple.java:7) advised by after advice from 'AspectAdvice' (AspectAdvice.aj:12)
+Type 'Simple' (Simple.java:7) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice.aj:16)
+Type 'Simple' (Simple.java:7) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice.aj:20)
+Type 'Simple' (Simple.java:10) advised by before advice from 'AspectAdvice' (AspectAdvice.aj:8)
+Type 'Simple' (Simple.java:10) advised by after advice from 'AspectAdvice' (AspectAdvice.aj:12)
+Type 'Simple' (Simple.java:10) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice.aj:16)
+Type 'Simple' (Simple.java:10) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice.aj:20)
+Type 'Simple' (Simple.java:15) advised by around advice from 'AspectAdvice' (AspectAdvice.aj:24)
+Type 'Simple' (Simple.java:19) advised by before advice from 'AspectAdvice' (AspectAdvice.aj:8)
+Type 'Simple' (Simple.java:19) advised by after advice from 'AspectAdvice' (AspectAdvice.aj:12)
+Type 'Simple' (Simple.java:19) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice.aj:16)
+Type 'Simple' (Simple.java:19) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice.aj:20)
--- /dev/null
+Type 'Simple' (Simple.java:7) advised by before advice from 'AspectAdvice' (AspectAdvice.aj:8)
+Type 'Simple' (Simple.java:7) advised by after advice from 'AspectAdvice' (AspectAdvice.aj:12)
+Type 'Simple' (Simple.java:7) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice.aj:16)
+Type 'Simple' (Simple.java:7) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice.aj:20)
+Type 'Simple' (Simple.java:10) advised by before advice from 'AspectAdvice' (AspectAdvice.aj:8)
+Type 'Simple' (Simple.java:10) advised by after advice from 'AspectAdvice' (AspectAdvice.aj:12)
+Type 'Simple' (Simple.java:10) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice.aj:16)
+Type 'Simple' (Simple.java:10) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice.aj:20)
+Type 'Simple' (Simple.java:15) advised by around advice from 'AspectAdvice' (AspectAdvice.aj:24)
+Type 'Simple' (Simple.java:19) advised by before advice from 'AspectAdvice' (AspectAdvice.aj:8)
+Type 'Simple' (Simple.java:19) advised by after advice from 'AspectAdvice' (AspectAdvice.aj:12)
+Type 'Simple' (Simple.java:19) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice.aj:16)
+Type 'Simple' (Simple.java:19) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice.aj:20)
--- /dev/null
+Setting superclass of type 'Simple' (Simple.java) to 'InTheWay' (AspectDeclareExtends.aj)
--- /dev/null
+Softening exceptions in type 'Simple' (no debug info available) as defined by aspect 'AspectDeclareSoft' (AspectDeclareSoft.aj:6)
+Softening exceptions in type 'Simple' (no debug info available) as defined by aspect 'AspectDeclareSoft' (AspectDeclareSoft.aj:4)
--- /dev/null
+Softening exceptions in type 'Simple' (Simple.java:15) as defined by aspect 'AspectDeclareSoft' (AspectDeclareSoft.aj:6)
+Softening exceptions in type 'Simple' (Simple.java:15) as defined by aspect 'AspectDeclareSoft' (AspectDeclareSoft.aj:4)
--- /dev/null
+Extending interface set for type 'Simple' (no debug info available) to include 'MarkerInterface' (AspectDeclare.aj)
--- /dev/null
+Extending interface set for type 'Simple' (Simple.java) to include 'MarkerInterface' (AspectDeclare.aj)
--- /dev/null
+Type 'Simple' (no debug info available) has intertyped method from 'AspectITD' (AspectITD.aj:'java.lang.String Simple.returnstring()')
+Type 'Simple' (no debug info available) has intertyped method from 'AspectITD' (AspectITD.aj:'int Simple.returnint()')
+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 field from 'AspectITD' (AspectITD.aj:'int Simple.fieldint')
--- /dev/null
+Type 'Simple' (Simple.java) has intertyped method from 'AspectITD' (AspectITD.aj:'java.lang.String Simple.returnstring()')
+Type 'Simple' (Simple.java) has intertyped method from 'AspectITD' (AspectITD.aj:'int Simple.returnint()')
+Type 'Simple' (Simple.java) has intertyped field from 'AspectITD' (AspectITD.aj:'java.lang.String Simple.fieldstring')
+Type 'Simple' (Simple.java) has intertyped field from 'AspectITD' (AspectITD.aj:'int Simple.fieldint')