From b78f02f944e0cf69ba6cfe14a165d6ad210e45dd Mon Sep 17 00:00:00 2001 From: jprocter Date: Thu, 14 Jun 2012 12:28:38 +0100 Subject: [PATCH] JAL-1115 - synchronized access to group list --- src/jalview/ws/rest/params/SeqGroupIndexVector.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) -- 1.7.10.2