You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
UnifiedDiffUtils.getRowMap parses the revised range from the original range #247
While testing UnifiedDiffUtils.getRowMap, I noticed that the revised range in a unified diff hunk header seems to be parsed from the original range instead of the revised one.
In the following code, revSp is initialized using org, which contains the - side of the hunk header:
String[] revSp = org.split(",");
It looks like this should be using sp[2], which contains the + side:
String[] revSp = sp[2].split(",");
For example, with this hunk header:
@@ -10,3 +12,5 @@
I currently get:
revRow = 10
revAdd = 3
But I would expect:
revRow = 12
revAdd = 5
This seems to cause the revised row mapping to be incorrect whenever the original and revised ranges differ.
changed the title [-]## `UnifiedDiffUtils.getRowMap` parses the revised range from the original range[/-][+]UnifiedDiffUtils.getRowMap` parses the revised range from the original range[/+]on Dec 2, 2026
changed the title [-]UnifiedDiffUtils.getRowMap` parses the revised range from the original range[/-][+]UnifiedDiffUtils.getRowMap parses the revised range from the original range[/+]on Dec 2, 2026
Activity
[-]## `UnifiedDiffUtils.getRowMap` parses the revised range from the original range[/-][+]UnifiedDiffUtils.getRowMap` parses the revised range from the original range[/+][-]UnifiedDiffUtils.getRowMap` parses the revised range from the original range[/-][+]UnifiedDiffUtils.getRowMap parses the revised range from the original range[/+]wumpz commentedon Dec 3, 2026
PRs are welcome
wumpz commentedon Dec 3, 2026
I changed already the line. However, could you provide a proper test.