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

    https://github.com/apache/brooklyn-server/pull/340#discussion_r79992176
  
    --- Diff: 
core/src/main/java/org/apache/brooklyn/core/config/internal/AbstractConfigMapImpl.java
 ---
    @@ -20,65 +20,212 @@
     
     import java.util.Collections;
     import java.util.LinkedHashMap;
    +import java.util.List;
     import java.util.Map;
    +import java.util.Set;
     import java.util.concurrent.Future;
     
    +import javax.annotation.Nonnull;
    +import javax.annotation.Nullable;
    +
    +import org.apache.brooklyn.api.mgmt.ExecutionContext;
    +import org.apache.brooklyn.api.objs.BrooklynObject;
    +import org.apache.brooklyn.config.ConfigInheritance;
    +import org.apache.brooklyn.config.ConfigInheritances;
    +import 
org.apache.brooklyn.config.ConfigInheritances.BasicConfigValueAtContainer;
     import org.apache.brooklyn.config.ConfigKey;
    -import org.apache.brooklyn.config.ConfigMap;
     import org.apache.brooklyn.config.ConfigKey.HasConfigKey;
    +import org.apache.brooklyn.config.ConfigMap.ConfigMapWithInheritance;
    +import org.apache.brooklyn.config.ConfigValueAtContainer;
    +import org.apache.brooklyn.core.config.BasicConfigInheritance;
    +import org.apache.brooklyn.core.config.ConfigKeys;
    +import org.apache.brooklyn.core.config.ConfigKeys.InheritanceContext;
    +import org.apache.brooklyn.core.config.Sanitizer;
     import org.apache.brooklyn.core.config.StructuredConfigKey;
    -import 
org.apache.brooklyn.core.entity.internal.ConfigMapViewWithStringKeys;
    +import org.apache.brooklyn.core.objs.BrooklynObjectInternal;
    +import org.apache.brooklyn.util.collections.MutableList;
    +import org.apache.brooklyn.util.collections.MutableMap;
    +import org.apache.brooklyn.util.collections.MutableSet;
    +import org.apache.brooklyn.util.core.config.ConfigBag;
     import org.apache.brooklyn.util.core.flags.TypeCoercions;
    +import org.apache.brooklyn.util.core.internal.ConfigKeySelfExtracting;
     import org.apache.brooklyn.util.core.task.DeferredSupplier;
    +import org.apache.brooklyn.util.exceptions.ReferenceWithError;
    +import org.apache.brooklyn.util.guava.Maybe;
     import org.slf4j.Logger;
     import org.slf4j.LoggerFactory;
     
    -public abstract class AbstractConfigMapImpl implements ConfigMap {
    +import com.google.common.base.Function;
    +import com.google.common.base.Predicate;
    +import com.google.common.collect.Iterables;
    +
    +public abstract class AbstractConfigMapImpl<TContainer extends 
BrooklynObject> implements ConfigMapWithInheritance<TContainer> {
    +
    +    /*
    +     * Changed Sept 2016 so that keys can determine inheritance strategy 
at every level in the hierarchy,
    +     * and signifcantly refactored to share code among subclasses, adding 
Location as a subclass.
    +     */
     
         private static final Logger LOG = 
LoggerFactory.getLogger(AbstractConfigMapImpl.class);
         
    -    protected final ConfigMapViewWithStringKeys mapViewWithStringKeys = 
new ConfigMapViewWithStringKeys(this);
    +    @SuppressWarnings("deprecation")
    +    protected final transient 
org.apache.brooklyn.core.entity.internal.ConfigMapViewWithStringKeys 
mapViewWithStringKeys = new 
org.apache.brooklyn.core.entity.internal.ConfigMapViewWithStringKeys(this);
    --- End diff --
    
    Why `transient`? This class should never be serialised - if it is, then 
it's an indication that something has gone very wrong. If it ever makes it into 
persisted state, then it means our persisted state has become even more brittle.
    
    `ConfigMapWithInheritance` is not `serializable`.


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

Reply via email to