From: Jim Procter Date: Mon, 7 Oct 2019 07:56:36 +0000 (+0100) Subject: JAL-3070 use identity equivalence for workers rather than relying on equals not being... X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=493702970828df2d81b3e1fb6991835d4947d555;p=jalview.git JAL-3070 use identity equivalence for workers rather than relying on equals not being overridden to detect their presence. --- diff --git a/src/jalview/workers/AlignCalcManager.java b/src/jalview/workers/AlignCalcManager.java index 6f0deab..3a3dc44 100644 --- a/src/jalview/workers/AlignCalcManager.java +++ b/src/jalview/workers/AlignCalcManager.java @@ -22,6 +22,7 @@ package jalview.workers; import jalview.api.AlignCalcManagerI; import jalview.api.AlignCalcWorkerI; +import jalview.bin.Cache; import jalview.datamodel.AlignmentAnnotation; import java.util.ArrayList; @@ -90,7 +91,18 @@ public class AlignCalcManager implements AlignCalcManagerI } synchronized (upd) { - upd.add(worker); + // avoid use of 'Contains' in case + for (AlignCalcWorkerI _otherworker : upd) + { + if (_otherworker == upd) + { + Cache.log.debug( + "Ignoring second call to notifyStart for worker " + + worker); + return; + } + } + upd.add(worker); } } }