Community
Participate
Working Groups
When multiple fields are declared in a single statement, annotations are only applied to the first of them. Compare the behavior of the following program when compiled with javac and with the JDT compiler. import java.lang.reflect.*; import java.lang.annotation.*; public class Foo { @Deprecated public static Object x, y, z; public static void main(String[] args) throws Throwable { Class c = Foo.class; for (Field f : c.getFields()) { System.out.println(f.getName()); for (Annotation a : f.getDeclaredAnnotations()) { System.out.println(" " + a); } } } }
Fixed and released in HEAD. Regression test in org.eclipse.jdt.core.tests.compiler.regression.AnnotationTest.test180
Verified for 3.2 M4 using build I20051212-0010