mirror of https://github.com/apache/openjpa.git
OPENJPA-2672: ConfigurationImpl.loadGlobals() has java.util.ConcurrentModificationException vulnerability
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1764316 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a99daf8f47
commit
be71987b9c
|
@ -187,9 +187,14 @@ public class ConfigurationImpl
|
||||||
|
|
||||||
// let system properties override other globals
|
// let system properties override other globals
|
||||||
try {
|
try {
|
||||||
fromProperties(new HashMap(
|
Properties systemProperties = AccessController.doPrivileged(
|
||||||
AccessController.doPrivileged(
|
J2DoPrivHelper.getPropertiesAction());
|
||||||
J2DoPrivHelper.getPropertiesAction())));
|
HashMap sysPropHM = null;
|
||||||
|
synchronized(systemProperties) {
|
||||||
|
// Prevent concurrent modification of systemProperties until HashMap ctor is completed.
|
||||||
|
sysPropHM = new HashMap(systemProperties);
|
||||||
|
}
|
||||||
|
fromProperties(sysPropHM);
|
||||||
} catch (SecurityException se) {
|
} catch (SecurityException se) {
|
||||||
// security manager might disallow
|
// security manager might disallow
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue