{"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/comments/37578140","id":37578140,"diff_hunk":"@@ -39,21 +39,65 @@\n public class CatalogPredicates {\n \n     public static <T,SpecT> Predicate<CatalogItem<T,SpecT>> isCatalogItemType(final CatalogItemType ciType) {\n-        return new Predicate<CatalogItem<T,SpecT>>() {\n+        // TODO PERSISTENCE WORKAROUND kept anonymous function in case referenced in persisted state\n+        new Predicate<CatalogItem<T,SpecT>>() {\n             @Override\n             public boolean apply(@Nullable CatalogItem<T,SpecT> item) {\n                 return (item != null) && item.getCatalogItemType()==ciType;\n             }\n         };\n+        return new CatalogItemTypeEqualTo<T, SpecT>(ciType);\n+    }\n+\n+    private static class CatalogItemTypeEqualTo<T,SpecT> implements Predicate<CatalogItem<T,SpecT>> {\n+        private final CatalogItemType ciType;\n+        \n+        public CatalogItemTypeEqualTo(final CatalogItemType ciType) {\n+            this.ciType = ciType;\n+        }\n+        @Override\n+        public boolean apply(@Nullable CatalogItem<T,SpecT> item) {\n+            return (item != null) && item.getCatalogItemType()==ciType;\n+        }\n     }\n \n     public static <T,SpecT> Predicate<CatalogItem<T,SpecT>> deprecated(final boolean deprecated) {\n-        return new Predicate<CatalogItem<T,SpecT>>() {\n+        // TODO PERSISTENCE WORKAROUND kept anonymous function in case referenced in persisted state","path":"core/src/main/java/org/apache/brooklyn/core/catalog/CatalogPredicates.java","position":29,"original_position":29,"commit_id":"3e5573c4551ad7e74fa88c5f0490040dead3a88c","original_commit_id":"3e5573c4551ad7e74fa88c5f0490040dead3a88c","user":{"login":"ahgittin","id":496540,"avatar_url":"https://avatars.githubusercontent.com/u/496540?v=3","gravatar_id":"","url":"https://api.github.com/users/ahgittin","html_url":"https://github.com/ahgittin","followers_url":"https://api.github.com/users/ahgittin/followers","following_url":"https://api.github.com/users/ahgittin/following{/other_user}","gists_url":"https://api.github.com/users/ahgittin/gists{/gist_id}","starred_url":"https://api.github.com/users/ahgittin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahgittin/subscriptions","organizations_url":"https://api.github.com/users/ahgittin/orgs","repos_url":"https://api.github.com/users/ahgittin/repos","events_url":"https://api.github.com/users/ahgittin/events{/privacy}","received_events_url":"https://api.github.com/users/ahgittin/received_events","type":"User","site_admin":false},"body":"as above, `@since`","created_at":"2015-08-20T20:37:32Z","updated_at":"2015-08-20T20:37:32Z","html_url":"https://github.com/apache/incubator-brooklyn/pull/850#discussion_r37578140","pull_request_url":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/850","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/comments/37578140"},"html":{"href":"https://github.com/apache/incubator-brooklyn/pull/850#discussion_r37578140"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/850"}}},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/850","id":42816030,"html_url":"https://github.com/apache/incubator-brooklyn/pull/850","diff_url":"https://github.com/apache/incubator-brooklyn/pull/850.diff","patch_url":"https://github.com/apache/incubator-brooklyn/pull/850.patch","issue_url":"https://api.github.com/repos/apache/incubator-brooklyn/issues/850","number":850,"state":"open","locked":false,"title":"Feature: catalog item disabled","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 on mailing list.\r\n\r\n(I still need to rebase this against master, after all the package renames, so it cannot yet be merged).","created_at":"2015-08-19T13:47:50Z","updated_at":"2015-08-20T20:37:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0a648a50fecccdee283f565062167d6dafcebcd1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/850/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/850/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-brooklyn/issues/850/comments","statuses_url":"https://api.github.com/repos/apache/incubator-brooklyn/statuses/3e5573c4551ad7e74fa88c5f0490040dead3a88c","head":{"label":"aledsage:feature/CatalogItem-disabled","ref":"feature/CatalogItem-disabled","sha":"3e5573c4551ad7e74fa88c5f0490040dead3a88c","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":21017170,"name":"incubator-brooklyn","full_name":"aledsage/incubator-brooklyn","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/incubator-brooklyn","description":"Mirror of Apache Brooklyn","fork":true,"url":"https://api.github.com/repos/aledsage/incubator-brooklyn","forks_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/forks","keys_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/teams","hooks_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/hooks","issue_events_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/issues/events{/number}","events_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/events","assignees_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/assignees{/user}","branches_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/branches{/branch}","tags_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/tags","blobs_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/statuses/{sha}","languages_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/languages","stargazers_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/stargazers","contributors_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/contributors","subscribers_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/subscribers","subscription_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/subscription","commits_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/contents/{+path}","compare_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/merges","archive_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/downloads","issues_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/issues{/number}","pulls_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/pulls{/number}","milestones_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/milestones{/number}","notifications_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/labels{/name}","releases_url":"https://api.github.com/repos/aledsage/incubator-brooklyn/releases{/id}","created_at":"2014-06-19T22:03:41Z","updated_at":"2015-04-17T16:32:12Z","pushed_at":"2015-08-20T19:55:33Z","git_url":"git://github.com/aledsage/incubator-brooklyn.git","ssh_url":"git@github.com:aledsage/incubator-brooklyn.git","clone_url":"https://github.com/aledsage/incubator-brooklyn.git","svn_url":"https://github.com/aledsage/incubator-brooklyn","homepage":null,"size":252598,"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":"0c24058088967d1928708d38c9c8c1658c923b99","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":19368221,"name":"incubator-brooklyn","full_name":"apache/incubator-brooklyn","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/incubator-brooklyn","description":"Mirror of Apache Brooklyn","fork":false,"url":"https://api.github.com/repos/apache/incubator-brooklyn","forks_url":"https://api.github.com/repos/apache/incubator-brooklyn/forks","keys_url":"https://api.github.com/repos/apache/incubator-brooklyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-brooklyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-brooklyn/teams","hooks_url":"https://api.github.com/repos/apache/incubator-brooklyn/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-brooklyn/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-brooklyn/events","assignees_url":"https://api.github.com/repos/apache/incubator-brooklyn/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-brooklyn/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-brooklyn/tags","blobs_url":"https://api.github.com/repos/apache/incubator-brooklyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-brooklyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-brooklyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-brooklyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-brooklyn/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-brooklyn/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-brooklyn/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-brooklyn/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-brooklyn/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-brooklyn/subscription","commits_url":"https://api.github.com/repos/apache/incubator-brooklyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-brooklyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-brooklyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-brooklyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-brooklyn/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-brooklyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-brooklyn/merges","archive_url":"https://api.github.com/repos/apache/incubator-brooklyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-brooklyn/downloads","issues_url":"https://api.github.com/repos/apache/incubator-brooklyn/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-brooklyn/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-brooklyn/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-brooklyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-brooklyn/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-brooklyn/releases{/id}","created_at":"2014-05-02T07:00:07Z","updated_at":"2015-08-20T12:50:01Z","pushed_at":"2015-08-20T20:34:34Z","git_url":"git://github.com/apache/incubator-brooklyn.git","ssh_url":"git@github.com:apache/incubator-brooklyn.git","clone_url":"https://github.com/apache/incubator-brooklyn.git","svn_url":"https://github.com/apache/incubator-brooklyn","homepage":null,"size":262564,"stargazers_count":102,"watchers_count":102,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":82,"mirror_url":"git://git.apache.org/incubator-brooklyn.git","open_issues_count":8,"forks":82,"open_issues":8,"watchers":102,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/850"},"html":{"href":"https://github.com/apache/incubator-brooklyn/pull/850"},"issue":{"href":"https://api.github.com/repos/apache/incubator-brooklyn/issues/850"},"comments":{"href":"https://api.github.com/repos/apache/incubator-brooklyn/issues/850/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/850/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/850/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-brooklyn/statuses/3e5573c4551ad7e74fa88c5f0490040dead3a88c"}}}}