diff --git a/core/src/main/java/hudson/model/Queue.java b/core/src/main/java/hudson/model/Queue.java index c125c9983999b06cc562357e466cfbaa61b7a822..e6eafc3ee33a096700f5b8d676b9d75bc8d44754 100644 --- a/core/src/main/java/hudson/model/Queue.java +++ b/core/src/main/java/hudson/model/Queue.java @@ -1093,25 +1093,7 @@ public class Queue extends ResourceController implements Saveable { * Returns true if this queue contains the said project. */ public boolean contains(Task t) { - final Snapshot snapshot = this.snapshot; - for (Item item : snapshot.blockedProjects) { - if (item.task.equals(t)) - return true; - } - for (Item item : snapshot.buildables) { - if (item.task.equals(t)) - return true; - } - for (Item item : snapshot.pendings) { - if (item.task.equals(t)) - return true; - } - for (Item item : snapshot.waitingList) { - if (item.task.equals(t)) { - return true; - } - } - return false; + return getItem(t)!=null; } /**