From 493702970828df2d81b3e1fb6991835d4947d555 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 7 Oct 2019 08:56:36 +0100 Subject: [PATCH] JAL-3070 use identity equivalence for workers rather than relying on equals not being overridden to detect their presence. --- src/jalview/workers/AlignCalcManager.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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); } } } -- 1.7.10.2