JAL-3691 automatic insertion of Locale.ROOT to toUpperCase() and toLowerCase() and...
[jalview.git] / src / jalview / util / ParseHtmlBodyAndLinks.java
index f1b83b8..0f2d01d 100644 (file)
@@ -20,6 +20,8 @@
  */
 package jalview.util;
 
+import java.util.Locale;
+
 import java.util.ArrayList;
 import java.util.List;
 import java.util.StringTokenizer;
@@ -97,13 +99,13 @@ public class ParseHtmlBodyAndLinks
   public ParseHtmlBodyAndLinks(String description, boolean removeHTML,
           String newline)
   {
-    StringBuilder sb = new StringBuilder(description.length());
     if (description == null || description.length() == 0)
     {
       htmlContent = false;
       return;
     }
-    if (description.toUpperCase().indexOf("<HTML>") == -1)
+    StringBuilder sb = new StringBuilder(description.length());
+    if (description.toUpperCase(Locale.ROOT).indexOf("<HTML>") == -1)
     {
       htmlContent = false;
     }
@@ -129,7 +131,7 @@ public class ParseHtmlBodyAndLinks
         token = token.substring(0, startTag);
       }
 
-      if (tag != null && tag.toUpperCase().startsWith("A HREF="))
+      if (tag != null && tag.toUpperCase(Locale.ROOT).startsWith("A HREF="))
       {
         if (token.length() > 0)
         {
@@ -153,8 +155,8 @@ public class ParseHtmlBodyAndLinks
     {
       // instead of parsing the html into plaintext
       // clean the description ready for embedding in html
-      sb = new StringBuilder(LEFT_ANGLE_BRACKET_PATTERN
-              .matcher(description).replaceAll("&lt;"));
+      sb = new StringBuilder(LEFT_ANGLE_BRACKET_PATTERN.matcher(description)
+              .replaceAll("&lt;"));
     }
     content = translateEntities(sb.toString());
   }