Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-42584] Fix upstream job priority retrieval
- ClassCast fix
  • Loading branch information
Ronny Schuetz committed Mar 22, 2017
1 parent 685c572 commit dc12789
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -32,6 +32,7 @@
import com.google.common.cache.CacheBuilder;

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

/**
Expand Down Expand Up @@ -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();
}
}
Expand Down

0 comments on commit dc12789

Please sign in to comment.