Use font.getName, not font.getFontName
[jalview.git] / src / jalview / bin / Cache.java
index d4c7e5d..e2477d9 100755 (executable)
@@ -52,7 +52,6 @@ public class Cache
     public static void loadProperties(String propsFile)\r
     {\r
         applicationProperties = new Properties();\r
-\r
         propertiesFile = propsFile;\r
         if (propsFile == null)\r
         {\r
@@ -63,6 +62,8 @@ public class Cache
         {\r
             FileInputStream fis = new FileInputStream(propertiesFile);\r
             applicationProperties.load(fis);\r
+            applicationProperties.remove("LATEST_VERSION");\r
+            applicationProperties.remove("VERSION");\r
             fis.close();\r
         }\r
         catch (Exception ex)\r
@@ -90,11 +91,20 @@ public class Cache
          catch (Exception ex)\r
          {\r
            System.out.println("Error reading build details: "+ex);\r
+           applicationProperties.remove("VERSION");\r
         }\r
 \r
         String jnlpVersion = System.getProperty("jalview.version");\r
         String codeVersion = getProperty("VERSION");\r
 \r
+\r
+        if(codeVersion==null)\r
+        {\r
+          // THIS SHOULD ONLY BE THE CASE WHEN TESTING!!\r
+          codeVersion = "Test";\r
+          jnlpVersion = "Test";\r
+        }\r
+\r
         // jnlpVersion will be null if we're using InstallAnywhere\r
         if(jnlpVersion==null)\r
         {\r
@@ -109,11 +119,18 @@ public class Cache
 \r
               line = line.substring(line.indexOf("value=")+7);\r
               line = line.substring(0, line.lastIndexOf("\""));\r
-              setProperty("jalview.version", line);\r
+              jnlpVersion = line;\r
+              break;\r
             }\r
           }catch(Exception ex)\r
-          {setProperty("jalview.version", codeVersion);}\r
+          {  jnlpVersion =  codeVersion; }\r
         }\r
+\r
+        System.out.println("Version: "+codeVersion);\r
+        System.out.println("Latest : "+jnlpVersion);\r
+\r
+        setProperty("LATEST_VERSION", jnlpVersion);\r
+        setProperty("VERSION", codeVersion);\r
     }\r
 \r
     /**\r