Bug 130752 - [comments] first BlockComment parsed as LineComment
Summary: [comments] first BlockComment parsed as LineComment
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2.1   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 130761 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-03-07 11:44 EST by Markus Keller CLA
Modified: 2006-09-11 12:43 EDT (History)
1 user (show)

See Also:


Attachments
Proposed patch (4.57 KB, patch)
2006-04-27 09:50 EDT, Frederic Fusier 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 2006-03-07 11:44:29 EST
HEAD

/* Ceci n'est pas
 * une ligne. */
package xy;
public class Try { }

The first item of CompilationUnit#getCommentList() is a LineComment.
Expected: BlockComment.

Only seems to fail for the very first comment of a CU.
Comment 1 Frederic Fusier CLA 2006-03-07 13:09:29 EST
*** Bug 130761 has been marked as a duplicate of this bug. ***
Comment 2 Frederic Fusier CLA 2006-04-27 09:50:16 EDT
Created attachment 39661 [details]
Proposed patch

Comments kind are distinguished using comments starting and end position sign.
Javadoc comments have both positions positive, line comments have both positions negative and Block comments have positive starting position and negative end position.

So, when end position is negative, to know whether the comment is a line or a block, we look at starting position sign. Unfortunately, this does not work when starting position is zero!

In this case, we need to look at second char of comment to see if it's a '/' (line comment) or a '*' (block comment)...
Comment 3 Frederic Fusier CLA 2006-04-27 09:51:02 EDT
Not critical => I will release this patch after 3.2
Comment 4 Frederic Fusier CLA 2006-05-16 08:48:15 EDT
Candidate for 3.2.1
Comment 5 Frederic Fusier CLA 2006-05-16 09:06:30 EDT
Released in TARGET_321 stream.
Comment 6 Frederic Fusier CLA 2006-06-12 05:14:47 EDT
Released for 3.2.1
Released for 3.3 M1 while merging TARGET_321 in HEAD
Comment 7 Frederic Fusier CLA 2006-08-04 11:53:46 EDT
Verified for 3.3 M1 using build I20060804-0010.
Comment 8 Olivier Thomann CLA 2006-09-11 12:08:09 EDT
Verified for 3.2.1 using build M20060908-1655.