Skip to content

Commit

Permalink
fixed job results loading issue
Browse files Browse the repository at this point in the history
  • Loading branch information
fcamblor committed Aug 21, 2011
1 parent 7fd2ff2 commit 9980026
Showing 1 changed file with 10 additions and 5 deletions.
Expand Up @@ -6,9 +6,7 @@
import hudson.plugins.global_build_stats.xstream.GlobalBuildStatsXStreamConverter;
import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.logging.Level;
Expand Down Expand Up @@ -138,8 +136,15 @@ public static List<JobBuildResult> load(){
File jobResultsRoot = getJobResultFolder();
if(jobResultsRoot.exists()){
for(File f: jobResultsRoot.listFiles()){
List<JobBuildResult> jobResultsInFile = (List<JobBuildResult>)Hudson.XSTREAM.fromXML(f.getAbsolutePath());
jobBuildResults.addAll(jobResultsInFile);
try {
FileReader fr = new FileReader(f);
List<JobBuildResult> jobResultsInFile = (List<JobBuildResult>)Hudson.XSTREAM.fromXML(fr);
jobBuildResults.addAll(jobResultsInFile);
fr.close();
} catch (IOException e) {
LOGGER.log(Level.SEVERE, "Unable to read job results in "+f.getAbsolutePath(), e);
throw new IllegalStateException("Unable to read job results in "+f.getAbsolutePath(), e);
}
}
}
Collections.sort(jobBuildResults, new JobBuildResult.TimedComparator());
Expand Down

0 comments on commit 9980026

Please sign in to comment.