File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
drjava/src/edu/rice/cs/drjava Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -144,14 +144,20 @@ public class DrJava {
144144 /** Properties file used by the configuration object. Defaults to DEFAULT_PROPERTIES_FILE. */
145145 private static volatile File _propertiesFile = DEFAULT_PROPERTIES_FILE ;
146146
147- /** Configuration object with all customized and default values. Initialized from _propertiesFile. */
147+ /** Configuration object with all customized and default values.
148+ * Lazily initialized from _propertiesFile in getConfig() or handleCommandLineArgs(). */
148149 private static volatile FileConfiguration _config ;
149150
150151 /** Returns the properties file used by the configuration object. */
151152 public static File getPropertiesFile () { return _propertiesFile ; }
152153
153154 /** Returns the configuration object with all customized and default values. */
154- public static FileConfiguration getConfig () { return _config ; }
155+ public static synchronized FileConfiguration getConfig () {
156+ if (_config ==null ) {
157+ _config = _initConfig (); // read specified .djrava file into _config
158+ }
159+ return _config ;
160+ }
155161
156162 /** @return an array of the files that were passed on the command line. */
157163 public static synchronized String [] getFilesToOpen () { return _filesToOpen .toArray (new String [0 ]); }
@@ -437,7 +443,9 @@ else if (arg.equals("-help") || arg.equals("-?")) {
437443 }
438444 }
439445
440- _config = _initConfig (); // read specified .djrava file into _config
446+ synchronized (DrJava .class ) {
447+ _config = _initConfig (); // read specified .djrava file into _config
448+ }
441449
442450 if ((!("" .equals (getConfig ().getSetting (MASTER_JVM_XMX )))) &&
443451 (!(edu .rice .cs .drjava .config .OptionConstants .heapSizeChoices .get (0 ).equals (getConfig ().getSetting (MASTER_JVM_XMX ))))) {
You can’t perform that action at this time.
0 commit comments