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

    https://github.com/apache/incubator-brooklyn/pull/197#discussion_r18282573
  
    --- Diff: core/src/main/java/brooklyn/entity/basic/Entities.java ---
    @@ -657,8 +658,10 @@ public static void start(Entity e, Collection<? 
extends Location> locations) {
          */
         public static void destroy(Entity e) {
             if (isManaged(e)) {
    -            if (e instanceof Startable) 
Entities.invokeEffector((EntityLocal)e, e, Startable.STOP).getUnchecked();
    -            if (e instanceof EntityInternal) ((EntityInternal)e).destroy();
    +            if (!isReadOnly(e)) {
    +                if (e instanceof Startable) 
Entities.invokeEffector((EntityLocal)e, e, Startable.STOP).getUnchecked();
    +                if (e instanceof EntityInternal) 
((EntityInternal)e).destroy();
    +            }
                 unmanage(e);
                 log.debug("destroyed and unmanaged "+e+"; mgmt now "+
    --- End diff --
    
    Message not strictly true if `isReadOnly` was `true`.
    
    Why do we not need to also handle `isReadOnly` in `start`, above?


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