mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-14 04:22:16 +00:00
[FIXED JENKINS-25314]
The original fix was made in 0c3d67097a.
In this fix, I'm also moving the code that creates LeftItem.
It makes no sense that there's Item.cancel(Queue) and Queue.cancel(Item)
and they do different things!
This commit is contained in:
1 parent
b4a9671c27
commit
9b36e2ae8d
2 files changed
+12
-7
No files matched your search
@@ -658,12 +658,7 @@ public class Queue extends ResourceController implements Saveable {
|
||||
|
||||
public synchronized boolean cancel(Item item) {
|
||||
LOGGER.log(Level.FINE, "Cancelling {0} item#{1}", new Object[] {item.task, item.id});
|
||||
boolean r = item.cancel(this);
|
||||
|
||||
LeftItem li = new LeftItem(item);
|
||||
li.enter(this);
|
||||
|
||||
return r;
|
||||
return item.cancel(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1588,10 +1583,17 @@ public class Queue extends ResourceController implements Saveable {
|
||||
/**
|
||||
* Cancels this item, which updates {@link #future} to notify the listener, and
|
||||
* also leaves the queue.
|
||||
*
|
||||
* @return true
|
||||
* if the item was successfully cancelled.
|
||||
*/
|
||||
/*package*/ boolean cancel(Queue q) {
|
||||
boolean r = leave(q);
|
||||
if (r) future.setAsCancelled();
|
||||
if (r) {
|
||||
future.setAsCancelled();
|
||||
LeftItem li = new LeftItem(this);
|
||||
li.enter(q);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user