aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs153
diff options
context:
space:
mode:
authoraclement <aclement>2006-10-23 11:55:54 +0000
committeraclement <aclement>2006-10-23 11:55:54 +0000
commit757004ca6702a97369aac2ba62532f13ac5ced36 (patch)
treee64c1d3a4e7463dc592f9959109633719e7d0165 /tests/bugs153
parentefe6cc79c4c19ebc8f7109f10220b13dc4efffad (diff)
downloadaspectj-757004ca6702a97369aac2ba62532f13ac5ced36.tar.gz
aspectj-757004ca6702a97369aac2ba62532f13ac5ced36.zip
tests and fix for 149908: NPE in org.aspectj.weaver.MemberImpl.getModifiers
Diffstat (limited to 'tests/bugs153')
-rw-r--r--tests/bugs153/pr149908/A.aj6
-rw-r--r--tests/bugs153/pr149908/C.java7
-rw-r--r--tests/bugs153/pr149908/C1.java7
-rw-r--r--tests/bugs153/pr149908/MyStringBuilder.java7
-rw-r--r--tests/bugs153/pr149908/README.txt26
-rw-r--r--tests/bugs153/pr149908/Tracing.aj25
-rw-r--r--tests/bugs153/pr149908/simple.jarbin0 -> 655 bytes
-rw-r--r--tests/bugs153/pr149908/stringBuilder.jarbin0 -> 551 bytes
-rw-r--r--tests/bugs153/pr149908/withoutMethod/MyStringBuilder.java3
9 files changed, 81 insertions, 0 deletions
diff --git a/tests/bugs153/pr149908/A.aj b/tests/bugs153/pr149908/A.aj
new file mode 100644
index 000000000..45aa30e7d
--- /dev/null
+++ b/tests/bugs153/pr149908/A.aj
@@ -0,0 +1,6 @@
+public aspect A {
+
+ before() : call(C+.new(..)) {
+ }
+
+}
diff --git a/tests/bugs153/pr149908/C.java b/tests/bugs153/pr149908/C.java
new file mode 100644
index 000000000..7f4f6073f
--- /dev/null
+++ b/tests/bugs153/pr149908/C.java
@@ -0,0 +1,7 @@
+public class C {
+
+ public void foo() {
+ new MyStringBuilder().append("hello" ," world");
+ }
+
+}
diff --git a/tests/bugs153/pr149908/C1.java b/tests/bugs153/pr149908/C1.java
new file mode 100644
index 000000000..185afbcd3
--- /dev/null
+++ b/tests/bugs153/pr149908/C1.java
@@ -0,0 +1,7 @@
+public class C1 {
+
+ public void bar() {
+ new C();
+ }
+
+}
diff --git a/tests/bugs153/pr149908/MyStringBuilder.java b/tests/bugs153/pr149908/MyStringBuilder.java
new file mode 100644
index 000000000..36f6deebc
--- /dev/null
+++ b/tests/bugs153/pr149908/MyStringBuilder.java
@@ -0,0 +1,7 @@
+public class MyStringBuilder {
+
+ public void append(String s1, String s2) {
+ System.out.println("builder: " + s1 + s2);
+ }
+
+}
diff --git a/tests/bugs153/pr149908/README.txt b/tests/bugs153/pr149908/README.txt
new file mode 100644
index 000000000..de367dd27
--- /dev/null
+++ b/tests/bugs153/pr149908/README.txt
@@ -0,0 +1,26 @@
+This folder contains the code for two tests:
+
+Case 1: A type that was on the classpath when a jar file was created is
+ not on the classpath when the aspects are being compiled and woven
+ with this jar on the inpath. This should result in a cantFindType
+ message.
+
+Case 2: The type exists but one of it's members no longer does. This should
+ result in an unresolvableMember message.
+
+To recreate required files for Case 1 :
+
+1. Compile the MyStringBuilder.java in folder pr149908 type:
+
+ javac MyStringBuilder.java
+
+2. ajc C.java -outjar simple.jar
+
+
+To recreate the required files for Case 2:
+
+1. Navigate to the withoutMethod folder
+
+2. Compile MyStringBuilder.java into ..\stringBuilder.jar:
+
+ ajc MyStringBuilder.java -outjar ..\stringBuilder.jar
diff --git a/tests/bugs153/pr149908/Tracing.aj b/tests/bugs153/pr149908/Tracing.aj
new file mode 100644
index 000000000..0d1f2e5d3
--- /dev/null
+++ b/tests/bugs153/pr149908/Tracing.aj
@@ -0,0 +1,25 @@
+public aspect Tracing {
+
+ private int _callDepth = -1;
+
+ pointcut tracePoints() : !within(Tracing);
+
+ before() : tracePoints() {
+ _callDepth++; print("Before", thisJoinPoint);
+ }
+
+ after() : tracePoints() {
+ print("After", thisJoinPoint);
+ _callDepth--;
+ }
+
+ private void print(String prefix, Object message) {
+ for(int i = 0, spaces = _callDepth * 2; i < spaces; i++) {
+ //MyPrint.print(" ","");
+ }
+
+ System.out.println(prefix + ": " + message);
+ }
+
+
+}
diff --git a/tests/bugs153/pr149908/simple.jar b/tests/bugs153/pr149908/simple.jar
new file mode 100644
index 000000000..16dd602bf
--- /dev/null
+++ b/tests/bugs153/pr149908/simple.jar
Binary files differ
diff --git a/tests/bugs153/pr149908/stringBuilder.jar b/tests/bugs153/pr149908/stringBuilder.jar
new file mode 100644
index 000000000..0586faacd
--- /dev/null
+++ b/tests/bugs153/pr149908/stringBuilder.jar
Binary files differ
diff --git a/tests/bugs153/pr149908/withoutMethod/MyStringBuilder.java b/tests/bugs153/pr149908/withoutMethod/MyStringBuilder.java
new file mode 100644
index 000000000..0a3e6f760
--- /dev/null
+++ b/tests/bugs153/pr149908/withoutMethod/MyStringBuilder.java
@@ -0,0 +1,3 @@
+public class MyStringBuilder {
+
+}