Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,19 @@ public boolean rangesEqual(int thisIndex, IRangeComparator otherComparator, int
int olen= other.getTokenLength(otherIndex);
if (tlen == olen) {
String[] linesToCompare = extract(thisIndex, otherIndex, other, false);
return linesToCompare[0].equals(linesToCompare[1]);
String s1 = linesToCompare[0];
String s2 = linesToCompare[1];
if (s1.isEmpty() == s2.isEmpty()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So two non empty lines are equal?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How it comes? The first and the second check is just to avoid index out of bounds exceptions..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put a breakpoint in the return true new line and run DocLineComparatorTest

Copy link
Contributor Author

@mehmet-karaman mehmet-karaman Mar 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is supposed to work only on the positive case :) Going to check this.

return true;
}
if (s1.isEmpty() || s2.isEmpty()) {
return false;
}
if (s1.length() != s2.length() || s1.charAt(0) != s2.charAt(0)
|| s1.charAt(s1.length() - 1) != s2.charAt(s2.length() - 1)) {
return false;
}
return s1.equals(s2);
} else if (fCompareFilters != null && fCompareFilters.length > 0) {
String[] linesToCompare = extract(thisIndex, otherIndex, other, true);
return linesToCompare[0].equals(linesToCompare[1]);
Expand Down
Loading