1.1 compat
authorjprocter <Jim Procter>
Fri, 17 Dec 2010 14:24:26 +0000 (14:24 +0000)
committerjprocter <Jim Procter>
Fri, 17 Dec 2010 14:24:26 +0000 (14:24 +0000)
src/jalview/datamodel/ColumnSelection.java

index 589c19b..3b46c47 100644 (file)
@@ -1227,9 +1227,16 @@ public class ColumnSelection
         int diff = origseq.getLength() - sq.length();\r
         while (diff > 0)\r
         {\r
-          sq = sq\r
-                  + ((diff >= sb.length()) ? sb.toString() : sb\r
-                          .substring(0, diff));\r
+          //sq = sq\r
+          //        + ((diff >= sb.length()) ? sb.toString() : sb\r
+          //                .substring(0, diff));\r
+          if (diff>=sb.length()) {\r
+            sq+=sb.toString();\r
+          } else {\r
+            char[] buf = new char[diff];\r
+            sb.getChars(0, diff, buf, 0);\r
+            sq+=buf.toString();\r
+          }\r
           diff = origseq.getLength() - sq.length();\r
         }\r
       }\r