Sequence length maybe less than end
authoramwaterhouse <Andrew Waterhouse>
Thu, 26 Oct 2006 12:17:13 +0000 (12:17 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 26 Oct 2006 12:17:13 +0000 (12:17 +0000)
src/jalview/commands/ChangeCaseCommand.java

index ad5c937..49faa50 100644 (file)
@@ -69,14 +69,15 @@ public class ChangeCaseCommand implements CommandI
     for (int r = 0; r < regions.length; r++)\r
     {\r
       start = regions[r][0];\r
-      end = regions[r][1];\r
       for (int s = 0; s < seqs.length; s++)\r
       {\r
         sequence = seqs[s].getSequence();\r
         StringBuffer newSeq = new StringBuffer();\r
 \r
-        if (end > sequence.length())\r
+        if (regions[r][1] > sequence.length())\r
           end = sequence.length();\r
+        else\r
+          end = regions[r][1];\r
 \r
         if (start > 0)\r
         {\r