]> source.dussan.org Git - aspectj.git/commitdiff
246264: test and fix
authoraclement <aclement>
Thu, 4 Sep 2008 19:07:22 +0000 (19:07 +0000)
committeraclement <aclement>
Thu, 4 Sep 2008 19:07:22 +0000 (19:07 +0000)
tests/bugs162/pr246264/A.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java
tests/src/org/aspectj/systemtest/ajc162/ajc162.xml

diff --git a/tests/bugs162/pr246264/A.java b/tests/bugs162/pr246264/A.java
new file mode 100644 (file)
index 0000000..919166a
--- /dev/null
@@ -0,0 +1,19 @@
+enum Color {R,G,B;}
+@interface I { public Color a(); }
+@interface J { public Color b() default Color.B; }
+
+public class A {
+  @J
+  @I(a=Color.R)
+  public static void main(String []argv) {
+  }
+}
+
+aspect X {
+
+  before(Color var): execution(* main(..)) && @annotation(I(var)) {
+    if (var!=Color.R) {
+      throw new RuntimeException("Wrong! Was "+var);
+    }
+  }
+}
index dbb7e8a182bdb42b30808db9058ac01f15e9da3d..bce389c855e132c3b7513c3132095a58b4cf9ba8 100644 (file)
@@ -18,7 +18,8 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
 
 public class Ajc162Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
        
-       // AspectJ1.6.2 
+       // AspectJ1.6.2  
+       public void testAnnoValueBinding_pr246264() { runTest("anno value binding"); }
        public void testAroundAdviceProceed_pr211607() { runTest("around advice proceed"); }
 //     public void testAdvisingInterfaces_pr163005() { runTest("advising joinpoints in interfaces"); }
        public void testChainedItds_pr176905() { runTest("chained itds"); }
index 664e5e527613e5dc1e2755515823cef2901dc97b..f592b9717d96263e49fbdb7bbeb7b22ee25e1a76 100644 (file)
@@ -3,6 +3,11 @@
 <!-- AspectJ v1.6.2 Tests -->
 <suite>
        
+   <ajc-test dir="bugs162/pr246264" title="anno value binding">
+     <compile options="-1.5" files="A.java"/>
+     <run class="A"/>
+   </ajc-test>
+   
    <ajc-test dir="bugs162/pr211607" title="around advice proceed">
      <compile options="-1.5" files="Bug.java"/>
      <run class="Bug"/>