Community
Participate
Working Groups
@Embedded @AttributeOverrides({ @AttributeOverride( name="city", column=@Column( name="DIAB99C_TXCTY" )), @AttributeOverride( name="state", column=@Column( name="DIAB99C_TXSTAT" )), @AttributeOverride( name="zipCode", column=@Column( name="DIAB99C_TXZIP" )), }) compiles fine with eclipse 3.2RC1a jdt compiler. But when using the sun jdk compiler you get [javac] C:\..Something.java:73: illegal start of expression [javac] }) [javac] ^ [javac] 2 errors It would seem the JDT compiler is incorrect. And the last element in the @AttributeOverride array should not be followed by a comma
I'll investigate.
This looks like a bug with javac. From http://java.sun.com/docs/books/jls/third_edition/html/interfaces.html#9.7, the rule from the grammar is: ElementValueArrayInitializer: { ElementValuesopt ,opt } This means that: { ,} { c , } { c } { } are all valid ElementValueArrayInitializer elements. They had the same bug for array initializers. see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4396418. You should report the bug against Sun compiler. Closing as INVALID. Added regression test org.eclipse.jdt.core.tests.compiler.regression.AnnotationTest.test199
*** Bug 153213 has been marked as a duplicate of this bug. ***
*** Bug 169963 has been marked as a duplicate of this bug. ***
*** Bug 195551 has been marked as a duplicate of this bug. ***
Closing as dup. *** This bug has been marked as a duplicate of bug 112433 ***