Summary: | DocLineComparator behaves ambiguous with empty file | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Krzysztof Pog這dzi雟ki <intuicje> | ||||||||||||
Component: | Compare | Assignee: | Platform-Compare-Inbox <platform-compare-inbox> | ||||||||||||
Status: | RESOLVED FIXED | QA Contact: | |||||||||||||
Severity: | minor | ||||||||||||||
Priority: | P3 | CC: | marcin.marczewski, Szymon.Brandys, tomasz.zarna | ||||||||||||
Version: | 3.5 | ||||||||||||||
Target Milestone: | 3.5 M5 | ||||||||||||||
Hardware: | PC | ||||||||||||||
OS: | Windows Vista | ||||||||||||||
Whiteboard: | |||||||||||||||
Attachments: |
|
Description
Krzysztof Pog這dzi雟ki
2008-12-19 18:13:08 EST
Created attachment 120985 [details]
Patch_v01
Simple patch solving this problem.
Created attachment 121206 [details]
Tests_v01
Krzysztof, are you talking about this kind of situation?
Created attachment 121207 [details]
mylyn/context/zip
Created attachment 121214 [details]
Tests_v02
No, rangesEqual(..) doesn't show the difference. But getRangeCount() does.
Both patches are in HEAD + some additional tests. Thanks for the fix Krzysztof! I've been investigating the fix since it caused a regression described in bug 262741. IMO this is not the right fix. DocLineComparator#getRangeCount should match with IDocument#getNumberOfLines and should return 1 for empty documents. The assumption is that there is always a line, even if a document is empty. Created attachment 130573 [details]
Szymon's proposal v01
|