Bug 99423 - [1.5] [javadoc] inconsistent getStartPosition()
Summary: [1.5] [javadoc] inconsistent getStartPosition()
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M1   Edit
Assignee: Jim des Rivieres CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-10 13:54 EDT by Kelvin CLA
Modified: 2005-08-09 10:32 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 Kelvin CLA 2005-06-10 13:54:16 EDT
in BodyDeclaration node, getStartPosition() will include the Javadoc position,
if there has one. However, in PackageDeclaration, getStartPosition() didn't
include Javadoc position.
Comment 1 Olivier Thomann CLA 2005-06-10 17:02:46 EDT
Could you please specify the build ID?
Comment 2 Olivier Thomann CLA 2005-06-10 17:08:09 EDT
Changing this would be an API breakage.

 * All types of body declarations carry modifiers (and annotations), although
they differ in
 * which modifiers are allowed. Most types of body declarations can carry a
 * doc comment; Initializer is the only ones that does not. The source range
 * for body declarations always includes the doc comment if present.

Jim, any comment?
Comment 3 Frederic Fusier CLA 2005-06-13 04:20:53 EDT
It does include javadoc position only for package-info.java compilation unit.
Package declaration javadoc comment is ignored for all other units.

So, I would say this bug is INVALID
Comment 4 Jim des Rivieres CLA 2005-07-23 20:56:03 EDT
Added the following clarification to the class comment for PackageDeclaration:

 * Note that the standard AST parser only recognizes a Javadoc comment
 * immediately preceding the package declaration when it occurs in the
 * special <code>package-info.java</code> compilation unit (JLS3 7.4.1.1).
 * The Javadoc comment in that file contains the package description.

Fixed in 3.2 builds > N20050723. Updated build notes.
Comment 5 Olivier Thomann CLA 2005-08-09 10:32:02 EDT
Verified in 3.2M1 (I20050808-2000)