]> source.dussan.org Git - aspectj.git/commitdiff
252285: tests
authoraclement <aclement>
Tue, 28 Oct 2008 00:40:20 +0000 (00:40 +0000)
committeraclement <aclement>
Tue, 28 Oct 2008 00:40:20 +0000 (00:40 +0000)
tests/bugs163/pr252285/Bridged.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java
tests/src/org/aspectj/systemtest/ajc163/ajc163.xml

diff --git a/tests/bugs163/pr252285/Bridged.java b/tests/bugs163/pr252285/Bridged.java
new file mode 100644 (file)
index 0000000..94633e1
--- /dev/null
@@ -0,0 +1,31 @@
+import java.lang.reflect.Method;
+import java.util.*;
+
+interface Super<R extends Number> {
+}
+
+aspect X {
+ private T Super<T>.getterA;
+}
+
+
+public class Bridged implements Super<Integer> {
+
+        // 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().indexOf("getter")!=-1) {
+                               
+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);
+                }
+        }
+}
+
index 756f05ddf45711d8a00f5d0115e189d4a655d7d0..9fab888d17ace1502a1d30fa77022ad079156695 100644 (file)
@@ -30,6 +30,10 @@ public class Ajc163Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
                runTest("bridge methods for generic itds");
        }
 
+       public void testGenericFieldBridging_pr252285() {
+               runTest("bridge methods for generic itd fields");
+       }
+
        public static Test suite() {
                return XMLBasedAjcTestCase.loadSuite(Ajc163Tests.class);
        }
index cb5d11813743d51bd4bd3a735299dabf34c9346c..519cf9fddc553b5455fb8b5ee43be7c16ff33a25 100644 (file)
         </stdout>
       </run>
     </ajc-test>
+    
+    <ajc-test dir="bugs163/pr252285" title="bridge methods for generic itd fields">
+      <compile files="Bridged.java" options="-1.5"/>
+      <run class="Bridged">
+        <stdout>
+          <line text="ajc$interFieldGet$X$Super$getterA()java.lang.Integer isBridged?false"/>
+          <line text="ajc$interFieldGet$X$Super$getterA()java.lang.Number isBridged?true"/>
+          <line text="ajc$interFieldSet$X$Super$getterA()void isBridged?false"/>
+          <line text="ajc$interFieldSet$X$Super$getterA()void isBridged?true"/>
+        </stdout>
+      </run>
+    </ajc-test>
 
 </suite>
\ No newline at end of file