提交 25514b70 编写于 作者: K kohsuke

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
上级 4a0d9d90
...@@ -672,12 +672,6 @@ public class Queue extends ResourceController { ...@@ -672,12 +672,6 @@ public class Queue extends ResourceController {
*/ */
public final Task task; 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, * Build is blocked because another build is in progress,
* required {@link Resource}s are not available, or otherwise blocked * required {@link Resource}s are not available, or otherwise blocked
...@@ -696,9 +690,6 @@ public class Queue extends ResourceController { ...@@ -696,9 +690,6 @@ public class Queue extends ResourceController {
protected Item(Task project) { protected Item(Task project) {
this.task = project; this.task = project;
synchronized (Queue.this) {
this.id = iota++;
}
} }
/** /**
...@@ -722,9 +713,18 @@ public class Queue extends ResourceController { ...@@ -722,9 +713,18 @@ public class Queue extends ResourceController {
@Exported @Exported
public Calendar timestamp; 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) { WaitingItem(Calendar timestamp, Task project) {
super(project); super(project);
this.timestamp = timestamp; this.timestamp = timestamp;
synchronized (Queue.this) {
this.id = iota++;
}
} }
public int compareTo(WaitingItem that) { public int compareTo(WaitingItem that) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册