Github user neykov commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/333#discussion_r20403381
  
    --- Diff: 
core/src/main/java/brooklyn/entity/rebind/dto/BasicEntityMemento.java ---
    @@ -198,11 +214,19 @@ protected BasicEntityMemento(Builder builder) {
         }
     
         protected AttributeSensor<?> getAttributeKey(String key) {
    +        AttributeSensor<?> result=null;
             if (attributeKeys!=null) {
    -            AttributeSensor<?> ak = attributeKeys.get(key);
    -            if (ak!=null) return ak;
    +            result = attributeKeys.get(key);
    +            if (result!=null && 
!LEGACY_KEY_DESCRIPTION.equals(result.getDescription()))
    +                return result;
             }
    -        return (AttributeSensor<?>) getStaticSensorKeys().get(key);
    +        AttributeSensor<?> resultStatic = (AttributeSensor<?>) 
getStaticSensorKeys().get(key);
    +        if (resultStatic!=null) return resultStatic;
    +        // if it was a legacy key, if it is added back, drop the legacy 
reference
    +        if (result!=null) return result;
    +        // can happen on rebind if a key has gone away; it will not be 
declared in the file or in the 
    --- End diff --
    
    Same as getConfigKey


---
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