未验证 提交 9e8df8a9 编写于 作者: O Oleg Nenashev 提交者: GitHub

Merge pull request #4168 from Egor18/fixCounter

Fix counter which is not updated in the loop
...@@ -553,8 +553,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A ...@@ -553,8 +553,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
* @return null if no such build exists. * @return null if no such build exists.
*/ */
public final R getSomeBuildWithWorkspace() { public final R getSomeBuildWithWorkspace() {
int cnt=0; for (R b = getLastBuild(); b != null; b = b.getPreviousBuild()) {
for (R b = getLastBuild(); cnt<5 && b!=null; b=b.getPreviousBuild()) {
FilePath ws = b.getWorkspace(); FilePath ws = b.getWorkspace();
if (ws!=null) return b; if (ws!=null) return b;
} }
...@@ -562,8 +561,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A ...@@ -562,8 +561,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
} }
private R getSomeBuildWithExistingWorkspace() throws IOException, InterruptedException { private R getSomeBuildWithExistingWorkspace() throws IOException, InterruptedException {
int cnt=0; for (R b = getLastBuild(); b != null; b = b.getPreviousBuild()) {
for (R b = getLastBuild(); cnt<5 && b!=null; b=b.getPreviousBuild()) {
FilePath ws = b.getWorkspace(); FilePath ws = b.getWorkspace();
if (ws!=null && ws.exists()) return b; if (ws!=null && ws.exists()) return b;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册