Merge branch 'develop' into features/JAL-653_JAL-1766_htslib_refseqsupport
[jalview.git] / src / jalview / controller / AlignViewController.java
index e4f11e0..be84bbf 100644 (file)
@@ -83,8 +83,7 @@ public class AlignViewController implements AlignViewControllerI
     SequenceGroup sg = viewport.getSelectionGroup();
     ColumnSelection cs = viewport.getColumnSelection();
     SequenceGroup[] gps = null;
-    if (sg != null
-            && (cs == null || cs.getSelected() == null || cs.size() == 0))
+    if (sg != null && (cs == null || cs.isEmpty()))
     {
       gps = jalview.analysis.Grouping.makeGroupsFrom(viewport
               .getSequenceSelection(), viewport.getAlignmentView(true)
@@ -334,20 +333,20 @@ public class AlignViewController implements AlignViewControllerI
     gps = fr == null ? null : fr.getDisplayedFeatureGroups();
     if (typ != null)
     {
-      ArrayList types = new ArrayList();
-      for (int i = 0; i < typ.length; i++)
+      List<String> types = new ArrayList<String>();
+      for (String displayed : typ)
       {
-        if (typ[i] != null)
+        if (displayed != null)
         {
-          types.add(typ[i]);
+          types.add(displayed);
         }
-        typ = new String[types.size()];
-        types.toArray(typ);
       }
+      typ = new String[types.size()];
+      types.toArray(typ);
     }
     if (gps != null)
     {
-      ArrayList grps = new ArrayList();
+      List<String> grps = new ArrayList<String>();
 
       for (int i = 0; i < gps.length; i++)
       {