Community
Participate
Working Groups
Steps To Reproduce: 1. Envoke "DocLineComparator(doc, null, false)" 2. Envoke "DocLineComparator(doc, new Region(0, doc.getLength()), false)" (doc has to be an empty document) Result is different, but basing on Java-doc it should be the same: "region: if non-null only lines within this range are taken" Bug has influence on solution of bug 71374
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