Bug 79974 - [1.5] Wrong javadoc for TypeDeclarationStatement
Summary: [1.5] Wrong javadoc for TypeDeclarationStatement
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.1 M4   Edit
Assignee: Jim des Rivieres CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-02 05:05 EST by Tobias Widmer CLA
Modified: 2004-12-14 23:16 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Widmer CLA 2004-12-02 05:05:20 EST
200411300800: The documentation states that a TypeDeclarationStatement in JLS3 
wraps the following nodes:
- TypeDeclaration
- EnumDeclaration
- AnnotationTypeDeclaration

The final draft of the language specification obtained at jcp.org however 
states the following rule:

BlockStatement:=LocalVariableDeclarationStatement|ClassDeclaration|Statement

Enums and Annotations are not allowed as local types.
Comment 1 Olivier Thomann CLA 2004-12-02 15:08:44 EST
Jim, can you handle this?
We might consider this a syntactically possible. so we need to find out if we
can allow this.
Comment 2 Jim des Rivieres CLA 2004-12-02 16:19:32 EST
ClassDeclaration includes EnumDeclaration, according to JLS3 8.1. So the only 
ones that are not legal are interface and @interface. Syntactically, we should 
probably try to parse these but mark as malformed.

I'll update the spec.
Comment 3 Jim des Rivieres CLA 2004-12-02 16:42:41 EST
Changed comment to read:

 * For JLS3, the kinds of type declarations grew to include enum declarations:
 * <pre>
 * TypeDeclarationStatement:
 *    TypeDeclaration
 *    EnumDeclaration
 * </pre>
 * Although allowed at the AST, not all arrangements of AST nodes are 
meaningful;
 * in particular, only class and enum declarations are meaningful in the 
context of 
 * a block.
Comment 4 Olivier Thomann CLA 2004-12-14 23:16:54 EST
Verified in 200412140800