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

    https://github.com/apache/incubator-brooklyn/pull/506#discussion_r24330252
  
    --- Diff: 
core/src/main/java/brooklyn/management/internal/LocalEntityManager.java ---
    @@ -354,23 +362,23 @@ private void unmanage(final Entity e, 
ManagementTransitionMode mode, boolean has
             
             if (hasBeenReplaced) {
                 // we are unmanaging an old instance after having replaced it
    -            // (called from manage(...)
    +            // don't unmanage or even clear its fields, because there 
might be references to it
                 
    -            if 
(mode==ManagementTransitionMode.REBINDING_NO_LONGER_PRIMARY) {
    -                // when migrating away, these all need to be called
    +            if (mode.wasReadOnly()) {
    +                // if coming *from* read only; nothing needed
    +            } else {
    +                if (!mode.wasPrimary()) {
    +                    log.warn("Unexpected mode "+mode+" for 
unmanage-replace "+e+" (applying anyway)");
    --- End diff --
    
    My ideal would be a model where tests fail if they write any WARN messages 
at all.  (Maybe we support `@AllowLogWarnings` for some cases.)
    
    I'm in the habit of watching out for WARNs when running things.  Everyone 
should be.


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