void (@Nullable SplitHunk hunk, @NotNull TextRange lineWithPartContextApplied, @NotNull IntPair contextRangeShift, AppliedTextPatch.HunkStatus hunkStatus) { if (hunk != null) { // +1 to the end because end range is always not included -> [i;j); except add modification; int newStart = lineWithPartContextApplied.getStartOffset() + contextRangeShift.first; int newEnd = hunk.isInsertion() && hunkStatus != AppliedTextPatch.HunkStatus.ALREADY_APPLIED ? newStart : lineWithPartContextApplied.getEndOffset() + 1 - contextRangeShift.second; myAppliedInfo.add(new AppliedTextPatch.AppliedSplitPatchHunk(hunk, newStart, newEnd, hunkStatus)); } }