Bug 94031 - Syntax parsing error with Enum
Summary: Syntax parsing error with Enum
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: All Windows XP
: P3 critical (vote)
Target Milestone: 3.1 M7   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-07 09:37 EDT by julien CLA
Modified: 2005-05-07 11:46 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description julien CLA 2005-05-07 09:37:10 EDT
An error is returned 
[Pb(204) Syntax error on token "enum", interface expected]

when ASTParser analyzes a simple enum definition
package test;

public enum Category
{
}

Here is the testcase:

ASTParser parser = ASTParser.newParser(AST.JLS3);
String source = "package test;\npublic enum Category{}";
parser.setSource(source .toCharArray());
ASTNode root = parser.createAST(null);
Comment 1 Philipe Mulet CLA 2005-05-07 11:46:59 EDT
You need to set source level to 1.5; using #setCompilerOptions(Map)