{"action":"created","comment":{"url":"https://api.github.com/repos/apache/brooklyn-server/pulls/comments/89661014","pull_request_review_id":10205751,"id":89661014,"diff_hunk":"@@ -742,7 +742,7 @@ private boolean unmanageNonRecursive(Entity e) {\n             if (e instanceof Group) {\n                 Collection<Entity> members = ((Group)e).getMembers();\n                 for (Entity member : members) {\n-                    if (!Entities.isNoLongerManaged(member)) member.removeGroup((Group)e);\n+                    if (!Entities.isNoLongerManaged(member)) ((EntityInternal)member).groups().remove((Group)e);","path":"core/src/main/java/org/apache/brooklyn/core/mgmt/internal/LocalEntityManager.java","position":38,"original_position":38,"commit_id":"06a19507a3f3bf0c2fcd739ca193b4aca59c9ccb","original_commit_id":"06a19507a3f3bf0c2fcd739ca193b4aca59c9ccb","user":{"login":"aledsage","id":593113,"avatar_url":"https://avatars.githubusercontent.com/u/593113?v=3","gravatar_id":"","url":"https://api.github.com/users/aledsage","html_url":"https://github.com/aledsage","followers_url":"https://api.github.com/users/aledsage/followers","following_url":"https://api.github.com/users/aledsage/following{/other_user}","gists_url":"https://api.github.com/users/aledsage/gists{/gist_id}","starred_url":"https://api.github.com/users/aledsage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aledsage/subscriptions","organizations_url":"https://api.github.com/users/aledsage/orgs","repos_url":"https://api.github.com/users/aledsage/repos","events_url":"https://api.github.com/users/aledsage/events{/privacy}","received_events_url":"https://api.github.com/users/aledsage/received_events","type":"User","site_admin":false},"body":"@geomacy I don't think so. These are each very special cases:\r\n* `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.\r\n* `AbstractGroupImpl`'s calls are the implementation of `addMember`/`removeMember`, so they definitely need to call the `member.addGroup()`.\r\n* `GroupTest. testAddingUnmanagedGroupDoesNotFailBadly()` is trying to add an unmanaged group to ensure that doesn't break things (so we couldn't call `group.addMember()`).\r\n","created_at":"2016-11-25T22:59:03Z","updated_at":"2016-11-25T22:59:03Z","html_url":"https://github.com/apache/brooklyn-server/pull/454#discussion_r89661014","pull_request_url":"https://api.github.com/repos/apache/brooklyn-server/pulls/454","_links":{"self":{"href":"https://api.github.com/repos/apache/brooklyn-server/pulls/comments/89661014"},"html":{"href":"https://github.com/apache/brooklyn-server/pull/454#discussion_r89661014"},"pull_request":{"href":"https://api.github.com/repos/apache/brooklyn-server/pulls/454"}}},"pull_request":{"url":"https://api.github.com/repos/apache/brooklyn-server/pulls/454","id":94891133,"html_url":"https://github.com/apache/brooklyn-server/pull/454","diff_url":"https://github.com/apache/brooklyn-server/pull/454.diff","patch_url":"https://github.com/apache/brooklyn-server/pull/454.patch","issue_url":"https://api.github.com/repos/apache/brooklyn-server/issues/454","number":454,"state":"open","locked":false,"title":"LocalEntityManager: make fields private","user":{"login":"aledsage","id":593113,"avatar_url":"https://avatars.githubusercontent.com/u/593113?v=3","gravatar_id":"","url":"https://api.github.com/users/aledsage","html_url":"https://github.com/aledsage","followers_url":"https://api.github.com/users/aledsage/followers","following_url":"https://api.github.com/users/aledsage/following{/other_user}","gists_url":"https://api.github.com/users/aledsage/gists{/gist_id}","starred_url":"https://api.github.com/users/aledsage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aledsage/subscriptions","organizations_url":"https://api.github.com/users/aledsage/orgs","repos_url":"https://api.github.com/users/aledsage/repos","events_url":"https://api.github.com/users/aledsage/events{/privacy}","received_events_url":"https://api.github.com/users/aledsage/received_events","type":"User","site_admin":false},"body":"As discussed with @geomacy in https://github.com/apache/brooklyn-server/pull/453#discussion_r89106124 ...\r\n\r\nMaking these fields non-private is asking for trouble - it makes it\r\nharder to reason about what the class does and whether it’s safe,\r\nparticularly around thread safety etc.\r\n    \r\nIt is also exposing more implementation detail than is required, making\r\nrefactoring harder in the future.\r\n    \r\nIf there is a compelling reason to provide access to the fields,\r\nwe can consider adding accessor(s).","created_at":"2016-11-22T20:23:29Z","updated_at":"2016-11-25T22:59:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ddb23e85619576dc9fab31f7e77ad59cc0ac66e3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/brooklyn-server/pulls/454/commits","review_comments_url":"https://api.github.com/repos/apache/brooklyn-server/pulls/454/comments","review_comment_url":"https://api.github.com/repos/apache/brooklyn-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/brooklyn-server/issues/454/comments","statuses_url":"https://api.github.com/repos/apache/brooklyn-server/statuses/06a19507a3f3bf0c2fcd739ca193b4aca59c9ccb","head":{"label":"aledsage:LocalManagementContext-fields-private","ref":"LocalManagementContext-fields-private","sha":"06a19507a3f3bf0c2fcd739ca193b4aca59c9ccb","user":{"login":"aledsage","id":593113,"avatar_url":"https://avatars.githubusercontent.com/u/593113?v=3","gravatar_id":"","url":"https://api.github.com/users/aledsage","html_url":"https://github.com/aledsage","followers_url":"https://api.github.com/users/aledsage/followers","following_url":"https://api.github.com/users/aledsage/following{/other_user}","gists_url":"https://api.github.com/users/aledsage/gists{/gist_id}","starred_url":"https://api.github.com/users/aledsage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aledsage/subscriptions","organizations_url":"https://api.github.com/users/aledsage/orgs","repos_url":"https://api.github.com/users/aledsage/repos","events_url":"https://api.github.com/users/aledsage/events{/privacy}","received_events_url":"https://api.github.com/users/aledsage/received_events","type":"User","site_admin":false},"repo":{"id":50909018,"name":"brooklyn-server","full_name":"aledsage/brooklyn-server","owner":{"login":"aledsage","id":593113,"avatar_url":"https://avatars.githubusercontent.com/u/593113?v=3","gravatar_id":"","url":"https://api.github.com/users/aledsage","html_url":"https://github.com/aledsage","followers_url":"https://api.github.com/users/aledsage/followers","following_url":"https://api.github.com/users/aledsage/following{/other_user}","gists_url":"https://api.github.com/users/aledsage/gists{/gist_id}","starred_url":"https://api.github.com/users/aledsage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aledsage/subscriptions","organizations_url":"https://api.github.com/users/aledsage/orgs","repos_url":"https://api.github.com/users/aledsage/repos","events_url":"https://api.github.com/users/aledsage/events{/privacy}","received_events_url":"https://api.github.com/users/aledsage/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aledsage/brooklyn-server","description":"Mirror of Apache Brooklyn server","fork":true,"url":"https://api.github.com/repos/aledsage/brooklyn-server","forks_url":"https://api.github.com/repos/aledsage/brooklyn-server/forks","keys_url":"https://api.github.com/repos/aledsage/brooklyn-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aledsage/brooklyn-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aledsage/brooklyn-server/teams","hooks_url":"https://api.github.com/repos/aledsage/brooklyn-server/hooks","issue_events_url":"https://api.github.com/repos/aledsage/brooklyn-server/issues/events{/number}","events_url":"https://api.github.com/repos/aledsage/brooklyn-server/events","assignees_url":"https://api.github.com/repos/aledsage/brooklyn-server/assignees{/user}","branches_url":"https://api.github.com/repos/aledsage/brooklyn-server/branches{/branch}","tags_url":"https://api.github.com/repos/aledsage/brooklyn-server/tags","blobs_url":"https://api.github.com/repos/aledsage/brooklyn-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aledsage/brooklyn-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aledsage/brooklyn-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/aledsage/brooklyn-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aledsage/brooklyn-server/statuses/{sha}","languages_url":"https://api.github.com/repos/aledsage/brooklyn-server/languages","stargazers_url":"https://api.github.com/repos/aledsage/brooklyn-server/stargazers","contributors_url":"https://api.github.com/repos/aledsage/brooklyn-server/contributors","subscribers_url":"https://api.github.com/repos/aledsage/brooklyn-server/subscribers","subscription_url":"https://api.github.com/repos/aledsage/brooklyn-server/subscription","commits_url":"https://api.github.com/repos/aledsage/brooklyn-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/aledsage/brooklyn-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/aledsage/brooklyn-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/aledsage/brooklyn-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/aledsage/brooklyn-server/contents/{+path}","compare_url":"https://api.github.com/repos/aledsage/brooklyn-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aledsage/brooklyn-server/merges","archive_url":"https://api.github.com/repos/aledsage/brooklyn-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aledsage/brooklyn-server/downloads","issues_url":"https://api.github.com/repos/aledsage/brooklyn-server/issues{/number}","pulls_url":"https://api.github.com/repos/aledsage/brooklyn-server/pulls{/number}","milestones_url":"https://api.github.com/repos/aledsage/brooklyn-server/milestones{/number}","notifications_url":"https://api.github.com/repos/aledsage/brooklyn-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aledsage/brooklyn-server/labels{/name}","releases_url":"https://api.github.com/repos/aledsage/brooklyn-server/releases{/id}","deployments_url":"https://api.github.com/repos/aledsage/brooklyn-server/deployments","created_at":"2016-02-02T09:23:44Z","updated_at":"2016-02-02T09:23:52Z","pushed_at":"2016-11-23T18:37:52Z","git_url":"git://github.com/aledsage/brooklyn-server.git","ssh_url":"git@github.com:aledsage/brooklyn-server.git","clone_url":"https://github.com/aledsage/brooklyn-server.git","svn_url":"https://github.com/aledsage/brooklyn-server","homepage":null,"size":32220,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"0a1064f2008b12174b30df16830509e99fb13d59","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":47246081,"name":"brooklyn-server","full_name":"apache/brooklyn-server","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/brooklyn-server","description":"Mirror of Apache Brooklyn server","fork":false,"url":"https://api.github.com/repos/apache/brooklyn-server","forks_url":"https://api.github.com/repos/apache/brooklyn-server/forks","keys_url":"https://api.github.com/repos/apache/brooklyn-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/brooklyn-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/brooklyn-server/teams","hooks_url":"https://api.github.com/repos/apache/brooklyn-server/hooks","issue_events_url":"https://api.github.com/repos/apache/brooklyn-server/issues/events{/number}","events_url":"https://api.github.com/repos/apache/brooklyn-server/events","assignees_url":"https://api.github.com/repos/apache/brooklyn-server/assignees{/user}","branches_url":"https://api.github.com/repos/apache/brooklyn-server/branches{/branch}","tags_url":"https://api.github.com/repos/apache/brooklyn-server/tags","blobs_url":"https://api.github.com/repos/apache/brooklyn-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/brooklyn-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/brooklyn-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/brooklyn-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/brooklyn-server/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/brooklyn-server/languages","stargazers_url":"https://api.github.com/repos/apache/brooklyn-server/stargazers","contributors_url":"https://api.github.com/repos/apache/brooklyn-server/contributors","subscribers_url":"https://api.github.com/repos/apache/brooklyn-server/subscribers","subscription_url":"https://api.github.com/repos/apache/brooklyn-server/subscription","commits_url":"https://api.github.com/repos/apache/brooklyn-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/brooklyn-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/brooklyn-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/brooklyn-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/brooklyn-server/contents/{+path}","compare_url":"https://api.github.com/repos/apache/brooklyn-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/brooklyn-server/merges","archive_url":"https://api.github.com/repos/apache/brooklyn-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/brooklyn-server/downloads","issues_url":"https://api.github.com/repos/apache/brooklyn-server/issues{/number}","pulls_url":"https://api.github.com/repos/apache/brooklyn-server/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/brooklyn-server/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/brooklyn-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/brooklyn-server/labels{/name}","releases_url":"https://api.github.com/repos/apache/brooklyn-server/releases{/id}","deployments_url":"https://api.github.com/repos/apache/brooklyn-server/deployments","created_at":"2015-12-02T08:00:06Z","updated_at":"2016-11-01T11:09:27Z","pushed_at":"2016-11-25T16:25:44Z","git_url":"git://github.com/apache/brooklyn-server.git","ssh_url":"git@github.com:apache/brooklyn-server.git","clone_url":"https://github.com/apache/brooklyn-server.git","svn_url":"https://github.com/apache/brooklyn-server","homepage":null,"size":33032,"stargazers_count":13,"watchers_count":13,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":40,"mirror_url":"git://git.apache.org/brooklyn-server.git","open_issues_count":28,"forks":40,"open_issues":28,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/brooklyn-server/pulls/454"},"html":{"href":"https://github.com/apache/brooklyn-server/pull/454"},"issue":{"href":"https://api.github.com/repos/apache/brooklyn-server/issues/454"},"comments":{"href":"https://api.github.com/repos/apache/brooklyn-server/issues/454/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/brooklyn-server/pulls/454/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/brooklyn-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/brooklyn-server/pulls/454/commits"},"statuses":{"href":"https://api.github.com/repos/apache/brooklyn-server/statuses/06a19507a3f3bf0c2fcd739ca193b4aca59c9ccb"}}}}
{"actor":{"display_login":"aledsage"}}