Bug 315491 - @SuiteClasses annotation parser accepts final comma but should not
Summary: @SuiteClasses annotation parser accepts final comma but should not
Status: CLOSED DUPLICATE of bug 112433
Alias: None
Product: JDT
Classification: Eclipse Project
Component: APT (show other bugs)
Version: 3.6   Edit
Hardware: Macintosh Mac OS X
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Generic inbox for the JDT-APT component CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-02 16:29 EDT by Missing name CLA
Modified: 2010-06-02 16:48 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Missing name CLA 2010-06-02 16:29:28 EDT
The parsing of @SuiteClasses does not behave properly when the last entry ends with a comma:

@SuiteClasses({
    foo.class,
    bar.class,
    bazz.class,
})

The Eclipse compiler does not flag an error here, but should.  Unlike array initializers, the final comma is not legal in this context, or at least is not considered legal by the Sun and Apple compilers.


-- Configuration Details --
Product: Eclipse 1.3.0.20100526-1935 (org.eclipse.epp.package.java.product)
Installed Features:
 org.eclipse.jdt 3.6.0.v20100520-0800-7z8XFUJFMTfCW8oRvdJkums9H155
Comment 1 Walter Harley CLA 2010-06-02 16:48:28 EDT
The error is in the Sun compiler, not Eclipse, and there is an existing bug in Sun's bug database for this (http://bugs.sun.com/view_bug.do?bug_id=6337964) which looks like it may recently have been fixed.  The Java Language Spec (section 9.7) clearly accepts a final comma.

*** This bug has been marked as a duplicate of bug 112433 ***