Source:
<code>public String getInlineComments(int lines) { StringBuilder cmts = new StringBuilder(); final Repository repo = getRepository(); try { final PatchList patchList = repo != null ? getPatchList() : null; Patch.Key currentFileKey = null; PatchFile currentFileData = null; for (final PatchLineComment c : inlineComments) { final Patch.Key pk = c.getKey().getParentKey(); final int lineNbr = c.getLine(); final short side = c.getSide(); if (!pk.equals(currentFileKey)) { cmts.append("....................................................\n"); if (Patch.COMMIT_MSG.equals(pk.get())) { cmts.append("Commit Message\n"); } else { cmts.append("File "); cmts.append(pk.get()); cmts.append("\n"); } currentFileKey = pk; if (patchList != null) { try { currentFileData = new PatchFile(repo, patchList, pk.getFileName()); } catch (IOException e) { } } else { currentFileData = null; } } if (currentFileData != null) { int maxLines; try { maxLines = currentFileData.getLineCount(side); } catch (Throwable e) { <START> maxLines = Integer.MAX_VALUE; <END> } final int startLine = Math.max(1, lineNbr - lines + 1); final int stopLine = Math.min(maxLines, lineNbr + lines); for (int line = startLine; line <= lineNbr; ++line) { appendFileLine(cmts, currentFileData, side, line); } cmts.append(c.getMessage().trim()); cmts.append("\n"); for (int line = lineNbr + 1; line < stopLine; ++line) { appendFileLine(cmts, currentFileData, side, line); } } cmts.append("\n\n"); } } finally { if (repo != null) { repo.close(); } } return cmts.toString(); }</code><technical_language>more sense maxLines = 0 get line count. file appears empty if load content, nicely ranges collapse in subsequent logic</technical_language>

Target:
public String getInlineComments(int lines) { StringBuilder cmts = new StringBuilder(); final Repository repo = getRepository(); try { final PatchList patchList = repo != null ? getPatchList() : null; Patch.Key currentFileKey = null; PatchFile currentFileData = null; for (final PatchLineComment c : inlineComments) { final Patch.Key pk = c.getKey().getParentKey(); final int lineNbr = c.getLine(); final short side = c.getSide(); if (!pk.equals(currentFileKey)) { cmts.append("....................................................\n"); if (Patch.COMMIT_MSG.equals(pk.get())) { cmts.append("Commit Message\n"); } else { cmts.append("File "); cmts.append(pk.get()); cmts.append("\n"); } currentFileKey = pk; if (patchList != null) { try { currentFileData = new PatchFile(repo, patchList, pk.getFileName()); } catch (IOException e) { } } else { currentFileData = null; } } if (currentFileData != null) { int maxLines; try { maxLines = currentFileData.getLineCount(side); } catch (Throwable e) { maxLines = lineNbr; } final int startLine = Math.max(1, lineNbr - lines + 1); final int stopLine = Math.min(maxLines, lineNbr + lines); for (int line = startLine; line <= lineNbr; ++line) { appendFileLine(cmts, currentFileData, side, line); } cmts.append(c.getMessage().trim()); cmts.append("\n"); for (int line = lineNbr + 1; line < stopLine; ++line) { appendFileLine(cmts, currentFileData, side, line); } } cmts.append("\n\n"); } } finally { if (repo != null) { repo.close(); } } return cmts.toString(); }