no Vector(Vector) copy constructor in 1.2
authorjprocter <Jim Procter>
Mon, 9 Nov 2009 17:03:18 +0000 (17:03 +0000)
committerjprocter <Jim Procter>
Mon, 9 Nov 2009 17:03:18 +0000 (17:03 +0000)
src/jalview/datamodel/ColumnSelection.java

index afa2e07..5c1707f 100644 (file)
@@ -1086,6 +1086,7 @@ public class ColumnSelection
  */\r
   public void setElementsFrom(ColumnSelection colsel)\r
   {\r
+    selected = new Vector();\r
     if (colsel.selected != null && colsel.selected.size() > 0)\r
     {\r
       if (hiddenColumns!=null && hiddenColumns.size()>0)\r
@@ -1094,13 +1095,13 @@ public class ColumnSelection
         selected = new Vector();\r
         addElementsFrom(colsel);\r
       } else {\r
-        // be quick\r
-        selected = new Vector(colsel.selected);\r
+        // add everything regardless\r
+        Enumeration en = colsel.selected.elements();\r
+        while (en.hasMoreElements())\r
+        {\r
+          selected.addElement(en.nextElement());\r
+        }\r
       }\r
     }\r
-    else\r
-    {\r
-      selected = new Vector();\r
-    }\r
   }\r
 }\r