aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core/testdata
diff options
context:
space:
mode:
authoracolyer <acolyer>2004-04-02 12:03:40 +0000
committeracolyer <acolyer>2004-04-02 12:03:40 +0000
commit33d8ee9eededcd1219a6cbd1d063af005d40a3f7 (patch)
treed30f882cbab26f54b62dc1cddfab666d97d6bd3d /org.aspectj.ajdt.core/testdata
parentfc1c15110e8a9cfafabad0dcc4c10445725c9fb2 (diff)
downloadaspectj-33d8ee9eededcd1219a6cbd1d063af005d40a3f7.tar.gz
aspectj-33d8ee9eededcd1219a6cbd1d063af005d40a3f7.zip
fix for Bugzilla Bug 31460
Weaving class loader
Diffstat (limited to 'org.aspectj.ajdt.core/testdata')
-rw-r--r--org.aspectj.ajdt.core/testdata/src1/LTWAroundClosure.aj20
-rw-r--r--org.aspectj.ajdt.core/testdata/src1/LTWAspect.aj12
-rw-r--r--org.aspectj.ajdt.core/testdata/src1/LTWFieldITD.aj16
-rw-r--r--org.aspectj.ajdt.core/testdata/src1/LTWHelloWorld.java24
-rw-r--r--org.aspectj.ajdt.core/testdata/src1/LTWInterfaceITD.aj18
-rw-r--r--org.aspectj.ajdt.core/testdata/src1/LTWMethodITD.aj22
-rw-r--r--org.aspectj.ajdt.core/testdata/src1/LTWPerthis.aj13
-rw-r--r--org.aspectj.ajdt.core/testdata/src1/ltw/LTWPackageTest.java8
8 files changed, 133 insertions, 0 deletions
diff --git a/org.aspectj.ajdt.core/testdata/src1/LTWAroundClosure.aj b/org.aspectj.ajdt.core/testdata/src1/LTWAroundClosure.aj
new file mode 100644
index 000000000..80af46fd7
--- /dev/null
+++ b/org.aspectj.ajdt.core/testdata/src1/LTWAroundClosure.aj
@@ -0,0 +1,20 @@
+import java.util.List;
+
+public aspect LTWAroundClosure {
+
+ pointcut println (List list) :
+ execution(* println()) && this(list);
+
+ void around (final List list) : println (list) {
+
+ Runnable runnable = new Runnable() {
+ public void run () {
+ System.err.println("LTWAroundClosure.run(" + thisJoinPointStaticPart + ")");
+ proceed(list);
+ }
+ };
+ runnable.run();
+ list.add("LTWAroundClosure");
+ }
+
+}
diff --git a/org.aspectj.ajdt.core/testdata/src1/LTWAspect.aj b/org.aspectj.ajdt.core/testdata/src1/LTWAspect.aj
new file mode 100644
index 000000000..1721b4ef7
--- /dev/null
+++ b/org.aspectj.ajdt.core/testdata/src1/LTWAspect.aj
@@ -0,0 +1,12 @@
+import java.util.List;
+
+public privileged aspect LTWAspect {
+
+ pointcut method (List list) :
+ execution(* LTWHelloWorld.*(..)) && this(list);
+
+ before (List list) : method (list) {
+ System.err.println("LTWAspect.method(" + thisJoinPointStaticPart + ")");
+ list.add("LTWAspect");
+ }
+}
diff --git a/org.aspectj.ajdt.core/testdata/src1/LTWFieldITD.aj b/org.aspectj.ajdt.core/testdata/src1/LTWFieldITD.aj
new file mode 100644
index 000000000..87f441544
--- /dev/null
+++ b/org.aspectj.ajdt.core/testdata/src1/LTWFieldITD.aj
@@ -0,0 +1,16 @@
+import java.util.List;
+
+public aspect LTWFieldITD {
+
+ private int LTWHelloWorld.intField = 999;
+
+ pointcut init (LTWHelloWorld hw) :
+ execution(LTWHelloWorld.new()) && this(hw);
+
+ after (LTWHelloWorld hw) : init (hw) {
+ System.err.println("LTWFieldITD.init(" + thisJoinPointStaticPart + ")");
+ hw.intField = 999999;
+ hw.add(getClass().getName());
+ }
+
+}
diff --git a/org.aspectj.ajdt.core/testdata/src1/LTWHelloWorld.java b/org.aspectj.ajdt.core/testdata/src1/LTWHelloWorld.java
new file mode 100644
index 000000000..ec533506d
--- /dev/null
+++ b/org.aspectj.ajdt.core/testdata/src1/LTWHelloWorld.java
@@ -0,0 +1,24 @@
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Properties;
+
+public class LTWHelloWorld extends ArrayList {
+
+ private String message = "Hello World!";
+
+ public void println () {
+ System.out.println(message);
+ }
+
+ public static void main(String[] args) {
+ LTWHelloWorld hw = new LTWHelloWorld();
+ hw.println();
+ for (int i = 0; i < args.length; i++) {
+ String jp = args[i];
+ if (!hw.contains(jp)) {
+ throw new RuntimeException(jp + " missing");
+ }
+ }
+ }
+
+}
diff --git a/org.aspectj.ajdt.core/testdata/src1/LTWInterfaceITD.aj b/org.aspectj.ajdt.core/testdata/src1/LTWInterfaceITD.aj
new file mode 100644
index 000000000..e7fa6a46a
--- /dev/null
+++ b/org.aspectj.ajdt.core/testdata/src1/LTWInterfaceITD.aj
@@ -0,0 +1,18 @@
+import java.util.List;
+
+public privileged aspect LTWInterfaceITD {
+
+ declare parents : LTWHelloWorld implements Runnable;
+
+ public void LTWHelloWorld.run () {
+ add("LTWInterfaceITD");
+ }
+
+ pointcut init (LTWHelloWorld hw) :
+ execution(LTWHelloWorld.new()) && this(hw);
+
+ after (LTWHelloWorld hw) : init (hw) {
+ System.err.println("LTWInterfaceITD.init(" + thisJoinPointStaticPart + ")");
+ hw.run();
+ }
+}
diff --git a/org.aspectj.ajdt.core/testdata/src1/LTWMethodITD.aj b/org.aspectj.ajdt.core/testdata/src1/LTWMethodITD.aj
new file mode 100644
index 000000000..35049f04f
--- /dev/null
+++ b/org.aspectj.ajdt.core/testdata/src1/LTWMethodITD.aj
@@ -0,0 +1,22 @@
+import java.util.List;
+
+public privileged aspect LTWMethodITD {
+
+ public String LTWHelloWorld.getMessage () {
+ return message;
+ }
+
+ public void LTWHelloWorld.setMessage (String newMessage) {
+ message = newMessage;
+ }
+
+ pointcut init (LTWHelloWorld hw) :
+ execution(LTWHelloWorld.new()) && this(hw);
+
+ after (LTWHelloWorld hw) : init (hw) {
+ System.err.println("LTWMethodITD.init(" + thisJoinPointStaticPart + ")");
+ hw.getMessage();
+ hw.setMessage("Hello LTWMethodITD");
+ hw.add(getClass().getName());
+ }
+} \ No newline at end of file
diff --git a/org.aspectj.ajdt.core/testdata/src1/LTWPerthis.aj b/org.aspectj.ajdt.core/testdata/src1/LTWPerthis.aj
new file mode 100644
index 000000000..955d72096
--- /dev/null
+++ b/org.aspectj.ajdt.core/testdata/src1/LTWPerthis.aj
@@ -0,0 +1,13 @@
+import java.util.List;
+
+public aspect LTWPerthis perthis(this(LTWHelloWorld)) {
+
+ pointcut println (List list) :
+ execution(* println()) && this(list);
+
+ before (List list) : println (list) {
+ System.err.println("LTWPerthis.println(" + thisJoinPointStaticPart + ")");
+ list.add(getClass().getName());
+ }
+
+}
diff --git a/org.aspectj.ajdt.core/testdata/src1/ltw/LTWPackageTest.java b/org.aspectj.ajdt.core/testdata/src1/ltw/LTWPackageTest.java
new file mode 100644
index 000000000..e749db20c
--- /dev/null
+++ b/org.aspectj.ajdt.core/testdata/src1/ltw/LTWPackageTest.java
@@ -0,0 +1,8 @@
+package ltw;
+
+public class LTWPackageTest {
+
+ public static void main(String[] args) {
+ }
+
+}