brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <>
Subject [GitHub] incubator-brooklyn pull request: make ConfigBag thread-safe
Date Sun, 12 Apr 2015 16:13:17 GMT
Github user aledsage commented on a diff in the pull request:
    --- Diff: core/src/main/java/brooklyn/util/config/ ---
    @@ -132,12 +166,12 @@ public String getDescription() {
         /** current values for all entries 
          * @return non-modifiable map of strings to object */
    -    public Map<String,Object> getAllConfig() {
    -        return Collections.unmodifiableMap(config);
    +    public synchronized Map<String,Object> getAllConfig() {
    --- End diff --
    Preference to not synchronize on `this` - if other code synchronizes on the object then
leads to a risk of deadlock. It leaks the implementation detail. Better to declare a `private
final` field, and synchronise on that.

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 or file a JIRA ticket
with INFRA.

View raw message