You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2017/01/18 15:23:17 UTC

[1/2] activemq-artemis git commit: ARTEMIS-962 Fix CME when parsing system properties

Repository: activemq-artemis
Updated Branches:
  refs/heads/master 43aaf52d4 -> 21cc67262


ARTEMIS-962 Fix CME when parsing system properties

Add synchronized block against the properties before iterating on them.

JIRA: https://issues.apache.org/jira/browse/ARTEMIS-926


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/5ae47e8c
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/5ae47e8c
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/5ae47e8c

Branch: refs/heads/master
Commit: 5ae47e8c3c4cd17ca6abc75e72be0338b0ceaf96
Parents: 43aaf52
Author: Jeff Mesnil <jm...@gmail.com>
Authored: Wed Jan 18 15:56:35 2017 +0100
Committer: Jeff Mesnil <jm...@gmail.com>
Committed: Wed Jan 18 15:56:35 2017 +0100

----------------------------------------------------------------------
 .../core/config/impl/ConfigurationImpl.java     | 25 ++++++++++----------
 1 file changed, 13 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/5ae47e8c/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java
index 2d4be39..bfa6c40 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java
@@ -308,22 +308,23 @@ public class ConfigurationImpl implements Configuration, Serializable {
 
    @Override
    public Configuration parseSystemProperties(Properties properties) throws Exception {
+      synchronized (properties) {
+         Map<String, Object> beanProperties = new HashMap<>();
+
+         for (Map.Entry<Object, Object> entry : properties.entrySet()) {
+            if (entry.getKey().toString().startsWith(systemPropertyPrefix)) {
+               String key = entry.getKey().toString().substring(systemPropertyPrefix.length());
+               logger.debug("Setting up config, " + key + "=" + entry.getValue());
+               beanProperties.put(key, entry.getValue());
+            }
+         }
 
-      Map<String, Object> beanProperties = new HashMap<>();
-
-      for (Map.Entry<Object, Object> entry : properties.entrySet()) {
-         if (entry.getKey().toString().startsWith(systemPropertyPrefix)) {
-            String key = entry.getKey().toString().substring(systemPropertyPrefix.length());
-            logger.debug("Setting up config, " + key + "=" + entry.getValue());
-            beanProperties.put(key, entry.getValue());
+         if (!beanProperties.isEmpty()) {
+            BeanSupport.setData(this, beanProperties);
          }
-      }
 
-      if (!beanProperties.isEmpty()) {
-         BeanSupport.setData(this, beanProperties);
+         return this;
       }
-
-      return this;
    }
 
    @Override


[2/2] activemq-artemis git commit: This closes #968

Posted by cl...@apache.org.
This closes #968


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/21cc6726
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/21cc6726
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/21cc6726

Branch: refs/heads/master
Commit: 21cc6726230404f7b7283668fe6274b82db5a562
Parents: 43aaf52 5ae47e8
Author: Clebert Suconic <cl...@apache.org>
Authored: Wed Jan 18 10:21:37 2017 -0500
Committer: Clebert Suconic <cl...@apache.org>
Committed: Wed Jan 18 10:21:37 2017 -0500

----------------------------------------------------------------------
 .../core/config/impl/ConfigurationImpl.java     | 25 ++++++++++----------
 1 file changed, 13 insertions(+), 12 deletions(-)
----------------------------------------------------------------------