JAL-3691 automatic insertion of Locale.ROOT to toUpperCase() and toLowerCase() and...
[jalview.git] / src / jalview / commands / EditCommand.java
index d0790c8..30595bc 100644 (file)
@@ -20,6 +20,8 @@
  */
 package jalview.commands;
 
+import java.util.Locale;
+
 import jalview.analysis.AlignSeq;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
@@ -789,7 +791,7 @@ public class EditCommand implements CommandI
       String nogapold = AlignSeq.extractGaps(Comparison.GapChars,
               new String(command.string[i]));
 
-      if (!nogaprep.toLowerCase().equals(nogapold.toLowerCase()))
+      if (!nogaprep.toLowerCase(Locale.ROOT).equals(nogapold.toLowerCase(Locale.ROOT)))
       {
         // we may already have dataset and limits stashed...
         if (newDSWasNeeded || newStartEndWasNeeded)
@@ -838,7 +840,7 @@ public class EditCommand implements CommandI
             // old ds and edited ds are different, so
             // create the new dataset sequence
             SequenceI newds = new Sequence(oldds);
-            newds.setSequence(fullseq.toUpperCase());
+            newds.setSequence(fullseq.toUpperCase(Locale.ROOT));
 
             if (command.oldds == null)
             {
@@ -891,7 +893,7 @@ public class EditCommand implements CommandI
               // new
               // start/end
               String nogapalseq = AlignSeq.extractGaps(Comparison.GapChars,
-                      command.seqs[i].getSequenceAsString().toUpperCase());
+                      command.seqs[i].getSequenceAsString().toUpperCase(Locale.ROOT));
               int newStart = command.seqs[i].getDatasetSequence()
                       .getSequenceAsString().indexOf(nogapalseq);
               if (newStart == -1)