brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neykov <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request #440: BROOKLYN-345: persist brooklyn.parameters...
Date Tue, 29 Nov 2016 13:43:11 GMT
Github user neykov commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/440#discussion_r89965074
  
    --- Diff: core/src/main/java/org/apache/brooklyn/core/config/internal/AbstractConfigMapImpl.java
---
    @@ -163,13 +163,18 @@ public ConfigBag getLocalConfigBag() {
             return putAllOwnConfigIntoSafely(ConfigBag.newInstance()).seal();
         }
     
    -    public Object setConfig(ConfigKey<?> key, Object v) {
    -        Object val = coerceConfigVal(key, v);
    +    public Object setConfig(final ConfigKey<?> key, Object v) {
    +        // Use our own key for writing, (e.g. in-case it should (or should not) be a
structured key like MapConfigKey).
    +        // This is same logic as for getConfig, except we only have to look at our own
container.
    +        ConfigKey<?> ownKey = getKeyAtContainer(getContainer(), key);
    +        if (ownKey==null) ownKey = key;
    +
    +        Object val = coerceConfigVal(ownKey, v);
    --- End diff --
    
    I think we should keep the "config coerces on get, sensors on put" rule. So remove this
coerce.


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

Mime
View raw message