package net.morimekta.providence.tools.common;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * General utility methods.
 */
public class Utils {
    public static String getVersionString() throws IOException {
        Properties properties = new Properties();
        try (InputStream in = Utils.class.getResourceAsStream("/version.properties")) {
            properties.load(in);
        }
        return "v" + properties.getProperty("build.version");
    }
}

@@ -97,16 +97,53 @@
 Stream;%0A
+import java.io.UncheckedIOException;%0A
 import j
@@ -230,68 +230,180 @@
    p
-ublic static String getVersionString() throws IOException %7B%0A
+rivate transient volatile static String versionString = null;%0A%0A    public static String getVersionString() %7B%0A        if (versionString == null) %7B%0A            try %7B%0A        
     
@@ -448,16 +448,24 @@
 ties();%0A
+        
         
@@ -556,16 +556,24 @@
         
+    
+    
 properti
@@ -593,16 +593,24 @@
         
+       
+ 
 %7D%0A      
@@ -615,14 +615,31 @@
     
-return
+        versionString =
  %22v%22
@@ -682,16 +682,175 @@
 sion%22);%0A
+            %7D catch (IOException e) %7B%0A                throw new UncheckedIOException(e.getMessage(), e);%0A            %7D%0A        %7D%0A        return versionString;%0A
     %7D%0A%7D%0A

Read version string only once.