From: jprocter Date: Thu, 14 Jun 2012 11:28:38 +0000 (+0100) Subject: JAL-1115 - synchronized access to group list X-Git-Tag: Jalview_2_9~465 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b78f02f944e0cf69ba6cfe14a165d6ad210e45dd;p=jalview.git JAL-1115 - synchronized access to group list --- diff --git a/src/jalview/ws/rest/params/SeqGroupIndexVector.java b/src/jalview/ws/rest/params/SeqGroupIndexVector.java index 1af0440..2c6d78a 100644 --- a/src/jalview/ws/rest/params/SeqGroupIndexVector.java +++ b/src/jalview/ws/rest/params/SeqGroupIndexVector.java @@ -92,7 +92,10 @@ public class SeqGroupIndexVector extends InputType implements // blocks ArrayList gl = new ArrayList(); int p = 0; - for (SequenceGroup sg : (Vector) al.getGroups()) + List sgs; + synchronized (sgs=al.getGroups()) + { + for (SequenceGroup sg : sgs) { if (sg.getSize() < minsize) { @@ -123,6 +126,7 @@ public class SeqGroupIndexVector extends InputType implements gl.add(se); } } + } // are there any more sequences ungrouped that should be added as a single // remaining group ? - these might be at the start or the end if (gl.size() > 0)