JAL-3788 synchronize concurrent findColour() and alignmentChanged() bug/JAL-3788_autoOverviewClustal
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 29 Dec 2020 16:38:35 +0000 (16:38 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 29 Dec 2020 16:38:35 +0000 (16:38 +0000)
src/jalview/schemes/ClustalxColourScheme.java

index 19723ca..5a2d5dc 100755 (executable)
  */
 package jalview.schemes;
 
+import java.awt.Color;
+import java.util.List;
+import java.util.Map;
+
 import jalview.api.AlignViewportI;
 import jalview.datamodel.AnnotatedCollectionI;
 import jalview.datamodel.SequenceCollectionI;
 import jalview.datamodel.SequenceI;
 import jalview.util.Comparison;
 
-import java.awt.Color;
-import java.util.List;
-import java.util.Map;
-
 public class ClustalxColourScheme extends ResidueColourScheme
 {
   private static final int EIGHTY_FIVE = 85;
@@ -95,7 +95,7 @@ public class ClustalxColourScheme extends ResidueColourScheme
   }
 
   @Override
-  public void alignmentChanged(AnnotatedCollectionI alignment,
+  public synchronized void alignmentChanged(AnnotatedCollectionI alignment,
           Map<SequenceI, SequenceCollectionI> hiddenReps)
   {
     int maxWidth = alignment.getWidth();
@@ -278,7 +278,7 @@ public class ClustalxColourScheme extends ResidueColourScheme
   }
 
   @Override
-  protected Color findColour(char c, int j, SequenceI seq)
+  protected synchronized Color findColour(char c, int j, SequenceI seq)
   {
     // TODO why the test for includeGaps here?
     if (cons2.length <= j || Comparison.isGap(c)