]> source.dussan.org Git - aspectj.git/commitdiff
251326: testcase
authoraclement <aclement>
Tue, 9 Dec 2008 19:21:17 +0000 (19:21 +0000)
committeraclement <aclement>
Tue, 9 Dec 2008 19:21:17 +0000 (19:21 +0000)
tests/bugs163/pr251326/pkgA/Listener.java [new file with mode: 0644]
tests/bugs163/pr251326/pkgA/Target.java [new file with mode: 0644]
tests/bugs163/pr251326/pkgB/InferListener.aj [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/pr251326/pkgA/Listener.java b/tests/bugs163/pr251326/pkgA/Listener.java
new file mode 100644 (file)
index 0000000..d3a6f68
--- /dev/null
@@ -0,0 +1,7 @@
+package pkgA;
+
+public interface Listener {
+       
+       public void happened(String event);
+       
+}
diff --git a/tests/bugs163/pr251326/pkgA/Target.java b/tests/bugs163/pr251326/pkgA/Target.java
new file mode 100644 (file)
index 0000000..00e1a5f
--- /dev/null
@@ -0,0 +1,19 @@
+package pkgA;
+
+public class Target {
+       
+       public Listener listenA() {
+               return new Listener() {
+                       public void happened(String event) {
+                               System.out.println(event);
+                       }
+               };
+       }
+       
+       public static void main(String[] args) {
+               Target t = new Target();
+               t.listenA().happened("Simple A");
+               t.listenB().happened("Inferred B");
+       }
+       
+}
diff --git a/tests/bugs163/pr251326/pkgB/InferListener.aj b/tests/bugs163/pr251326/pkgB/InferListener.aj
new file mode 100644 (file)
index 0000000..7dfa141
--- /dev/null
@@ -0,0 +1,16 @@
+package pkgB;
+
+import pkgA.Listener;
+import pkgA.Target;
+
+public aspect InferListener {
+       
+       public Listener Target.listenB() {
+               return new Listener() {
+                       public void happened(String event) {
+                               System.out.println(event);
+                       }
+               };
+       }
+       
+}
index 66f7a14c422684ce55eb97386444b478606d3530..82bc47c822335fa597898fe953859e1cbf738bc4 100644 (file)
@@ -27,6 +27,9 @@ import org.aspectj.testing.Utils;
 import org.aspectj.testing.XMLBasedAjcTestCase;
 
 public class Ajc163Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+//     public void testGenericMethodBridging_pr251326() {
+//             runTest("itd anonymous inner class in wrong package");
+//     }
 
        public void testAtTargetPlus_pr255856() {
                runTest("attarget with plus");
index e3fcb32b26f5cb0c3c7cb7c4834b7084c48acf13..bdeaeeb0103638193304dbcb89ad56e05b49bef5 100644 (file)
       </run>
     </ajc-test>
 
+    <ajc-test dir="bugs163/pr251326" title="itd anonymous inner class in wrong package">
+      <compile files="pkgA/Listener.java pkgA/Target.java pkgB/InferListener.aj" options="-1.5"/>
+      <run class="pkgA.Target">
+        <stdout>
+          <line text="Simple A"/>
+          <line text="Inferred B"/>
+        </stdout>
+      </run>
+    </ajc-test>
+
 </suite>
\ No newline at end of file