Skip to content
Permalink
Browse files

[FIXED JENKINS-21310] CCE when a Queue.Task was not a Job.

  • Loading branch information...
jglick committed Jan 9, 2014
1 parent 1e1336a commit 5fbd7d9c3b6785b8e0cc78cb72bcca42a68e5bb4
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/main/java/jenkins/advancedqueue/PriorityConfiguration.java
@@ -204,7 +204,7 @@ public PriorityConfigurationCallback getPriority(Queue.Item item, PriorityConfig

private PriorityConfigurationCallback getPriorityInternal(Queue.Item item,
PriorityConfigurationCallback priorityCallback) {
Job<?, ?> job = (Job<?, ?>) item.task;
Queue.Task job = item.task;

// [JENKINS-8597]
// For MatrixConfiguration use the latest assigned Priority from the MatrixProject
@@ -225,8 +225,8 @@ private PriorityConfigurationCallback getPriorityInternal(Queue.Item item,
.getDefaultPriority());
}

if (PrioritySorterConfiguration.get().getAllowPriorityOnJobs()) {
AdvancedQueueSorterJobProperty priorityProperty = job.getProperty(AdvancedQueueSorterJobProperty.class);
if (job instanceof Job && PrioritySorterConfiguration.get().getAllowPriorityOnJobs()) {
AdvancedQueueSorterJobProperty priorityProperty = ((Job<?,?>) job).getProperty(AdvancedQueueSorterJobProperty.class);
if (priorityProperty != null && priorityProperty.getUseJobPriority()) {
int priority = priorityProperty.priority;
if (priority == PriorityCalculationsUtil.getUseDefaultPriorityPriority()) {
@@ -247,6 +247,7 @@ private PriorityConfigurationCallback getPriorityInternal(Queue.Item item,
.getDefaultPriority());
}

// TODO a simple jobName will not work for jobs in folders, and would be meaningless for non-Job Queue.Task’s
public JobGroup getJobGroup(PriorityConfigurationCallback priorityCallback, String jobName) {
for (JobGroup jobGroup : jobGroups) {
priorityCallback.addDecisionLog(0, "Evaluating JobGroup [" + jobGroup.getId() + "] ...");

0 comments on commit 5fbd7d9

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