File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
config/src/main/java/com/typesafe/config/impl Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1010import java .util .Iterator ;
1111import java .util .List ;
1212import java .util .Map ;
13+ import java .util .Properties ;
1314import java .util .concurrent .Callable ;
1415
1516import com .typesafe .config .Config ;
@@ -289,8 +290,18 @@ static ConfigIncluder defaultIncluder() {
289290 }
290291 }
291292
293+ private static Properties getSystemProperties () {
294+ // Avoid ConcurrentModificationException due to parallel setting of system properties by copying properties
295+ final Properties systemProperties = System .getProperties ();
296+ final Properties systemPropertiesCopy = new Properties ();
297+ synchronized (systemProperties ) {
298+ systemPropertiesCopy .putAll (systemProperties );
299+ }
300+ return systemPropertiesCopy ;
301+ }
302+
292303 private static AbstractConfigObject loadSystemProperties () {
293- return (AbstractConfigObject ) Parseable .newProperties (System . getProperties (),
304+ return (AbstractConfigObject ) Parseable .newProperties (getSystemProperties (),
294305 ConfigParseOptions .defaults ().setOriginDescription ("system properties" )).parse ();
295306 }
296307
You can’t perform that action at this time.
0 commit comments