Skip to content
Permalink
Browse files
Fixed [#JENKINS-10563 resolution:1]
  • Loading branch information
fcamblor committed Aug 21, 2011
1 parent 9980026 commit 21e819a13649f51f36f787d9830f7fe95f7c886c
Showing with 9 additions and 5 deletions.
  1. +9 −5 src/main/java/hudson/plugins/global_build_stats/business/GlobalBuildStatsBusiness.java
@@ -143,7 +143,7 @@ public List<JobBuildSearchResult> searchBuilds(BuildHistorySearchCriteria search

// Sorting on job results dates
sortJobBuildResultsByBuildDate(filteredJobBuildResults);

return filteredJobBuildResults;
}

@@ -316,14 +316,18 @@ public List<AbstractBuildStatChartDimension> createDataSetBuilder(BuildStatConfi

List<JobBuildResult> sortedJobResults = new ArrayList<JobBuildResult>(this.plugin.getJobBuildResults());
sortJobBuildResultsByBuildDate(sortedJobResults);

Calendar d2 = new GregorianCalendar();
Calendar d1 = config.getHistoricScale().getPreviousStep(d2);

int tickCount = 0;
Iterator<JobBuildResult> buildsIter = sortedJobResults.iterator();
JobBuildResult currentBuild = buildsIter.next();
Calendar buildDate = currentBuild.getBuildDate();
JobBuildResult currentBuild = null;
Calendar buildDate = new GregorianCalendar(); buildDate.setTimeInMillis(1);
if(buildsIter.hasNext()){
currentBuild = buildsIter.next();
buildDate = currentBuild.getBuildDate();
}
while(tickCount != config.getHistoricLength()){
// Finding range where the build resides
while(tickCount < config.getHistoricLength() && d1.after(buildDate)){
@@ -365,7 +369,7 @@ public int compare(JobBuildResult o1, JobBuildResult o2) {
}
}));
}

private static void addBuild(List<JobBuildResult> jobBuildResultsRead, AbstractBuild build){
jobBuildResultsRead.add(JobBuildResultFactory.INSTANCE.createJobBuildResult(build));
}

0 comments on commit 21e819a

Please sign in to comment.