Community
Participate
Working Groups
This problem still occurs in Eclipse 3.1 RC1. Create a 1.5 project and import the code, it should all compile. Open the AnnotationTest class, make a minor change like adding a space, and save it. You should get a compiler error for AnnotationTestClass (cannot be resolved to a type). If you clean the project and rebuilt it, the error should go away.
Created attachment 22803 [details] Annotation test suite which demonstrates a compiler problem in Eclipse
Created attachment 22805 [details] Picture showing the problem
reproduced.
Testcase can be reduced to changing the following source file (after a full build): package com.ibm.oti.annotation; public class AnnotationTest2 { private Class<?> testClass = AnnotationTestClass.class; }
We are getting a ClassFormatException trying to open AnnotationTestClass.class Any one of the 4 ValueAnnotations is causing the problem, here is the one for class: @ValueAnnotation (value="ValueAnnotation",booleanValue=true,charValue='m',byteValue=- 123,shortValue=-12345, intValue=-1234567890,floatValue=-12345.6789f,doubleValue=- 12345.6789,longValue=-1234567890123456789l, stringValue="valueString",enumValue=EnumClass.Value3,classValue=AnnotationTestC lass.class, annotationValue=@ClassAnnotation(value="ClassAnnotation"),booleanArrayValue= {false,true},charArrayValue={'m','q'}, byteArrayValue={-123,123},shortArrayValue={-12345,12345},intArrayValue={- 1234567890,1234567890}, floatArrayValue={-12345.6789f,12345.6789f},doubleArrayValue={- 12345.6789,12345.6789}, longArrayValue={-1234567890123456789l,1234567890123456789l},stringArrayValue= {"valueString", "stringValue"}, enumArrayValue={EnumClass.Value2,EnumClass.Value1},classArrayValue= {EnumClass.class, AnnotationTestClass.class}, annotationArrayValue={@ClassAnnotation(value="ClassAnnotation1"), @ClassAnnotation(value="ClassAnnotation2")})
I'll investigate it.
Created attachment 22840 [details] Apply on HEAD
Created attachment 22841 [details] Regression test Apply on HEAD of compiler tests.
+1 for RC3
Created attachment 22869 [details] New patch The code is clearer for the parameter annotation initialization.
Dani - pls cast a vote for this one. Another exception during compile.
+1 for 3.1 RC3.
Fixed and released in HEAD. Regression test added in org.eclipse.jdt.core.tests.compiler.regression.AnnotationTest.test166.
Verified using build N20050616-0010 + JDT Core HEAD.