aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2006-06-21 11:33:21 +0000
committeraclement <aclement>2006-06-21 11:33:21 +0000
commit13dde4efd453d32bb4f25781a8fa7aafc2cef850 (patch)
treeaea6550021dad48c59f320ad284f4574b83dd065 /tests
parent791f8a7c3f37d9b10b8ad1692df998733bbc2f20 (diff)
downloadaspectj-13dde4efd453d32bb4f25781a8fa7aafc2cef850.tar.gz
aspectj-13dde4efd453d32bb4f25781a8fa7aafc2cef850.zip
test and fix for 147801: rogue bridge methods in a funky configuration.
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs152/pr147801/Advisor.aj8
-rw-r--r--tests/bugs152/pr147801/Foo.java30
-rw-r--r--tests/bugs152/pr147801/PreparedStatement.java3
-rw-r--r--tests/bugs152/pr147801/aop.xml6
-rw-r--r--tests/bugs152/pr147801/foo.jarbin0 -> 2106 bytes
-rw-r--r--tests/bugs152/pr147801/readme.txt18
-rw-r--r--tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java1
-rw-r--r--tests/src/org/aspectj/systemtest/ajc152/ajc152.xml10
8 files changed, 76 insertions, 0 deletions
diff --git a/tests/bugs152/pr147801/Advisor.aj b/tests/bugs152/pr147801/Advisor.aj
new file mode 100644
index 000000000..ac09aafc6
--- /dev/null
+++ b/tests/bugs152/pr147801/Advisor.aj
@@ -0,0 +1,8 @@
+public aspect Advisor {
+
+ before(): staticinitialization(*oo) {
+ System.err.println("x");
+ }
+
+ declare parents: Foo implements java.io.Serializable;
+}
diff --git a/tests/bugs152/pr147801/Foo.java b/tests/bugs152/pr147801/Foo.java
new file mode 100644
index 000000000..b9272c802
--- /dev/null
+++ b/tests/bugs152/pr147801/Foo.java
@@ -0,0 +1,30 @@
+import java.lang.reflect.Method;
+
+public class Foo implements PreparedStatement {
+
+ public static void main(String []argv) throws Exception {
+ new Foo().getParameterMetaData();
+ Method[] m = Foo.class.getMethods();
+ int count = 1;
+ for (int i = 0; i < m.length; i++) {
+ Method method = m[i];
+ if (method.toString().indexOf("Foo.getParameterMetaData")!=-1)
+ System.err.println((count++)+") "+method);
+ }
+ }
+ public Sub getParameterMetaData() throws MyException {
+ return null;
+ }
+}
+
+class Sub {}
+
+interface PreparedStatement {
+// public ParameterMetaData getParameterMetaData() throws MyException;
+}
+
+class MyException extends Exception {}
+
+interface ParameterMetaData {}
+
+interface SubParameterMetaData extends ParameterMetaData {}
diff --git a/tests/bugs152/pr147801/PreparedStatement.java b/tests/bugs152/pr147801/PreparedStatement.java
new file mode 100644
index 000000000..7e6ba2547
--- /dev/null
+++ b/tests/bugs152/pr147801/PreparedStatement.java
@@ -0,0 +1,3 @@
+interface PreparedStatement {
+ public ParameterMetaData getParameterMetaData() throws MyException;
+}
diff --git a/tests/bugs152/pr147801/aop.xml b/tests/bugs152/pr147801/aop.xml
new file mode 100644
index 000000000..5e193b9f6
--- /dev/null
+++ b/tests/bugs152/pr147801/aop.xml
@@ -0,0 +1,6 @@
+<aspectj>
+ <weaver options="-verbose"/>
+ <aspects>
+ <aspect name="Advisor"/>
+ </aspects>
+</aspectj>
diff --git a/tests/bugs152/pr147801/foo.jar b/tests/bugs152/pr147801/foo.jar
new file mode 100644
index 000000000..45155705d
--- /dev/null
+++ b/tests/bugs152/pr147801/foo.jar
Binary files differ
diff --git a/tests/bugs152/pr147801/readme.txt b/tests/bugs152/pr147801/readme.txt
new file mode 100644
index 000000000..28e5daad5
--- /dev/null
+++ b/tests/bugs152/pr147801/readme.txt
@@ -0,0 +1,18 @@
+to rebuild foo.jar:
+
+
+Build Foo.java - it includes a definition of PreparedStatement with no method specified
+
+mkdir out
+javac -d out Foo.java
+
+Build a new PreparedStatement that includes the method
+
+javac -d out PreparedStatement.java
+
+Build the jar
+
+cd out
+jar -cvMf ../foo.jar *
+
+You now have a jar where the Foo.class contains an invalid override...
diff --git a/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java b/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java
index f0be4c6ee..22c02cd03 100644
--- a/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java
@@ -32,6 +32,7 @@ public class Ajc152Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
// public void testBrokenIfArgsCflowAtAj_pr145018() { runTest("ataj crashing with cflow, if and args");}
// public void testItdCallingGenericMethod_pr145391() { runTest("itd calling generic method");}
// public void testItdCallingGenericMethod_pr145391_2() { runTest("itd calling generic method - 2");}
+ public void testDuplicateBridgeMethods_pr147801_1() { runTest("duplicate bridge methods");}
public void testPackageIgnoredForException_pr147701_1() { runTest("package for exception ignored");}
public void testPackageIgnoredForException_pr147701_2() { runTest("package for exception ignored - 2");}
public void testPackageIgnoredForException_pr147701_3() { runTest("package for exception ignored - 3");}
diff --git a/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml b/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml
index d6a132ee5..370d24ad9 100644
--- a/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml
+++ b/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml
@@ -720,4 +720,14 @@
</compile>
</ajc-test>
+ <ajc-test dir="bugs152/pr147801" title="duplicate bridge methods">
+ <compile files="Advisor.aj" inpath="foo.jar" options="-1.5"/>
+ <run class="Foo">
+ <stderr>
+ <line text="x"/>
+ <line text="1) public Sub Foo.getParameterMetaData() throws MyException"/>
+ </stderr>
+ </run>
+ </ajc-test>
+
</suite> \ No newline at end of file