{"action":"created","comment":{"url":"https://api.github.com/repos/netty/netty/pulls/comments/86663836","pull_request_review_id":7313420,"id":86663836,"diff_hunk":"@@ -97,4 +97,17 @@ public void operationComplete(Future<List<InetAddress>> future) throws Exception\n             }\n         });\n     }\n+\n+    /**\n+     * @param anyInt any integer value to covert\n+     * @param len max limit of range\n+     * @return integer in (0, len] range, using formula {@code (anyInt % len + anyInt) % len}\n+     */\n+    protected static int toIndex(int anyInt, int len) {\n+        int index = anyInt % len;\n+        if (index < 0) {\n+            index = index + len;","path":"resolver/src/main/java/io/netty/resolver/RoundRobinInetAddressResolver.java","position":40,"original_position":40,"commit_id":"481ddc9d45b82ea2ab876dbad9d508df2c268ebe","original_commit_id":"927d404008ab28862d9105105e4db7f3fb499306","user":{"login":"Spikhalskiy","id":532108,"avatar_url":"https://avatars.githubusercontent.com/u/532108?v=3","gravatar_id":"","url":"https://api.github.com/users/Spikhalskiy","html_url":"https://github.com/Spikhalskiy","followers_url":"https://api.github.com/users/Spikhalskiy/followers","following_url":"https://api.github.com/users/Spikhalskiy/following{/other_user}","gists_url":"https://api.github.com/users/Spikhalskiy/gists{/gist_id}","starred_url":"https://api.github.com/users/Spikhalskiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Spikhalskiy/subscriptions","organizations_url":"https://api.github.com/users/Spikhalskiy/orgs","repos_url":"https://api.github.com/users/Spikhalskiy/repos","events_url":"https://api.github.com/users/Spikhalskiy/events{/privacy}","received_events_url":"https://api.github.com/users/Spikhalskiy/received_events","type":"User","site_admin":false},"body":"> Your continuity will break from Integer.MAX_VALUE to Integer.MIN_VALUE\r\n\r\nIt's fine. You are trying to handle a gap which is a result of the absence of -Integer.MIN_VALUE. I think it's not a good idea, especially because it introduces a gap around 0. I'm pretty sure there is no easy way to do it without a gap (if we don't write non-obvious tricks that take into account turn number over Integer scale). Not worth any effort.","created_at":"2016-11-05T12:30:36Z","updated_at":"2016-11-05T12:30:36Z","html_url":"https://github.com/netty/netty/pull/5984#discussion_r86663836","pull_request_url":"https://api.github.com/repos/netty/netty/pulls/5984","_links":{"self":{"href":"https://api.github.com/repos/netty/netty/pulls/comments/86663836"},"html":{"href":"https://github.com/netty/netty/pull/5984#discussion_r86663836"},"pull_request":{"href":"https://api.github.com/repos/netty/netty/pulls/5984"}}},"pull_request":{"url":"https://api.github.com/repos/netty/netty/pulls/5984","id":92423884,"html_url":"https://github.com/netty/netty/pull/5984","diff_url":"https://github.com/netty/netty/pull/5984.diff","patch_url":"https://github.com/netty/netty/pull/5984.patch","issue_url":"https://api.github.com/repos/netty/netty/issues/5984","number":5984,"state":"open","locked":false,"title":"Address issue with integer overflow in RoundRobinInetAddressResolver counter","user":{"login":"Spikhalskiy","id":532108,"avatar_url":"https://avatars.githubusercontent.com/u/532108?v=3","gravatar_id":"","url":"https://api.github.com/users/Spikhalskiy","html_url":"https://github.com/Spikhalskiy","followers_url":"https://api.github.com/users/Spikhalskiy/followers","following_url":"https://api.github.com/users/Spikhalskiy/following{/other_user}","gists_url":"https://api.github.com/users/Spikhalskiy/gists{/gist_id}","starred_url":"https://api.github.com/users/Spikhalskiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Spikhalskiy/subscriptions","organizations_url":"https://api.github.com/users/Spikhalskiy/orgs","repos_url":"https://api.github.com/users/Spikhalskiy/repos","events_url":"https://api.github.com/users/Spikhalskiy/events{/privacy}","received_events_url":"https://api.github.com/users/Spikhalskiy/received_events","type":"User","site_admin":false},"body":"Motivation:\r\n\r\nAddress possible counter overflow issue in RoundRobinInetAddressResolver.\r\nOriginally forgot to take into account that mod with a negative and a positive number is negative in Java.\r\n\r\nModification:\r\n\r\nMake index calculation safe in case of integer overflow.\r\n\r\nThanks @guidomedina for pointing it https://github.com/netty/netty/commit/5eebe9a06c6873e797b5f8c847086c35ae990ef5#commitcomment-19698899","created_at":"2016-11-04T22:10:28Z","updated_at":"2016-11-05T12:30:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8293f448d59916f5359f21064c9e34bb34457f68","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/netty/netty/pulls/5984/commits","review_comments_url":"https://api.github.com/repos/netty/netty/pulls/5984/comments","review_comment_url":"https://api.github.com/repos/netty/netty/pulls/comments{/number}","comments_url":"https://api.github.com/repos/netty/netty/issues/5984/comments","statuses_url":"https://api.github.com/repos/netty/netty/statuses/481ddc9d45b82ea2ab876dbad9d508df2c268ebe","head":{"label":"Spikhalskiy:rr-mod-issue","ref":"rr-mod-issue","sha":"481ddc9d45b82ea2ab876dbad9d508df2c268ebe","user":{"login":"Spikhalskiy","id":532108,"avatar_url":"https://avatars.githubusercontent.com/u/532108?v=3","gravatar_id":"","url":"https://api.github.com/users/Spikhalskiy","html_url":"https://github.com/Spikhalskiy","followers_url":"https://api.github.com/users/Spikhalskiy/followers","following_url":"https://api.github.com/users/Spikhalskiy/following{/other_user}","gists_url":"https://api.github.com/users/Spikhalskiy/gists{/gist_id}","starred_url":"https://api.github.com/users/Spikhalskiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Spikhalskiy/subscriptions","organizations_url":"https://api.github.com/users/Spikhalskiy/orgs","repos_url":"https://api.github.com/users/Spikhalskiy/repos","events_url":"https://api.github.com/users/Spikhalskiy/events{/privacy}","received_events_url":"https://api.github.com/users/Spikhalskiy/received_events","type":"User","site_admin":false},"repo":{"id":52401169,"name":"netty","full_name":"Spikhalskiy/netty","owner":{"login":"Spikhalskiy","id":532108,"avatar_url":"https://avatars.githubusercontent.com/u/532108?v=3","gravatar_id":"","url":"https://api.github.com/users/Spikhalskiy","html_url":"https://github.com/Spikhalskiy","followers_url":"https://api.github.com/users/Spikhalskiy/followers","following_url":"https://api.github.com/users/Spikhalskiy/following{/other_user}","gists_url":"https://api.github.com/users/Spikhalskiy/gists{/gist_id}","starred_url":"https://api.github.com/users/Spikhalskiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Spikhalskiy/subscriptions","organizations_url":"https://api.github.com/users/Spikhalskiy/orgs","repos_url":"https://api.github.com/users/Spikhalskiy/repos","events_url":"https://api.github.com/users/Spikhalskiy/events{/privacy}","received_events_url":"https://api.github.com/users/Spikhalskiy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Spikhalskiy/netty","description":"Netty project - an event-driven asynchronous network application framework","fork":true,"url":"https://api.github.com/repos/Spikhalskiy/netty","forks_url":"https://api.github.com/repos/Spikhalskiy/netty/forks","keys_url":"https://api.github.com/repos/Spikhalskiy/netty/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Spikhalskiy/netty/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Spikhalskiy/netty/teams","hooks_url":"https://api.github.com/repos/Spikhalskiy/netty/hooks","issue_events_url":"https://api.github.com/repos/Spikhalskiy/netty/issues/events{/number}","events_url":"https://api.github.com/repos/Spikhalskiy/netty/events","assignees_url":"https://api.github.com/repos/Spikhalskiy/netty/assignees{/user}","branches_url":"https://api.github.com/repos/Spikhalskiy/netty/branches{/branch}","tags_url":"https://api.github.com/repos/Spikhalskiy/netty/tags","blobs_url":"https://api.github.com/repos/Spikhalskiy/netty/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Spikhalskiy/netty/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Spikhalskiy/netty/git/refs{/sha}","trees_url":"https://api.github.com/repos/Spikhalskiy/netty/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Spikhalskiy/netty/statuses/{sha}","languages_url":"https://api.github.com/repos/Spikhalskiy/netty/languages","stargazers_url":"https://api.github.com/repos/Spikhalskiy/netty/stargazers","contributors_url":"https://api.github.com/repos/Spikhalskiy/netty/contributors","subscribers_url":"https://api.github.com/repos/Spikhalskiy/netty/subscribers","subscription_url":"https://api.github.com/repos/Spikhalskiy/netty/subscription","commits_url":"https://api.github.com/repos/Spikhalskiy/netty/commits{/sha}","git_commits_url":"https://api.github.com/repos/Spikhalskiy/netty/git/commits{/sha}","comments_url":"https://api.github.com/repos/Spikhalskiy/netty/comments{/number}","issue_comment_url":"https://api.github.com/repos/Spikhalskiy/netty/issues/comments{/number}","contents_url":"https://api.github.com/repos/Spikhalskiy/netty/contents/{+path}","compare_url":"https://api.github.com/repos/Spikhalskiy/netty/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Spikhalskiy/netty/merges","archive_url":"https://api.github.com/repos/Spikhalskiy/netty/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Spikhalskiy/netty/downloads","issues_url":"https://api.github.com/repos/Spikhalskiy/netty/issues{/number}","pulls_url":"https://api.github.com/repos/Spikhalskiy/netty/pulls{/number}","milestones_url":"https://api.github.com/repos/Spikhalskiy/netty/milestones{/number}","notifications_url":"https://api.github.com/repos/Spikhalskiy/netty/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Spikhalskiy/netty/labels{/name}","releases_url":"https://api.github.com/repos/Spikhalskiy/netty/releases{/id}","deployments_url":"https://api.github.com/repos/Spikhalskiy/netty/deployments","created_at":"2016-02-24T00:09:34Z","updated_at":"2016-02-24T00:09:44Z","pushed_at":"2016-11-04T23:29:42Z","git_url":"git://github.com/Spikhalskiy/netty.git","ssh_url":"git@github.com:Spikhalskiy/netty.git","clone_url":"https://github.com/Spikhalskiy/netty.git","svn_url":"https://github.com/Spikhalskiy/netty","homepage":"http://netty.io/","size":42632,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"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":"4.1"}},"base":{"label":"netty:4.1","ref":"4.1","sha":"5eebe9a06c6873e797b5f8c847086c35ae990ef5","user":{"login":"netty","id":473791,"avatar_url":"https://avatars.githubusercontent.com/u/473791?v=3","gravatar_id":"","url":"https://api.github.com/users/netty","html_url":"https://github.com/netty","followers_url":"https://api.github.com/users/netty/followers","following_url":"https://api.github.com/users/netty/following{/other_user}","gists_url":"https://api.github.com/users/netty/gists{/gist_id}","starred_url":"https://api.github.com/users/netty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netty/subscriptions","organizations_url":"https://api.github.com/users/netty/orgs","repos_url":"https://api.github.com/users/netty/repos","events_url":"https://api.github.com/users/netty/events{/privacy}","received_events_url":"https://api.github.com/users/netty/received_events","type":"Organization","site_admin":false},"repo":{"id":1064563,"name":"netty","full_name":"netty/netty","owner":{"login":"netty","id":473791,"avatar_url":"https://avatars.githubusercontent.com/u/473791?v=3","gravatar_id":"","url":"https://api.github.com/users/netty","html_url":"https://github.com/netty","followers_url":"https://api.github.com/users/netty/followers","following_url":"https://api.github.com/users/netty/following{/other_user}","gists_url":"https://api.github.com/users/netty/gists{/gist_id}","starred_url":"https://api.github.com/users/netty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netty/subscriptions","organizations_url":"https://api.github.com/users/netty/orgs","repos_url":"https://api.github.com/users/netty/repos","events_url":"https://api.github.com/users/netty/events{/privacy}","received_events_url":"https://api.github.com/users/netty/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/netty/netty","description":"Netty project - an event-driven asynchronous network application framework","fork":false,"url":"https://api.github.com/repos/netty/netty","forks_url":"https://api.github.com/repos/netty/netty/forks","keys_url":"https://api.github.com/repos/netty/netty/keys{/key_id}","collaborators_url":"https://api.github.com/repos/netty/netty/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/netty/netty/teams","hooks_url":"https://api.github.com/repos/netty/netty/hooks","issue_events_url":"https://api.github.com/repos/netty/netty/issues/events{/number}","events_url":"https://api.github.com/repos/netty/netty/events","assignees_url":"https://api.github.com/repos/netty/netty/assignees{/user}","branches_url":"https://api.github.com/repos/netty/netty/branches{/branch}","tags_url":"https://api.github.com/repos/netty/netty/tags","blobs_url":"https://api.github.com/repos/netty/netty/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/netty/netty/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/netty/netty/git/refs{/sha}","trees_url":"https://api.github.com/repos/netty/netty/git/trees{/sha}","statuses_url":"https://api.github.com/repos/netty/netty/statuses/{sha}","languages_url":"https://api.github.com/repos/netty/netty/languages","stargazers_url":"https://api.github.com/repos/netty/netty/stargazers","contributors_url":"https://api.github.com/repos/netty/netty/contributors","subscribers_url":"https://api.github.com/repos/netty/netty/subscribers","subscription_url":"https://api.github.com/repos/netty/netty/subscription","commits_url":"https://api.github.com/repos/netty/netty/commits{/sha}","git_commits_url":"https://api.github.com/repos/netty/netty/git/commits{/sha}","comments_url":"https://api.github.com/repos/netty/netty/comments{/number}","issue_comment_url":"https://api.github.com/repos/netty/netty/issues/comments{/number}","contents_url":"https://api.github.com/repos/netty/netty/contents/{+path}","compare_url":"https://api.github.com/repos/netty/netty/compare/{base}...{head}","merges_url":"https://api.github.com/repos/netty/netty/merges","archive_url":"https://api.github.com/repos/netty/netty/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/netty/netty/downloads","issues_url":"https://api.github.com/repos/netty/netty/issues{/number}","pulls_url":"https://api.github.com/repos/netty/netty/pulls{/number}","milestones_url":"https://api.github.com/repos/netty/netty/milestones{/number}","notifications_url":"https://api.github.com/repos/netty/netty/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/netty/netty/labels{/name}","releases_url":"https://api.github.com/repos/netty/netty/releases{/id}","deployments_url":"https://api.github.com/repos/netty/netty/deployments","created_at":"2010-11-09T09:22:21Z","updated_at":"2016-11-05T10:29:24Z","pushed_at":"2016-11-04T23:29:43Z","git_url":"git://github.com/netty/netty.git","ssh_url":"git@github.com:netty/netty.git","clone_url":"https://github.com/netty/netty.git","svn_url":"https://github.com/netty/netty","homepage":"http://netty.io/","size":73108,"stargazers_count":8184,"watchers_count":8184,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4144,"mirror_url":null,"open_issues_count":336,"forks":4144,"open_issues":336,"watchers":8184,"default_branch":"4.1"}},"_links":{"self":{"href":"https://api.github.com/repos/netty/netty/pulls/5984"},"html":{"href":"https://github.com/netty/netty/pull/5984"},"issue":{"href":"https://api.github.com/repos/netty/netty/issues/5984"},"comments":{"href":"https://api.github.com/repos/netty/netty/issues/5984/comments"},"review_comments":{"href":"https://api.github.com/repos/netty/netty/pulls/5984/comments"},"review_comment":{"href":"https://api.github.com/repos/netty/netty/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/netty/netty/pulls/5984/commits"},"statuses":{"href":"https://api.github.com/repos/netty/netty/statuses/481ddc9d45b82ea2ab876dbad9d508df2c268ebe"}}}}
{"actor":{"display_login":"Spikhalskiy"}}