Skip to content
Permalink
Browse files

[JENKINS-42584] Fix upstream job priority retrieval

- ClassCast fix
  • Loading branch information
Ronny Schuetz
Ronny Schuetz committed Mar 22, 2017
1 parent 685c572 commit dc1278989d1a513255b821dbc9dbeb0d8024aa26
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/main/java/jenkins/advancedqueue/sorter/StartedJobItemCache.java
@@ -32,6 +32,7 @@
import com.google.common.cache.CacheBuilder;

import hudson.model.Run;
import hudson.model.Queue.Executable;
import hudson.model.queue.WorkUnit;

/**
@@ -126,10 +127,10 @@ private void maintainCache() {

for (final Iterator<PendingItem> it = pendingItems.iterator(); it.hasNext();) {
final PendingItem pi = it.next();
final Run<?, ?> run = (Run<?, ?>) pi.workUnit.getExecutable();
final Executable e = pi.workUnit.getExecutable();

if (run != null) {
startedItems.put(new StartedItem(pi.itemInfo.getJobName(), run.getNumber()), pi.itemInfo);
if (e instanceof Run) {
startedItems.put(new StartedItem(pi.itemInfo.getJobName(), ((Run<?, ?>) e).getNumber()), pi.itemInfo);
it.remove();
}
}

0 comments on commit dc12789

Please sign in to comment.
You can’t perform that action at this time.