{"action":"created","comment":{"url":"https://api.github.com/repos/google/binnavi/pulls/comments/56319494","id":56319494,"diff_hunk":"@@ -47,45 +48,35 @@\n \n   public static <ItemType> int count(final Collection<? extends ItemType> collection,\n       final ItemType item) {\n-    int counter = 0;\n-\n-    for (final ItemType itemType : collection) {\n-      if (itemType == item) {\n-        counter++;\n-      }\n-    }\n-\n-    return counter;\n+    \n+    return (int) collection.stream()\n+                   .filter(itemType -> itemType == item)\n+                   .count();\n   }\n \n   public static <ItemType> int countIf(final Collection<? extends ItemType> collection,\n       final ICollectionFilter<ItemType> item) {\n-    int counter = 0;\n-\n-    for (final ItemType itemType : collection) {\n-      if (item.qualifies(itemType)) {\n-        counter++;\n-      }\n-    }\n-\n-    return counter;\n+    \n+    return (int) collection.stream()\n+                   .filter(itemType -> item.qualifies(itemType))\n+                   .count();\n   }\n \n   public static <ItemType> List<ItemType> filter(final Collection<? extends ItemType> collection,\n       final ICollectionFilter<ItemType> callback) {\n-    final List<ItemType> filteredItems = new ArrayList<ItemType>();\n-\n-    for (final ItemType item : collection) {\n-      if (callback.qualifies(item)) {\n-        filteredItems.add(item);\n-      }\n-    }\n-\n+    final List<ItemType> filteredItems = new ArrayList<>();\t\t\n+ \t\t ","path":"src/main/java/com/google/security/zynamics/zylib/types/common/CollectionHelpers.java","position":55,"original_position":55,"commit_id":"8b3b98aec126121fb4c6c3bd98776f5dc80f72e5","original_commit_id":"8b3b98aec126121fb4c6c3bd98776f5dc80f72e5","user":{"login":"0xFFFFFFFE","id":7894121,"avatar_url":"https://avatars.githubusercontent.com/u/7894121?v=3","gravatar_id":"","url":"https://api.github.com/users/0xFFFFFFFE","html_url":"https://github.com/0xFFFFFFFE","followers_url":"https://api.github.com/users/0xFFFFFFFE/followers","following_url":"https://api.github.com/users/0xFFFFFFFE/following{/other_user}","gists_url":"https://api.github.com/users/0xFFFFFFFE/gists{/gist_id}","starred_url":"https://api.github.com/users/0xFFFFFFFE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0xFFFFFFFE/subscriptions","organizations_url":"https://api.github.com/users/0xFFFFFFFE/orgs","repos_url":"https://api.github.com/users/0xFFFFFFFE/repos","events_url":"https://api.github.com/users/0xFFFFFFFE/events{/privacy}","received_events_url":"https://api.github.com/users/0xFFFFFFFE/received_events","type":"User","site_admin":false},"body":"please remove the white space.","created_at":"2016-03-16T11:41:23Z","updated_at":"2016-03-16T11:41:23Z","html_url":"https://github.com/google/binnavi/pull/60#discussion_r56319494","pull_request_url":"https://api.github.com/repos/google/binnavi/pulls/60","_links":{"self":{"href":"https://api.github.com/repos/google/binnavi/pulls/comments/56319494"},"html":{"href":"https://github.com/google/binnavi/pull/60#discussion_r56319494"},"pull_request":{"href":"https://api.github.com/repos/google/binnavi/pulls/60"}}},"pull_request":{"url":"https://api.github.com/repos/google/binnavi/pulls/60","id":48171702,"html_url":"https://github.com/google/binnavi/pull/60","diff_url":"https://github.com/google/binnavi/pull/60.diff","patch_url":"https://github.com/google/binnavi/pull/60.patch","issue_url":"https://api.github.com/repos/google/binnavi/issues/60","number":60,"state":"open","locked":false,"title":"Polishing","user":{"login":"myArea51","id":8675954,"avatar_url":"https://avatars.githubusercontent.com/u/8675954?v=3","gravatar_id":"","url":"https://api.github.com/users/myArea51","html_url":"https://github.com/myArea51","followers_url":"https://api.github.com/users/myArea51/followers","following_url":"https://api.github.com/users/myArea51/following{/other_user}","gists_url":"https://api.github.com/users/myArea51/gists{/gist_id}","starred_url":"https://api.github.com/users/myArea51/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myArea51/subscriptions","organizations_url":"https://api.github.com/users/myArea51/orgs","repos_url":"https://api.github.com/users/myArea51/repos","events_url":"https://api.github.com/users/myArea51/events{/privacy}","received_events_url":"https://api.github.com/users/myArea51/received_events","type":"User","site_admin":false},"body":"It is a risky way to use assertions in catch block (in the public method), even when the probability of exception is very low. Assertions can be disabled.\r\n\r\nAdd logging with NaviLogger","created_at":"2015-10-20T08:46:28Z","updated_at":"2016-03-16T11:41:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f4b10af9e6dab18f65f02ed6b7c5c1c8012aebd2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/google/binnavi/pulls/60/commits","review_comments_url":"https://api.github.com/repos/google/binnavi/pulls/60/comments","review_comment_url":"https://api.github.com/repos/google/binnavi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/binnavi/issues/60/comments","statuses_url":"https://api.github.com/repos/google/binnavi/statuses/8b3b98aec126121fb4c6c3bd98776f5dc80f72e5","head":{"label":"myArea51:master","ref":"master","sha":"8b3b98aec126121fb4c6c3bd98776f5dc80f72e5","user":{"login":"myArea51","id":8675954,"avatar_url":"https://avatars.githubusercontent.com/u/8675954?v=3","gravatar_id":"","url":"https://api.github.com/users/myArea51","html_url":"https://github.com/myArea51","followers_url":"https://api.github.com/users/myArea51/followers","following_url":"https://api.github.com/users/myArea51/following{/other_user}","gists_url":"https://api.github.com/users/myArea51/gists{/gist_id}","starred_url":"https://api.github.com/users/myArea51/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myArea51/subscriptions","organizations_url":"https://api.github.com/users/myArea51/orgs","repos_url":"https://api.github.com/users/myArea51/repos","events_url":"https://api.github.com/users/myArea51/events{/privacy}","received_events_url":"https://api.github.com/users/myArea51/received_events","type":"User","site_admin":false},"repo":{"id":44589833,"name":"binnavi","full_name":"myArea51/binnavi","owner":{"login":"myArea51","id":8675954,"avatar_url":"https://avatars.githubusercontent.com/u/8675954?v=3","gravatar_id":"","url":"https://api.github.com/users/myArea51","html_url":"https://github.com/myArea51","followers_url":"https://api.github.com/users/myArea51/followers","following_url":"https://api.github.com/users/myArea51/following{/other_user}","gists_url":"https://api.github.com/users/myArea51/gists{/gist_id}","starred_url":"https://api.github.com/users/myArea51/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myArea51/subscriptions","organizations_url":"https://api.github.com/users/myArea51/orgs","repos_url":"https://api.github.com/users/myArea51/repos","events_url":"https://api.github.com/users/myArea51/events{/privacy}","received_events_url":"https://api.github.com/users/myArea51/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/myArea51/binnavi","description":"BinNavi is a binary analysis IDE that allows to inspect, navigate, edit and annotate control flow graphs and call graphs of disassembled code.","fork":true,"url":"https://api.github.com/repos/myArea51/binnavi","forks_url":"https://api.github.com/repos/myArea51/binnavi/forks","keys_url":"https://api.github.com/repos/myArea51/binnavi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/myArea51/binnavi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/myArea51/binnavi/teams","hooks_url":"https://api.github.com/repos/myArea51/binnavi/hooks","issue_events_url":"https://api.github.com/repos/myArea51/binnavi/issues/events{/number}","events_url":"https://api.github.com/repos/myArea51/binnavi/events","assignees_url":"https://api.github.com/repos/myArea51/binnavi/assignees{/user}","branches_url":"https://api.github.com/repos/myArea51/binnavi/branches{/branch}","tags_url":"https://api.github.com/repos/myArea51/binnavi/tags","blobs_url":"https://api.github.com/repos/myArea51/binnavi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/myArea51/binnavi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/myArea51/binnavi/git/refs{/sha}","trees_url":"https://api.github.com/repos/myArea51/binnavi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/myArea51/binnavi/statuses/{sha}","languages_url":"https://api.github.com/repos/myArea51/binnavi/languages","stargazers_url":"https://api.github.com/repos/myArea51/binnavi/stargazers","contributors_url":"https://api.github.com/repos/myArea51/binnavi/contributors","subscribers_url":"https://api.github.com/repos/myArea51/binnavi/subscribers","subscription_url":"https://api.github.com/repos/myArea51/binnavi/subscription","commits_url":"https://api.github.com/repos/myArea51/binnavi/commits{/sha}","git_commits_url":"https://api.github.com/repos/myArea51/binnavi/git/commits{/sha}","comments_url":"https://api.github.com/repos/myArea51/binnavi/comments{/number}","issue_comment_url":"https://api.github.com/repos/myArea51/binnavi/issues/comments{/number}","contents_url":"https://api.github.com/repos/myArea51/binnavi/contents/{+path}","compare_url":"https://api.github.com/repos/myArea51/binnavi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/myArea51/binnavi/merges","archive_url":"https://api.github.com/repos/myArea51/binnavi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/myArea51/binnavi/downloads","issues_url":"https://api.github.com/repos/myArea51/binnavi/issues{/number}","pulls_url":"https://api.github.com/repos/myArea51/binnavi/pulls{/number}","milestones_url":"https://api.github.com/repos/myArea51/binnavi/milestones{/number}","notifications_url":"https://api.github.com/repos/myArea51/binnavi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/myArea51/binnavi/labels{/name}","releases_url":"https://api.github.com/repos/myArea51/binnavi/releases{/id}","deployments_url":"https://api.github.com/repos/myArea51/binnavi/deployments","created_at":"2015-10-20T07:35:22Z","updated_at":"2015-10-20T07:35:45Z","pushed_at":"2015-10-22T12:49:48Z","git_url":"git://github.com/myArea51/binnavi.git","ssh_url":"git@github.com:myArea51/binnavi.git","clone_url":"https://github.com/myArea51/binnavi.git","svn_url":"https://github.com/myArea51/binnavi","homepage":"http://www.zynamics.com/binnavi.html","size":129304,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":false,"has_wiki":true,"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":"google:master","ref":"master","sha":"0f497e873402ebfe63cf233668e372d40be45bca","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":41032178,"name":"binnavi","full_name":"google/binnavi","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/binnavi","description":"BinNavi is a binary analysis IDE that allows to inspect, navigate, edit and annotate control flow graphs and call graphs of disassembled code.","fork":false,"url":"https://api.github.com/repos/google/binnavi","forks_url":"https://api.github.com/repos/google/binnavi/forks","keys_url":"https://api.github.com/repos/google/binnavi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/binnavi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/binnavi/teams","hooks_url":"https://api.github.com/repos/google/binnavi/hooks","issue_events_url":"https://api.github.com/repos/google/binnavi/issues/events{/number}","events_url":"https://api.github.com/repos/google/binnavi/events","assignees_url":"https://api.github.com/repos/google/binnavi/assignees{/user}","branches_url":"https://api.github.com/repos/google/binnavi/branches{/branch}","tags_url":"https://api.github.com/repos/google/binnavi/tags","blobs_url":"https://api.github.com/repos/google/binnavi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/binnavi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/binnavi/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/binnavi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/binnavi/statuses/{sha}","languages_url":"https://api.github.com/repos/google/binnavi/languages","stargazers_url":"https://api.github.com/repos/google/binnavi/stargazers","contributors_url":"https://api.github.com/repos/google/binnavi/contributors","subscribers_url":"https://api.github.com/repos/google/binnavi/subscribers","subscription_url":"https://api.github.com/repos/google/binnavi/subscription","commits_url":"https://api.github.com/repos/google/binnavi/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/binnavi/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/binnavi/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/binnavi/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/binnavi/contents/{+path}","compare_url":"https://api.github.com/repos/google/binnavi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/binnavi/merges","archive_url":"https://api.github.com/repos/google/binnavi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/binnavi/downloads","issues_url":"https://api.github.com/repos/google/binnavi/issues{/number}","pulls_url":"https://api.github.com/repos/google/binnavi/pulls{/number}","milestones_url":"https://api.github.com/repos/google/binnavi/milestones{/number}","notifications_url":"https://api.github.com/repos/google/binnavi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/binnavi/labels{/name}","releases_url":"https://api.github.com/repos/google/binnavi/releases{/id}","deployments_url":"https://api.github.com/repos/google/binnavi/deployments","created_at":"2015-08-19T12:20:24Z","updated_at":"2016-03-15T18:19:24Z","pushed_at":"2016-03-16T10:26:21Z","git_url":"git://github.com/google/binnavi.git","ssh_url":"git@github.com:google/binnavi.git","clone_url":"https://github.com/google/binnavi.git","svn_url":"https://github.com/google/binnavi","homepage":"http://www.zynamics.com/binnavi.html","size":132122,"stargazers_count":1499,"watchers_count":1499,"language":"Java","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":238,"mirror_url":null,"open_issues_count":15,"forks":238,"open_issues":15,"watchers":1499,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/binnavi/pulls/60"},"html":{"href":"https://github.com/google/binnavi/pull/60"},"issue":{"href":"https://api.github.com/repos/google/binnavi/issues/60"},"comments":{"href":"https://api.github.com/repos/google/binnavi/issues/60/comments"},"review_comments":{"href":"https://api.github.com/repos/google/binnavi/pulls/60/comments"},"review_comment":{"href":"https://api.github.com/repos/google/binnavi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/binnavi/pulls/60/commits"},"statuses":{"href":"https://api.github.com/repos/google/binnavi/statuses/8b3b98aec126121fb4c6c3bd98776f5dc80f72e5"}}}}