Bug 232944 - IMember#getJavadocRange() should end with "*/"
Summary: IMember#getJavadocRange() should end with "*/"
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M1   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-20 08:24 EDT by Markus Keller CLA
Modified: 2008-09-30 05:22 EDT (History)
4 users (show)

See Also:


Attachments
Proposed fix and regression test (2.84 KB, patch)
2008-05-20 11:05 EDT, Jerome Lanneluc CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2008-05-20 08:24:04 EDT
I20080516-1333

IMember#getJavadocRange() should end with "*/", not partial line delimiter.

Paste this to a workspace with Windows line delimiters:

package p;
class A{
    /**
     * swsw
     */
    void m(){
    }
}

=> IMember#getJavadocRange() on "m()" returns offset=26, length=26.
This is "/** {@inheritDoc}*/\r" (the Javadoc and '\r' at the end).
Comment 1 Markus Keller CLA 2008-05-20 08:29:57 EDT
It's even worse: The range always includes 1 character too much, e.g here...

/** X */class A {}

... the Javadoc range is "/** X */c".
Comment 2 Jerome Lanneluc CLA 2008-05-20 10:48:53 EDT
Just verified that the problem existed in 3.3.2.
Comment 3 Olivier Thomann CLA 2008-05-20 10:54:54 EDT
I am surprised that this has not been found earlier as I imagine some weird bugs when using ast rewrite.
Comment 4 Jerome Lanneluc CLA 2008-05-20 11:05:20 EDT
Created attachment 101061 [details]
Proposed fix and regression test
Comment 5 Jerome Lanneluc CLA 2008-06-23 11:30:02 EDT
Fix and test released for 3.5M1
Comment 6 Olivier Thomann CLA 2008-08-06 13:58:13 EDT
Verified for 3.5M1 using I20080805-1307
Comment 7 Gunnar Wagenknecht CLA 2008-09-30 05:22:10 EDT
(In reply to comment #3)
> I am surprised that this has not been found earlier as I imagine some weird
> bugs when using ast rewrite.

Don't know why I didn't reported this earlier. Maybe I didn't recognize because of the line ending. Thus, I thought it's normal. But I paid my penalty today because my code got broken by this fix. ;)

http://code.google.com/p/gwt-tooling/source/detail?r=62