Bug 209286 - [compiler] Missing compile error for trailing comma in annotation
Summary: [compiler] Missing compile error for trailing comma in annotation
Status: RESOLVED DUPLICATE of bug 112433
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M3   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-08 19:54 EST by Hans Hofmann CLA
Modified: 2007-11-08 20:36 EST (History)
2 users (show)

See Also:


Attachments
Sources to reproduce the problem (1.66 KB, application/x-zip-compressed)
2007-11-08 19:54 EST, Hans Hofmann CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hans Hofmann CLA 2007-11-08 19:54:54 EST
Created attachment 82506 [details]
Sources to reproduce the problem

Build ID: M20070921-1145

Steps To Reproduce:
1. Create a new Java project

2. Create a JUnit4 Testcase skeleton,e.g.
package com.foo;

public class FooTestCase {
}


3. Create a JUnit4 TestSuite aggregating the TestCase and use a trailing comma in the after the last element in the annotation, e.g.

package com.foo;

import org.junit.runner.RunWith;
import org.junit.runners.Suite;

@RunWith(Suite.class)
@Suite.SuiteClasses( { FooTestCase.class, })
public class FooTestSuite {

}

4. Add JUnit4 to compilation classpath

5. Project does compile without errors

Problem: compiling the sources with standard javac (1.5.0_13-b05) results in an error 

com/foo/FooTestSuite.java:7: illegal start of expression
@Suite.SuiteClasses( { FooTestCase.class, })
                                          ^
1 error

More information:
Comment 1 Olivier Thomann CLA 2007-11-08 20:36:31 EST
This is perfectly legitimate.
Closing as a dup of bug 112433.

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