brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request #454: LocalEntityManager: make fields private
Date Fri, 25 Nov 2016 22:59:04 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/454#discussion_r89661014
  
    --- Diff: core/src/main/java/org/apache/brooklyn/core/mgmt/internal/LocalEntityManager.java
---
    @@ -742,7 +742,7 @@ private boolean unmanageNonRecursive(Entity e) {
                 if (e instanceof Group) {
                     Collection<Entity> members = ((Group)e).getMembers();
                     for (Entity member : members) {
    -                    if (!Entities.isNoLongerManaged(member)) member.removeGroup((Group)e);
    +                    if (!Entities.isNoLongerManaged(member)) ((EntityInternal)member).groups().remove((Group)e);
    --- End diff --
    
    @geomacy I don't think so. These are each very special cases:
    * `LocalEntityManager.unmanageNonRecursive()` is handling the case where the group has
been unmanaged - updating each of the members to ensure they know they are no longer in that
group. We don't want to start calling other methods on `group` (triggering a bunch of events)
because this entity is in the process of being unmanaged.
    * `AbstractGroupImpl`'s calls are the implementation of `addMember`/`removeMember`, so
they definitely need to call the `member.addGroup()`.
    * `GroupTest. testAddingUnmanagedGroupDoesNotFailBadly()` is trying to add an unmanaged
group to ensure that doesn't break things (so we couldn't call `group.addMember()`).



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