Bug 209286

Summary: [compiler] Missing compile error for trailing comma in annotation
Product: [Eclipse Project] JDT Reporter: Hans Hofmann <hans.hofmann>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: hans.hofmann, Olivier_Thomann
Version: 3.3   
Target Milestone: 3.2 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Sources to reproduce the problem none

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 ***