Bug 73762

Summary: Line ends not reset when setting a different source
Product: [Eclipse Project] JDT Reporter: Jerome Lanneluc <jerome_lanneluc>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.1 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed patch
none
Regression test none

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.