diff --git a/core/src/main/java/hudson/model/AbstractProject.java b/core/src/main/java/hudson/model/AbstractProject.java index d9870c2134bbfc4e1f3758801258f5a723b0b888..22c90b01ca4da59ba2717db3ba289183bc61b127 100644 --- a/core/src/main/java/hudson/model/AbstractProject.java +++ b/core/src/main/java/hudson/model/AbstractProject.java @@ -553,8 +553,7 @@ public abstract class AbstractProject
,R extends A * @return null if no such build exists. */ public final R getSomeBuildWithWorkspace() { - int cnt=0; - for (R b = getLastBuild(); cnt<5 && b!=null; b=b.getPreviousBuild()) { + for (R b = getLastBuild(); b != null; b = b.getPreviousBuild()) { FilePath ws = b.getWorkspace(); if (ws!=null) return b; } @@ -562,8 +561,7 @@ public abstract class AbstractProject
,R extends A } private R getSomeBuildWithExistingWorkspace() throws IOException, InterruptedException { - int cnt=0; - for (R b = getLastBuild(); cnt<5 && b!=null; b=b.getPreviousBuild()) { + for (R b = getLastBuild(); b != null; b = b.getPreviousBuild()) { FilePath ws = b.getWorkspace(); if (ws!=null && ws.exists()) return b; }