Skip to content

Commit fdb1dc9

Browse files
authored
Removed dead code from Queue.ItemList (#10674)
1 parent 06600a1 commit fdb1dc9

1 file changed

Lines changed: 2 additions & 24 deletions

File tree

core/src/main/java/hudson/model/Queue.java

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
import java.util.GregorianCalendar;
9494
import java.util.HashMap;
9595
import java.util.HashSet;
96-
import java.util.Iterator;
9796
import java.util.LinkedHashSet;
9897
import java.util.List;
9998
import java.util.Map;
@@ -1541,7 +1540,7 @@ public void maintain() {
15411540

15421541
{ // blocked -> buildable
15431542
// copy as we'll mutate the list and we want to process in a potentially different order
1544-
List<BlockedItem> blockedItems = new ArrayList<>(blockedProjects.values());
1543+
List<BlockedItem> blockedItems = new ArrayList<>((blockedProjects));
15451544
// if facing a cycle of blocked tasks, ensure we process in the desired sort order
15461545
if (s != null) {
15471546
s.sortBlockedItems(blockedItems);
@@ -2954,29 +2953,8 @@ public boolean containsKey(Task task) {
29542953
return get(task) != null;
29552954
}
29562955

2957-
public T remove(Task task) {
2958-
Iterator<T> it = iterator();
2959-
while (it.hasNext()) {
2960-
T t = it.next();
2961-
if (t.task.equals(task)) {
2962-
it.remove();
2963-
return t;
2964-
}
2965-
}
2966-
return null;
2967-
}
2968-
2969-
public void put(Task task, T item) {
2970-
assert item.task.equals(task);
2971-
add(item);
2972-
}
2973-
2974-
public ItemList<T> values() {
2975-
return this;
2976-
}
2977-
29782956
/**
2979-
* Works like {@link #remove(Task)} but also marks the {@link Item} as cancelled.
2957+
* Removes a task and marks the {@link Item} as cancelled.
29802958
*/
29812959
public T cancel(Task p) {
29822960
T x = get(p);

0 commit comments

Comments
 (0)