Merge branch 'develop' into releases/Release_2_11_2_Branch
[jalview.git] / src / jalview / util / matcher / Matcher.java
index 51e1828..cbd5458 100644 (file)
@@ -20,6 +20,8 @@
  */
 package jalview.util.matcher;
 
+import java.util.Locale;
+
 import java.util.Objects;
 
 /**
@@ -102,7 +104,8 @@ public class Matcher implements MatcherI
       patternType = PatternType.String;
     }
 
-    uppercasePattern = pattern == null ? null : pattern.toUpperCase();
+    uppercasePattern = pattern == null ? null
+            : pattern.toUpperCase(Locale.ROOT);
 
     // if we add regex conditions (e.g. matchesPattern), then
     // pattern should hold the raw regex, and
@@ -172,8 +175,9 @@ public class Matcher implements MatcherI
   boolean matchesString(String compareTo)
   {
     boolean matched = false;
-    String upper = compareTo.toUpperCase().trim();
-    switch(condition) {
+    String upper = compareTo.toUpperCase(Locale.ROOT).trim();
+    switch (condition)
+    {
     case Matches:
       matched = upper.equals(uppercasePattern);
       break;
@@ -218,9 +222,10 @@ public class Matcher implements MatcherI
     {
       return false;
     }
-    
+
     boolean matched = false;
-    switch (condition) {
+    switch (condition)
+    {
     case LT:
       matched = f < compareTo;
       break;
@@ -335,9 +340,10 @@ public class Matcher implements MatcherI
        */
       return matchesFloat(compareTo, longValue);
     }
-    
+
     boolean matched = false;
-    switch (condition) {
+    switch (condition)
+    {
     case LT:
       matched = val < longValue;
       break;
@@ -359,7 +365,7 @@ public class Matcher implements MatcherI
     default:
       break;
     }
-  
+
     return matched;
   }