fixed PMD and some Checkstyle warnings

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@36168 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kutzi committed 2010-10-23 16:35:29 +00:00
1 parent b9b433b1f2
commit 41e511e187
2 files changed
+9 -9

No files matched your search

+7 -5
View File
@@ -691,26 +691,28 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
}
/**
* Returns the last 'numberOfBuilds' builds with a build result >= 'threshold'
* Returns the last 'numberOfBuilds' builds with a build result >= 'threshold'.
*
* @param numberOfBuilds the desired number of builds
* @param threshold the build result threshold
* @return a list with the builds (youngest build first).
* May be smaller than 'numberOfBuilds' or even empty
* if not enough builds satisfying the threshold have been found. Never null.
* @since 1.383
*/
public List<RunT> getPreviousBuildsOverThreshold(int numberOfBuilds, Result threshold) {
List<RunT> result = new ArrayList<RunT>(numberOfBuilds);
List<RunT> builds = new ArrayList<RunT>(numberOfBuilds);
RunT r = getPreviousBuild();
while (r != null && result.size() < numberOfBuilds) {
while (r != null && builds.size() < numberOfBuilds) {
if (!r.isBuilding() &&
(r.getResult() != null && r.getResult().isBetterOrEqualTo(threshold))) {
result.add(r);
builds.add(r);
}
r = r.getPreviousBuild();
}
return result;
return builds;
}
public RunT getNextBuild() {