Bug 232944

Summary: IMember#getJavadocRange() should end with "*/"
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, frederic_fusier, gunnar, Olivier_Thomann
Version: 3.4   
Target Milestone: 3.5 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed fix and regression test none

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