jdk/src/share/classes/sun/management/Agent.java
changeset 12694 543c5e6c5ed0
parent 11991 800d0ff7b043
child 15531 071efc9f31ad
--- a/jdk/src/share/classes/sun/management/Agent.java	Mon May 14 07:26:53 2012 -0700
+++ b/jdk/src/share/classes/sun/management/Agent.java	Tue May 15 16:46:10 2012 +0400
@@ -168,7 +168,10 @@
 
         // management properties can be overridden by system properties
         // which take precedence
-        configProps.putAll(System.getProperties());
+        Properties sysProps = System.getProperties();
+        synchronized(sysProps){
+            configProps.putAll(sysProps);
+        }
 
         // if user specifies config file into command line for either
         // jcmd utilities or attach command it overrides properties set in
@@ -264,7 +267,10 @@
 
         // management properties can be overridden by system properties
         // which take precedence
-        props.putAll(System.getProperties());
+        Properties sysProps = System.getProperties();
+        synchronized(sysProps){
+            props.putAll(sysProps);
+        }
 
         return props;
    }