Merge branch 'develop' into Release_2_9_0b1_Branch
[jalview.git] / src / jalview / gui / Jalview2XML.java
index d920c7f..0319e60 100644 (file)
@@ -3250,8 +3250,8 @@ public class Jalview2XML
      * indicate that annotation colours are applied across all groups (pre
      * Jalview 2.8.1 behaviour)
      */
-    boolean doGroupAnnColour = isVersionStringLaterThan("2.8.1",
-            object.getVersion());
+    boolean doGroupAnnColour = Jalview2XML.isVersionStringLaterThan(
+            "2.8.1", object.getVersion());
 
     AlignmentPanel ap = null;
     boolean isnewview = true;
@@ -4037,7 +4037,7 @@ public class Jalview2XML
    * @return true if version is development/null or evaluates to the same or
    *         later X.Y.Z (where X,Y,Z are like [0-9]+b?[0-9]*)
    */
-  protected boolean isVersionStringLaterThan(String supported,
+  public static boolean isVersionStringLaterThan(String supported,
           String version)
   {
     if (version == null || version.equalsIgnoreCase("DEVELOPMENT BUILD")
@@ -4060,11 +4060,18 @@ public class Jalview2XML
         String fileT = fileV.nextToken().toLowerCase().replace('b', '.');
         try
         {
-          if (Float.valueOf(curT) > Float.valueOf(fileT))
+          float supportedVersionToken = Float.parseFloat(curT);
+          float myVersiontoken = Float.parseFloat(fileT);
+          if (supportedVersionToken > myVersiontoken)
           {
             // current version is newer than the version that wrote the file
             return false;
           }
+          if (supportedVersionToken < myVersiontoken)
+          {
+            // current version is older than the version that wrote the file
+            return true;
+          }
         } catch (NumberFormatException nfe)
         {
           System.err