--- /dev/null
+@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;
+}
--- /dev/null
+public @interface Demo {
+ Class[] myValues() default { };
+}
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");
}
<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"/>