Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 550618

Summary: [console] IOConsolePartitioner produces overlapping style ranges
Product: [Eclipse Project] Platform Reporter: Paul Pazderski <paul-eclipse>
Component: DebugAssignee: Paul Pazderski <paul-eclipse>
Status: VERIFIED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: sarika.sinha
Version: 4.11   
Target Milestone: 4.14 M1   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/148658
https://git.eclipse.org/c/platform/eclipse.platform.debug.git/commit/?id=f15d5f441d9ae8cc24de9ec34fd39b04520917b5
Whiteboard:
Bug Depends on:    
Bug Blocks: 552030    

Description Paul Pazderski CLA 2019-08-30 17:27:21 EDT
The IOConsolePartitioner.getStyleRanges method produce wrong results in some cases. This is not much of a problem atm but should be fixed anyway.

getStyleRanges strictly limits the result to the requested range (which is not required but not wrong either). If a partition starts before the requested offset the partitions offset gets adjusted but not the length which produces unwanted overlapping style ranges.
Comment 1 Eclipse Genie CLA 2019-08-30 17:30:27 EDT
New Gerrit change created: https://git.eclipse.org/r/148658
Comment 3 Sarika Sinha CLA 2019-10-09 05:21:21 EDT
@Paul,
How can we verify this?
Comment 4 Paul Pazderski CLA 2019-10-09 05:57:26 EDT
You can't really without debugging. It was more a theoretical problem in first place because it compute styles ordered by offset and in IOConsole there is no unpartitioned/unstyled content.
Only the first style could be wrong and to long (overlapping with the following styles) but StyledTextRenderer is very tolerant with overlapping or out-of-range styles and the later correct styles override the first wrong style resulting in correct rendering with and without fix atm.

To verify I printed "Two\nlines" to console and than typed a character in console. 
It will then call getStyleRanges (per line) with offset=4 and length=6 and the returned styles are before change:
 start=4, length=9, (end=13), color=black
 start=9, length=1, (end=10), color=green

After change it is:
 start=4, length=5, (end=9), color=black
 start=9, length=1, (end=10), color=green