TimedVcsCommit (@NotNull String line) { int firstSeparatorIndex = CommitParser.nextSeparatorIndex(line, 0); long timestamp; try { String timestampStr = line.substring(0, firstSeparatorIndex); if (timestampStr.isEmpty()) { timestamp = 0; } else { timestamp = Long.parseLong(timestampStr); } } catch (NumberFormatException e) { throw new IllegalArgumentException("bad timestamp in line: " + line); } GraphCommit<Integer> commit = CommitParser.parseCommitParentsAsInteger(line.substring(firstSeparatorIndex + 2)); List<Hash> parents = new ArrayList<>(); for (int p : commit.getParents()) { parents.add(intToHash(p)); } return new TimedVcsCommitImpl(intToHash(commit.getId()), parents, timestamp); }