openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgras...@apache.org
Subject svn commit: r1764159 - /openjpa/branches/2.2.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java
Date Mon, 10 Oct 2016 18:04:55 GMT
Author: jgrassel
Date: Mon Oct 10 18:04:55 2016
New Revision: 1764159

URL: http://svn.apache.org/viewvc?rev=1764159&view=rev
Log:
OPENJPA-2672: ConfigurationImpl.loadGlobals() has java.util.ConcurrentModificationException
vulnerability

Modified:
    openjpa/branches/2.2.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java

Modified: openjpa/branches/2.2.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.2.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java?rev=1764159&r1=1764158&r2=1764159&view=diff
==============================================================================
--- openjpa/branches/2.2.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java
(original)
+++ openjpa/branches/2.2.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java
Mon Oct 10 18:04:55 2016
@@ -186,9 +186,12 @@ public class ConfigurationImpl
 
         // let system properties override other globals
         try {
-            fromProperties(new HashMap(
-                AccessController.doPrivileged(
-                    J2DoPrivHelper.getPropertiesAction())));
+        	Properties systemProperties = AccessController.doPrivileged(
+                    J2DoPrivHelper.getPropertiesAction());
+        	synchronized(systemProperties) {
+        		// Prevent concurrent modification of systemProperties until HashMap ctor is completed.
+        		fromProperties(new HashMap(systemProperties));
+        	}
         } catch (SecurityException se) {
             // security manager might disallow
         }



Mime
View raw message