Bug 246682 - Inconsistent parser/scanner encoding for commentStart position
Summary: Inconsistent parser/scanner encoding for commentStart position
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 M2   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-09 04:21 EDT by Philipe Mulet CLA
Modified: 2008-09-15 09:47 EDT (History)
1 user (show)

See Also:


Attachments
Proposed patch (12.91 KB, patch)
2008-09-09 10:01 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 Philipe Mulet CLA 2008-09-09 04:21:25 EDT
Build 3.5M1

Though it does not cause some user code issues right now, the parser comment stack does not encode comment positions in same way across the parser hierarchy.
In particular, the commentStart position (stored in Scanner) is always positive when used from Parser, and can be negative for CommentRecorderParser. 

This can cause some problem when implementing algorithms which are to be inherited across the hierarchy.
Comment 1 Philipe Mulet CLA 2008-09-09 04:24:44 EDT
We need to use negative commentStart also in root Parser class, and check all algorithms to ensure they are expecting it.
Comment 2 Frederic Fusier CLA 2008-09-09 10:01:58 EDT
Created attachment 112079 [details]
Proposed patch
Comment 3 Frederic Fusier CLA 2008-09-09 10:02:22 EDT
Released for 3.5M2
Comment 4 David Audel CLA 2008-09-15 09:47:22 EDT
Verified for 3.5M2 using I20080914-2000