X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Futil%2FParseHtmlBodyAndLinks.java;h=0f2d01d0b7618405e1f51ad5da68d1f4a5993856;hb=8fce85002e6f6a5957dc95662c6a3d80fcce8e82;hp=870fe31fecb2e992f36626a1e9fa7ecb302ad08a;hpb=c19d2a91ca05e052e3408bf5852d88eb5d0608f1;p=jalview.git diff --git a/src/jalview/util/ParseHtmlBodyAndLinks.java b/src/jalview/util/ParseHtmlBodyAndLinks.java index 870fe31..0f2d01d 100644 --- a/src/jalview/util/ParseHtmlBodyAndLinks.java +++ b/src/jalview/util/ParseHtmlBodyAndLinks.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2) - * Copyright (C) 2015 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * @@ -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("") == -1) + StringBuilder sb = new StringBuilder(description.length()); + if (description.toUpperCase(Locale.ROOT).indexOf("") == -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("<")); + sb = new StringBuilder(LEFT_ANGLE_BRACKET_PATTERN.matcher(description) + .replaceAll("<")); } content = translateEntities(sb.toString()); }