Instance.init()
authorNiki Roo <niki@nikiroo.be>
Tue, 14 May 2019 15:47:04 +0000 (17:47 +0200)
committerNiki Roo <niki@nikiroo.be>
Tue, 14 May 2019 15:47:04 +0000 (17:47 +0200)
src/be/nikiroo/fanfix/Instance.java
src/be/nikiroo/fanfix/Main.java

index ef7799fbc497d246e7d64ddaf80f8d0cde59546f..84a583e6635d8ec966c7fb8cf1ef334ecaa0bb9a 100644 (file)
@@ -42,7 +42,21 @@ public class Instance {
        private static TraceHandler tracer;
        private static TempFiles tempFiles;
 
-       static {
+       private static boolean init;
+
+       /**
+        * Initialise the instance -- if already initialised, nothing will happen.
+        * <p>
+        * Before calling this method, you may call {@link Bundles#getDirectory()}
+        * if wanted.
+        */
+       static public void init() {
+               if (init) {
+                       return;
+               }
+
+               init = true;
+
                // Before we can configure it:
                Boolean debug = checkEnv("DEBUG");
                boolean trace = debug != null && debug;
index c2f5891c96826f3b28b4d7894cbfa738380bdc7e..b3633612713996f8651bffda5f480fc2607b54be 100644 (file)
@@ -87,6 +87,9 @@ public class Main {
         *            see method description
         */
        public static void main(String[] args) {
+               // Only one line, but very important:
+               Instance.init();
+
                String urlString = null;
                String luid = null;
                String sourceString = null;