From e1e1e08937f1570548cbee18d6746ec43496664e Mon Sep 17 00:00:00 2001 From: Mateusz Warowny Date: Fri, 25 Mar 2022 18:35:04 +0100 Subject: [PATCH] JAL-3878 Fix task status precedence calculation Task status could only go up from the current status. --- src/jalview/ws2/actions/AbstractPollableTask.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/jalview/ws2/actions/AbstractPollableTask.java b/src/jalview/ws2/actions/AbstractPollableTask.java index 1e57556..999411f 100644 --- a/src/jalview/ws2/actions/AbstractPollableTask.java +++ b/src/jalview/ws2/actions/AbstractPollableTask.java @@ -207,19 +207,18 @@ public abstract class AbstractPollableTask implements Task */ private void updateGlobalStatus() { - JobStatus newStatus = taskStatus; - int currentPrecedence = ArrayUtils.indexOf(statusPrecedence, newStatus); + int precedence = -1; for (BaseJob job : jobs) { JobStatus status = job.getStatus(); int jobPrecedence = ArrayUtils.indexOf(statusPrecedence, status); - if (currentPrecedence < jobPrecedence) - { - currentPrecedence = jobPrecedence; - newStatus = status; - } + if (precedence < jobPrecedence) + precedence = jobPrecedence; + } + if (precedence >= 0) + { + setStatus(statusPrecedence[precedence]); } - setStatus(newStatus); } /** -- 1.7.10.2