--- /dev/null
+import java.lang.reflect.Method;
+import java.util.*;
+
+interface Super<T> {
+ public T getterA();
+}
+
+public class Bridged implements Super<String> {
+ public String getterA() {
+ return "";
+ }
+
+ // Print BRIDGE status of all getter* methods
+ public static void main(String[] argv) {
+ Method[] ms = Bridged.class.getMethods();
+ List results = new ArrayList();
+ for (int i = 0; i < ms.length; i++) {
+ if (ms[i].getName().startsWith("getter")) {
+ results.add(ms[i].getName()+"()"+ms[i].getReturnType().getName()+ " isBridged?"+((ms[i].getModifiers() & 0x0040) != 0));
+ }
+ }
+ Collections.sort(results);
+ for (Iterator iterator = results.iterator(); iterator.hasNext();) {
+ String entry = (String) iterator.next();
+ System.out.println(entry);
+ }
+ }
+}
+
+aspect X {
+ public T Super<T>.getterB() { return null; }
+}
+
import org.aspectj.systemtest.ajc160.AllTestsAspectJ160;
import org.aspectj.systemtest.ajc161.AllTestsAspectJ161;
import org.aspectj.systemtest.ajc162.AllTestsAspectJ162;
+import org.aspectj.systemtest.ajc163.AllTestsAspectJ163;
public class AllTests16 {
public static Test suite() {
TestSuite suite = new TestSuite("AspectJ System Test Suite - JDK 1.6");
- //$JUnit-BEGIN$
+ // $JUnit-BEGIN$
suite.addTest(AllTestsAspectJ160.suite()); // dont require a 1.6 JRE to run but checks 1.6 compiler behaviour
- suite.addTest(AllTestsAspectJ161.suite()); // dont require a 1.6 JRE to run but checks 1.6 compiler behaviour
- suite.addTest(AllTestsAspectJ162.suite()); // dont require a 1.6 JRE to run but checks 1.6 compiler behaviour
+ suite.addTest(AllTestsAspectJ161.suite()); // dont require a 1.6 JRE to run but checks 1.6 compiler behaviour
+ suite.addTest(AllTestsAspectJ162.suite()); // dont require a 1.6 JRE to run but checks 1.6 compiler behaviour
+ suite.addTest(AllTestsAspectJ163.suite()); // dont require a 1.6 JRE to run but checks 1.6 compiler behaviour
suite.addTest(AllTests15.suite());
- //$JUnit-END$
+ // $JUnit-END$
return suite;
}
}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2008 Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Andy Clement - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc163;
+
+import java.io.File;
+
+import junit.framework.Test;
+
+import org.aspectj.testing.XMLBasedAjcTestCase;
+
+public class Ajc163Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+
+ public void testGenericMethodBridging_pr250493() {
+ runTest("bridge methods for generic itds");
+ }
+
+ public static Test suite() {
+ return XMLBasedAjcTestCase.loadSuite(Ajc163Tests.class);
+ }
+
+ protected File getSpecFile() {
+ return new File("../tests/src/org/aspectj/systemtest/ajc163/ajc163.xml");
+ }
+
+}
\ No newline at end of file
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2008 Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Andy Clement - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc163;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTestsAspectJ163 {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("AspectJ 1.6.3 tests");
+ // $JUnit-BEGIN$
+ suite.addTest(Ajc163Tests.suite());
+ // $JUnit-END$
+ return suite;
+ }
+}
--- /dev/null
+<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
+
+<suite>
+
+ <ajc-test dir="bugs163/pr250493" title="bridge methods for generic itds">
+ <compile files="Bridged.java" options="-1.5"/>
+ <run class="Bridged">
+ <stdout>
+ <line text="getterA()java.lang.Object isBridged?true"/>
+ <line text="getterA()java.lang.String isBridged?false"/>
+ <line text="getterB()java.lang.Object isBridged?true"/>
+ <line text="getterB()java.lang.String isBridged?false"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+</suite>
\ No newline at end of file