Bug 73762 - Line ends not reset when setting a different source
Summary: Line ends not reset when setting a different source
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M2   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-13 10:55 EDT by Jerome Lanneluc CLA
Modified: 2004-09-23 10:47 EDT (History)
0 users

See Also:


Attachments
Proposed patch (13.48 KB, patch)
2004-09-14 06:44 EDT, Jerome Lanneluc CLA
no flags Details | Diff
Regression test (1.41 KB, patch)
2004-09-14 07:00 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 Jerome Lanneluc CLA 2004-09-13 10:55:46 EDT
I20040907

Using IScanner#setSource(...), the line ends are not reset. Thus if a 
different source is passed in, IScanner#gerLineEnds() will not return the 
right line ends.
Comment 1 Olivier Thomann CLA 2004-09-13 11:37:16 EDT
This is trivial to fix.
For the internal scanner, the reset should also be done in the scanner and not
in the parser.
Comment 2 Jerome Lanneluc CLA 2004-09-14 06:44:49 EDT
Created attachment 14531 [details]
Proposed patch
Comment 3 Jerome Lanneluc CLA 2004-09-14 07:00:07 EDT
Created attachment 14532 [details]
Regression test
Comment 4 Jerome Lanneluc CLA 2004-09-15 09:35:33 EDT
- Changed setSource(char[]) to reset the lineEndPtr.
- Added helper method on Scanner (and PublicScanner): 
setSource(CompilationResult). 
- Changed all calls that used to set the source from a compilation result to 
use this helper.
- Added regression test InternalScannerTest#test002()
Comment 5 Frederic Fusier CLA 2004-09-23 10:47:09 EDT
Verified for 3.1 M2 with build I200409230010.