JAL-1759 reinstate changes from bdfde6ef989da0702cef90f03858f0f30e0bc83a
authorJim Procter <jprocter@issues.jalview.org>
Thu, 23 Jul 2015 17:52:26 +0000 (18:52 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Thu, 23 Jul 2015 17:52:26 +0000 (18:52 +0100)
 lost during merge.

src/jalview/gui/Jalview2XML.java

index 91d6aa8..5366820 100644 (file)
@@ -3801,16 +3801,23 @@ public class Jalview2XML
       newFileLoc.append(";");
     }
 
-    if (newFileLoc.length() > 0)
+    if (newFileLoc.length() == 0)
     {
-      int histbug = newFileLoc.indexOf("history = ");
+      return;
+    }
+    int histbug = newFileLoc.indexOf("history = ");
+    if (histbug > -1)
+    {
+      /*
+       * change "history = [true|false];" to "history = [1|0];"
+       */
       histbug += 10;
       int diff = histbug == -1 ? -1 : newFileLoc.indexOf(";", histbug);
       String val = (diff == -1) ? null : newFileLoc
               .substring(histbug, diff);
       if (val != null && val.length() >= 4)
       {
-        if (val.contains("e"))
+        if (val.contains("e")) // eh? what can it be?
         {
           if (val.trim().equals("true"))
           {
@@ -3823,6 +3830,7 @@ public class Jalview2XML
           newFileLoc.replace(histbug, diff, val);
         }
       }
+    }
 
       final String[] pdbf = pdbfilenames.toArray(new String[pdbfilenames
               .size()]);