GitHub user aledsage opened a pull request:

    https://github.com/apache/brooklyn-server/pull/505

    BROOKLYN-404: fix ConcurrentModificationException in BrooklynProperties

    As discussed in https://issues.apache.org/jira/browse/BROOKLYN-404, the fix 
is to change `BrooklynProperties` so it no longer exposes the map interface. 
This means we can much more easily control its mutators and its accessors to 
avoid such `ConcurrentModificationException`s.
    
    This PR does *not* do anything about @neykov's additional suggestion in 
jira: "Taking a step back I think we should either let users update the 
properties in a non-hackish way (that is include the mutators in the interface 
which getConfig() returns) or introduce an alternative "scratch" space to serve 
the same purpose."
    
    Currently, if someone wants to modify the `BrooklynProperties`, it needs to 
be cast to `BrooklynProperties` (whereas `managementContext.getConfig()` 
returns `StringConfigMap`, which is a super-interface of `BrooklynProperties`).

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/aledsage/brooklyn-server BROOKLYN-404

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-server/pull/505.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #505
    
----
commit d8a2e24aa4782473265206b34e6a166593af68af
Author: Aled Sage <[email protected]>
Date:   2017-01-04T16:23:17Z

    BROOKLYN-404: improve BrooklynProperties concurrency
    
    BrooklynProperties no longer exposed as java.util.Map

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to