X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Frest%2Fparams%2FSeqGroupIndexVector.java;fp=src%2Fjalview%2Fws%2Frest%2Fparams%2FSeqGroupIndexVector.java;h=9210414bc55099d40b668cc465347f748dc2b13c;hb=4f30214e8098748469c6a4269ac2ed6c5750e4b0;hp=dcb7fab8876a2fb694eaa703d10358a04241c22f;hpb=9dabc02511e3a334a5749a504f57f69d6c9017bd;p=jalview.git diff --git a/src/jalview/ws/rest/params/SeqGroupIndexVector.java b/src/jalview/ws/rest/params/SeqGroupIndexVector.java index dcb7fab..9210414 100644 --- a/src/jalview/ws/rest/params/SeqGroupIndexVector.java +++ b/src/jalview/ws/rest/params/SeqGroupIndexVector.java @@ -75,6 +75,7 @@ public class SeqGroupIndexVector extends InputType * - alignment to be processed * @return al or a new alignment with appropriate attributes/order for input */ + @Override public AlignmentI prepareAlignment(AlignmentI al) { jalview.analysis.AlignmentSorter.sortByGroup(al); @@ -90,10 +91,10 @@ public class SeqGroupIndexVector extends InputType AlignmentI al = rj.getAlignmentForInput(token, type); // assume that alignment is properly ordered so groups form consecutive // blocks - ArrayList gl = new ArrayList(); + ArrayList gl = new ArrayList<>(); int p = 0, lowest = al.getHeight(), highest = 0; - List sgs; - synchronized (sgs = al.getGroups()) + List sgs = al.getGroups(); + synchronized (sgs) { for (SequenceGroup sg : sgs) { @@ -125,9 +126,13 @@ public class SeqGroupIndexVector extends InputType else { if (p < se[0]) + { se[0] = p; + } if (p > se[1]) + { se[1] = p; + } } } if (se != null) @@ -168,7 +173,9 @@ public class SeqGroupIndexVector extends InputType int[][] vals = gl.toArray(new int[gl.size()][]); int[] srt = new int[gl.size()]; for (int i = 0; i < vals.length; i++) + { srt[i] = vals[i][0]; + } jalview.util.QuickSort.sort(srt, vals); list = false; int last = vals[0][0] - 1; @@ -210,7 +217,7 @@ public class SeqGroupIndexVector extends InputType @Override public List getURLEncodedParameter() { - ArrayList prms = new ArrayList(); + ArrayList prms = new ArrayList<>(); super.addBaseParams(prms); prms.add("minsize='" + minsize + "'"); prms.add("sep='" + sep + "'"); @@ -243,7 +250,9 @@ public class SeqGroupIndexVector extends InputType { minsize = Integer.valueOf(val); if (minsize >= 0) + { return true; + } } catch (Exception x) {