int endLineBefore = Integer.parseInt(beforeMatcher.group(2));
int startLineAfter = Integer.parseInt(afterMatcher.group(1));
int endLineAfter = Integer.parseInt(afterMatcher.group(2));
PatchHunk hunk = new PatchHunk(startLineBefore, endLineBefore, startLineAfter, endLineAfter);
int beforeLineIndex = 0;
<BUG>int afterLineIndex = 0;
if (beforeLines.size() == 0) {</BUG>
for(String line: afterLines) {
hunk.addLine(parsePatchLine(line, 2));
}

int endLineBefore = Integer.parseInt(beforeMatcher.group(2));
int startLineAfter = Integer.parseInt(afterMatcher.group(1));
int endLineAfter = Integer.parseInt(afterMatcher.group(2));
PatchHunk hunk = new PatchHunk(startLineBefore, endLineBefore, startLineAfter, endLineAfter);
int beforeLineIndex = 0;
int afterLineIndex = 0;
PatchLine lastBeforePatchLine = null;
PatchLine lastAfterPatchLine = null;
if (beforeLines.size() == 0) {
for(String line: afterLines) {
hunk.addLine(parsePatchLine(line, 2));
