Bug 295866 - FormalParameter in JDT DOM/AST documentation
Summary: FormalParameter in JDT DOM/AST documentation
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 trivial (vote)
Target Milestone: 3.6 M6   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-23 08:58 EST by Jean-Claude Royer CLA
Modified: 2010-03-09 04:42 EST (History)
4 users (show)

See Also:


Attachments
Proposed fix (3.95 KB, patch)
2010-03-05 10:08 EST, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Claude Royer CLA 2009-11-23 08:58:57 EST
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; fr; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5
Build Identifier: M20080911-1700

Hi all

In org.eclipse.jdt.core.dom, I found a mistake in the API documentation
CatchClause, MethodDeclaration and EnhancedForStatement doc headings are refeering in their headings to FormalParameter ASTNode which did not exist.
In place the accessors say that it is SingleVariableDeclaration

Another detail is that: the doc heading of  TypeDeclaration refers to Classdeclaration and InterfaceDeclaration which contains some *BodyDeclarations.
But there is nothing to get/set the Interface/Class BodyDeclaration, the getters are getFields/getMethods.

Hoping it helps, regards

Reproducible: Always
Comment 1 Markus Keller CLA 2009-11-23 09:30:22 EST
> In org.eclipse.jdt.core.dom, I found a mistake in the API documentation
> CatchClause, MethodDeclaration and EnhancedForStatement doc headings are
> refeering in their headings to FormalParameter ASTNode which did not exist.
> In place the accessors say that it is SingleVariableDeclaration

These sections of AST node Javadocs refer to the grammar in the Java Language Specification (JLS2 and JLS3). Some node classes have been named after the nonterminals in the grammar, but there's no 1:1 mapping between the grammar and the AST node types.

> Another detail is that: the doc heading of  TypeDeclaration refers to
> Classdeclaration and InterfaceDeclaration which contains some
> *BodyDeclarations.
> But there is nothing to get/set the Interface/Class BodyDeclaration, the
> getters are getFields/getMethods.

See AbstractTypeDeclaration#bodyDeclarations() in the super class.
Comment 2 Olivier Thomann CLA 2009-11-23 11:40:00 EST
(In reply to comment #1)
> These sections of AST node Javadocs refer to the grammar in the Java Language
> Specification (JLS2 and JLS3). Some node classes have been named after the
> nonterminals in the grammar, but there's no 1:1 mapping between the grammar and
> the AST node types.
In this we should refrain from referencing directly grammar rules, but rather reference the correspoding ASTNode. At least it should be clear when the reference concerns a node class name or a grammar rule name.
Comment 3 Olivier Thomann CLA 2010-03-05 10:08:24 EST
Created attachment 161128 [details]
Proposed fix
Comment 4 Olivier Thomann CLA 2010-03-05 10:08:46 EST
Released for 3.6M6.
Comment 5 Jay Arthanareeswaran CLA 2010-03-09 04:42:36 EST
Verified for 3.6M6 by code inspection (Javadoc)