From 25514b706be3641dcbfb286edf88d1d7e9bfe1ca Mon Sep 17 00:00:00 2001 From: kohsuke Date: Tue, 20 May 2008 00:06:01 +0000 Subject: [PATCH] id is only used for sorting git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@9463 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/model/Queue.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/hudson/model/Queue.java b/core/src/main/java/hudson/model/Queue.java index d70a4410b7..6dcb8284f8 100644 --- a/core/src/main/java/hudson/model/Queue.java +++ b/core/src/main/java/hudson/model/Queue.java @@ -672,12 +672,6 @@ public class Queue extends ResourceController { */ public final Task task; - /** - * Unique number of this {@link Item}. - * Used to differentiate {@link Item}s with the same due date. - */ - public final int id; - /** * Build is blocked because another build is in progress, * required {@link Resource}s are not available, or otherwise blocked @@ -696,9 +690,6 @@ public class Queue extends ResourceController { protected Item(Task project) { this.task = project; - synchronized (Queue.this) { - this.id = iota++; - } } /** @@ -722,9 +713,18 @@ public class Queue extends ResourceController { @Exported public Calendar timestamp; + /** + * Unique number of this {@link WaitingItem}. + * Used to differentiate {@link WaitingItem}s with the same due date, to make it sortable. + */ + public final int id; + WaitingItem(Calendar timestamp, Task project) { super(project); this.timestamp = timestamp; + synchronized (Queue.this) { + this.id = iota++; + } } public int compareTo(WaitingItem that) { -- GitLab