]> source.dussan.org Git - aspectj.git/commitdiff
296054: testcase: npe on model building for bad code
authoraclement <aclement>
Thu, 26 Nov 2009 23:32:49 +0000 (23:32 +0000)
committeraclement <aclement>
Thu, 26 Nov 2009 23:32:49 +0000 (23:32 +0000)
tests/bugs167/pr296054/AnnotAspect.aj [new file with mode: 0644]
tests/bugs167/pr296054/Demo.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc167/Ajc167Tests.java
tests/src/org/aspectj/systemtest/ajc167/ajc167.xml

diff --git a/tests/bugs167/pr296054/AnnotAspect.aj b/tests/bugs167/pr296054/AnnotAspect.aj
new file mode 100644 (file)
index 0000000..28541f2
--- /dev/null
@@ -0,0 +1,10 @@
+@SuppressWarnings("nls")
+public aspect AnnotAspect {
+    declare @field : * AnnotDemo.* : @Demo(myValues={"alfa", "beta", "gamma"});
+
+}
+class AnnotDemo {
+//  that works fine in the java class 
+//@Demo(myValues={"alfa", "beta", "gamma"})
+private int annotateMe;
+}  
diff --git a/tests/bugs167/pr296054/Demo.java b/tests/bugs167/pr296054/Demo.java
new file mode 100644 (file)
index 0000000..014c122
--- /dev/null
@@ -0,0 +1,3 @@
+public @interface Demo {
+    Class[] myValues() default { };
+}
index 1443624736cce1397b9d0ae4aef83c359559cbc2..98a7a6f5f25fd017328f075f6bc03f5892efb9e6 100644 (file)
@@ -18,6 +18,10 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
 
 public class Ajc167Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
 
+       public void testNpeOnBrokenCode_296054() {
+               runTest("npe on broken code");
+       }
+       
        public void testBrokenGeneratedCode_296040() {
                runTest("broken generated code");
        }
index d71b90dc9490852ce0ca152cecb67a0feac9d7e0..1ab32fc083bef4d12ed9bb5a4c5fbf96c7c3d4df 100644 (file)
@@ -2,6 +2,14 @@
 
 <suite>
 
+
+  <ajc-test dir="bugs167/pr296054" title="npe on broken code">
+     <compile files="Demo.java AnnotAspect.aj" options="-1.5 -emacssym">
+       <message kind="error" text="The value for"/>
+       <message kind="error" text="cannot convert"/>
+     </compile>
+  </ajc-test>
+  
   <ajc-test dir="bugs167/pr296040" title="broken generated code">
      <compile files="ErrorClass.java" options="-1.5" classpath="gc10rc4.jar"/>
      <run class="ErrorClass"/>