]> source.dussan.org Git - aspectj.git/commitdiff
377096: Fix for corrupt annotation creation
authorAndy Clement <aclement@gopivotal.com>
Mon, 12 May 2014 19:18:46 +0000 (12:18 -0700)
committerAndy Clement <aclement@gopivotal.com>
Mon, 12 May 2014 19:18:46 +0000 (12:18 -0700)
org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip
org.eclipse.jdt.core/jdtcore-for-aspectj.jar
tests/bugs181/377096/A.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc180/AllTestsAspectJ180.java
tests/src/org/aspectj/systemtest/ajc181/Ajc181Tests.java
tests/src/org/aspectj/systemtest/ajc181/ajc181.xml

index f8c8266497dba358ebfe2c36b689324e18b5a76d..02615a7711775b628ad89688394585f96339f734 100644 (file)
Binary files a/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip and b/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip differ
index afddbe647be2324415da52ce48c059fbcb4424bf..9eb94c5ef082ffd73cffd57e4ee581d7581c2a96 100644 (file)
Binary files a/org.eclipse.jdt.core/jdtcore-for-aspectj.jar and b/org.eclipse.jdt.core/jdtcore-for-aspectj.jar differ
diff --git a/tests/bugs181/377096/A.java b/tests/bugs181/377096/A.java
new file mode 100644 (file)
index 0000000..78d21d8
--- /dev/null
@@ -0,0 +1,7 @@
+@interface A {
+       int i(); 
+}
+class C {
+  @A(wibble={},i=42) 
+  public void xxx() {}
+}
\ No newline at end of file
index 453c057eb853071f190ae6ad01645881cbe41c48..81be509a7175ff762a6b275e934860edc1ced99f 100644 (file)
@@ -10,6 +10,8 @@
  *******************************************************************************/
 package org.aspectj.systemtest.ajc180;
 
+import org.aspectj.systemtest.ajc181.Ajc181Tests;
+
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
@@ -19,6 +21,7 @@ public class AllTestsAspectJ180 {
                TestSuite suite = new TestSuite("AspectJ 1.8.0 tests");
                // $JUnit-BEGIN$
                suite.addTest(Ajc180Tests.suite());
+               suite.addTest(Ajc181Tests.suite());
                // $JUnit-END$
                return suite;
        }
index c4737e945e3b5e63b68d3177fe2c63693df6ef5e..2bc5e0c0c1045b2ab1fb8a4eb17c8c75432a234b 100644 (file)
@@ -14,6 +14,7 @@ import java.io.File;
 
 import junit.framework.Test;
 
+import org.aspectj.apache.bcel.classfile.Method;
 import org.aspectj.testing.XMLBasedAjcTestCase;
 
 /**
@@ -21,6 +22,12 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
  */
 public class Ajc181Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
 
+       public void testBrokenAnnotations_377096() throws Exception {
+               runTest("broken annotations");
+               Method method = getMethodFromClass(getClassFrom(ajc.getSandboxDirectory(), "C"), "xxx");
+               method.getAnnotations();
+       }
+       
        public void testDefaultMethods_433744() {
                runTest("default methods");
        }
index 67646093b023db4da3560c4bb4210644c4f66559..cd2066506c8e3b338604233c36e9a8058454691b 100644 (file)
@@ -2,6 +2,12 @@
 
 <suite>
 
+       <ajc-test dir="bugs181/377096" title="broken annotations">
+               <compile options="-1.5 -proceedOnError" files="A.java">
+               <message kind="error" text="The attribute wibble is undefined for the annotation type A"/>
+               </compile>
+       </ajc-test>
+
        <ajc-test dir="bugs181/433744" title="default methods">
                <compile options="-1.8" files="AnIterator.java"/>
        </ajc-test>