for (BaseJob job : jobs)
{
JobStatus status = job.getStatus();
- int jobPrecedence = ArrayUtils.indexOf(statusPrecedence, status);
+ int jobPrecedence = ArrayUtils.indexOf(JobStatus.statusPrecedence, status);
if (precedence < jobPrecedence)
precedence = jobPrecedence;
}
if (precedence >= 0)
{
- setStatus(statusPrecedence[precedence]);
+ setStatus(JobStatus.statusPrecedence[precedence]);
}
}
- /**
- * A precedence order of job statuses used to compute the overall task status.
- */
- private static JobStatus[] statusPrecedence = {
- JobStatus.INVALID, // all must be invalid for task to be invalid
- JobStatus.COMPLETED, // all but invalid must be completed for task to be
- // completed
- JobStatus.UNKNOWN, // unknown prevents successful completion but not
- // running or failure
- JobStatus.READY,
- JobStatus.SUBMITTED,
- JobStatus.QUEUED,
- JobStatus.RUNNING,
- JobStatus.CANCELLED, // if any is terminated unsuccessfully, the task is
- // failed
- JobStatus.FAILED,
- JobStatus.SERVER_ERROR
- };
-
@Override
public void cancel()
{
throw new AssertionError("non-exhaustive switch statement");
}
}
+
+ /**
+ * A precedence order of job statuses used to compute the overall task status.
+ */
+ public static final JobStatus[] statusPrecedence = {
+ JobStatus.INVALID, // all must be invalid for task to be invalid
+ JobStatus.COMPLETED, // all but invalid must be completed for task to be
+ // completed
+ JobStatus.UNKNOWN, // unknown prevents successful completion but not
+ // running or failure
+ JobStatus.READY,
+ JobStatus.SUBMITTED,
+ JobStatus.QUEUED,
+ JobStatus.RUNNING,
+ JobStatus.CANCELLED, // if any is terminated unsuccessfully, the task is
+ // failed
+ JobStatus.FAILED,
+ JobStatus.SERVER_ERROR
+ };
}