JAL-2738 copy to spikes/mungo
[jalview.git] / src / jalview / util / ParseHtmlBodyAndLinks.java
index f1b83b8..6713bbc 100644 (file)
@@ -97,12 +97,12 @@ 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;
     }
+    StringBuilder sb = new StringBuilder(description.length());
     if (description.toUpperCase().indexOf("<HTML>") == -1)
     {
       htmlContent = false;
@@ -153,8 +153,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());
   }