private Collection<VcsCommitInfo> getCommitsForProject(String projectId, Date from, Date to) { Collection<VcsCommitInfo> commits = myVcsProvider.getHistoryChunk(projectId, from, to); myHistoryCache.put(projectId, commits); long vcsRootId = commits.iterator().next().getVcsRootId(); myCommitIndex = processIndices(commits); return commits; }
private List<Double> getBugFixTimes(String projectId, Date from, Date to) { List<Double> result = new ArrayList<>(); Collection<VcsCommitInfo> commits = myVcsProvider.getHistoryChunk(projectId, from, to); Date start = commits.iterator().next().getDate(); for (VcsCommitInfo commitInfo : commits) { if (VcsCommitInfoUtils.isRelatedToBugIssue(commitInfo)) { result.add(1.0 * (commitInfo.getDate().getTime() - start.getTime()) / (86400 * 1000)); } } return result; }