{"action":"created","comment":{"url":"https://api.github.com/repos/netty/netty/pulls/comments/47690556","id":47690556,"diff_hunk":"@@ -0,0 +1,32 @@\n+/*\n+ * Copyright 2015 The Netty Project\n+ *\n+ * The Netty Project licenses this file to you under the Apache License,\n+ * version 2.0 (the \"License\"); you may not use this file except in compliance\n+ * with the License. You may obtain a copy of the License at:\n+ *\n+ *   http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n+ * License for the specific language governing permissions and limitations\n+ * under the License.\n+ */\n+package io.netty.resolver;\n+\n+import java.net.InetAddress;\n+import java.util.Map;\n+\n+/**\n+ * Default {@link HostsFileEntriesResolver} that resolves hosts file entries only once.\n+ */\n+public class DefaultHostsFileEntriesResolver implements HostsFileEntriesResolver {","path":"resolver/src/main/java/io/netty/resolver/DefaultHostsFileEntriesResolver.java","position":24,"original_position":24,"commit_id":"9d0d85521187a49fabbff342457c2338d7deee67","original_commit_id":"ea35168c1edcc51a4eaaf165aae3957398fc9c5e","user":{"login":"normanmaurer","id":439362,"avatar_url":"https://avatars.githubusercontent.com/u/439362?v=3","gravatar_id":"","url":"https://api.github.com/users/normanmaurer","html_url":"https://github.com/normanmaurer","followers_url":"https://api.github.com/users/normanmaurer/followers","following_url":"https://api.github.com/users/normanmaurer/following{/other_user}","gists_url":"https://api.github.com/users/normanmaurer/gists{/gist_id}","starred_url":"https://api.github.com/users/normanmaurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanmaurer/subscriptions","organizations_url":"https://api.github.com/users/normanmaurer/orgs","repos_url":"https://api.github.com/users/normanmaurer/repos","events_url":"https://api.github.com/users/normanmaurer/events{/privacy}","received_events_url":"https://api.github.com/users/normanmaurer/received_events","type":"User","site_admin":false},"body":"If we can't we should at least make it final ?","created_at":"2015-12-15T20:04:26Z","updated_at":"2015-12-15T20:04:26Z","html_url":"https://github.com/netty/netty/pull/4567#discussion_r47690556","pull_request_url":"https://api.github.com/repos/netty/netty/pulls/4567","_links":{"self":{"href":"https://api.github.com/repos/netty/netty/pulls/comments/47690556"},"html":{"href":"https://github.com/netty/netty/pull/4567#discussion_r47690556"},"pull_request":{"href":"https://api.github.com/repos/netty/netty/pulls/4567"}}},"pull_request":{"url":"https://api.github.com/repos/netty/netty/pulls/4567","id":53571765,"html_url":"https://github.com/netty/netty/pull/4567","diff_url":"https://github.com/netty/netty/pull/4567.diff","patch_url":"https://github.com/netty/netty/pull/4567.patch","issue_url":"https://api.github.com/repos/netty/netty/issues/4567","number":4567,"state":"open","locked":false,"title":"Introduce HostsFileNameResolver, close #4074","user":{"login":"slandelle","id":849197,"avatar_url":"https://avatars.githubusercontent.com/u/849197?v=3","gravatar_id":"","url":"https://api.github.com/users/slandelle","html_url":"https://github.com/slandelle","followers_url":"https://api.github.com/users/slandelle/followers","following_url":"https://api.github.com/users/slandelle/following{/other_user}","gists_url":"https://api.github.com/users/slandelle/gists{/gist_id}","starred_url":"https://api.github.com/users/slandelle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slandelle/subscriptions","organizations_url":"https://api.github.com/users/slandelle/orgs","repos_url":"https://api.github.com/users/slandelle/repos","events_url":"https://api.github.com/users/slandelle/events{/privacy}","received_events_url":"https://api.github.com/users/slandelle/received_events","type":"User","site_admin":false},"body":"Motivation:\r\n\r\n`DefaultNameResolver` wraps JDK's `InetAddress.getByName` and natively honors hosts file.\r\nBut when switching to `DnsNameResolver`, there's currently no way to honor it.\r\n\r\nModifications:\r\n\r\n* Introduce a `HostsFileParser` that parses `/etc/hosts` or `C:\\Windows\\system32\\drivers\\etc\\hosts` depending on the platform\r\n* Introduce a `HostsFileNameResolver` that resolves names against the hosts file\r\n* Introduce a `CompositeNameResolver` that takes several `NameResolver`s and tries to resolve names by delegating sequentially\r\n* Change `DnsNameResolver.asAddressResolver` to return a composite and honor hosts file\r\n\r\nResult:\r\n\r\nHosts file support when using `DnsNameResolver`.\r\nConsistent behavior with JDK implementation.","created_at":"2015-12-14T14:34:35Z","updated_at":"2015-12-15T20:04:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bc9e1c73e9f8887432df3a355c75677c065fa278","assignee":{"login":"normanmaurer","id":439362,"avatar_url":"https://avatars.githubusercontent.com/u/439362?v=3","gravatar_id":"","url":"https://api.github.com/users/normanmaurer","html_url":"https://github.com/normanmaurer","followers_url":"https://api.github.com/users/normanmaurer/followers","following_url":"https://api.github.com/users/normanmaurer/following{/other_user}","gists_url":"https://api.github.com/users/normanmaurer/gists{/gist_id}","starred_url":"https://api.github.com/users/normanmaurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanmaurer/subscriptions","organizations_url":"https://api.github.com/users/normanmaurer/orgs","repos_url":"https://api.github.com/users/normanmaurer/repos","events_url":"https://api.github.com/users/normanmaurer/events{/privacy}","received_events_url":"https://api.github.com/users/normanmaurer/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/netty/netty/milestones/126","html_url":"https://github.com/netty/netty/milestones/4.1.0.CR1","labels_url":"https://api.github.com/repos/netty/netty/milestones/126/labels","id":1286123,"number":126,"title":"4.1.0.CR1","description":"","creator":{"login":"normanmaurer","id":439362,"avatar_url":"https://avatars.githubusercontent.com/u/439362?v=3","gravatar_id":"","url":"https://api.github.com/users/normanmaurer","html_url":"https://github.com/normanmaurer","followers_url":"https://api.github.com/users/normanmaurer/followers","following_url":"https://api.github.com/users/normanmaurer/following{/other_user}","gists_url":"https://api.github.com/users/normanmaurer/gists{/gist_id}","starred_url":"https://api.github.com/users/normanmaurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanmaurer/subscriptions","organizations_url":"https://api.github.com/users/normanmaurer/orgs","repos_url":"https://api.github.com/users/normanmaurer/repos","events_url":"https://api.github.com/users/normanmaurer/events{/privacy}","received_events_url":"https://api.github.com/users/normanmaurer/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":29,"state":"open","created_at":"2015-09-02T12:42:53Z","updated_at":"2015-12-15T08:50:10Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/netty/netty/pulls/4567/commits","review_comments_url":"https://api.github.com/repos/netty/netty/pulls/4567/comments","review_comment_url":"https://api.github.com/repos/netty/netty/pulls/comments{/number}","comments_url":"https://api.github.com/repos/netty/netty/issues/4567/comments","statuses_url":"https://api.github.com/repos/netty/netty/statuses/9d0d85521187a49fabbff342457c2338d7deee67","head":{"label":"slandelle:hosts-file-name-resolver","ref":"hosts-file-name-resolver","sha":"9d0d85521187a49fabbff342457c2338d7deee67","user":{"login":"slandelle","id":849197,"avatar_url":"https://avatars.githubusercontent.com/u/849197?v=3","gravatar_id":"","url":"https://api.github.com/users/slandelle","html_url":"https://github.com/slandelle","followers_url":"https://api.github.com/users/slandelle/followers","following_url":"https://api.github.com/users/slandelle/following{/other_user}","gists_url":"https://api.github.com/users/slandelle/gists{/gist_id}","starred_url":"https://api.github.com/users/slandelle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slandelle/subscriptions","organizations_url":"https://api.github.com/users/slandelle/orgs","repos_url":"https://api.github.com/users/slandelle/repos","events_url":"https://api.github.com/users/slandelle/events{/privacy}","received_events_url":"https://api.github.com/users/slandelle/received_events","type":"User","site_admin":false},"repo":{"id":33929023,"name":"netty","full_name":"slandelle/netty","owner":{"login":"slandelle","id":849197,"avatar_url":"https://avatars.githubusercontent.com/u/849197?v=3","gravatar_id":"","url":"https://api.github.com/users/slandelle","html_url":"https://github.com/slandelle","followers_url":"https://api.github.com/users/slandelle/followers","following_url":"https://api.github.com/users/slandelle/following{/other_user}","gists_url":"https://api.github.com/users/slandelle/gists{/gist_id}","starred_url":"https://api.github.com/users/slandelle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slandelle/subscriptions","organizations_url":"https://api.github.com/users/slandelle/orgs","repos_url":"https://api.github.com/users/slandelle/repos","events_url":"https://api.github.com/users/slandelle/events{/privacy}","received_events_url":"https://api.github.com/users/slandelle/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/slandelle/netty","description":"Netty project - an event-driven asynchronous network application framework","fork":true,"url":"https://api.github.com/repos/slandelle/netty","forks_url":"https://api.github.com/repos/slandelle/netty/forks","keys_url":"https://api.github.com/repos/slandelle/netty/keys{/key_id}","collaborators_url":"https://api.github.com/repos/slandelle/netty/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/slandelle/netty/teams","hooks_url":"https://api.github.com/repos/slandelle/netty/hooks","issue_events_url":"https://api.github.com/repos/slandelle/netty/issues/events{/number}","events_url":"https://api.github.com/repos/slandelle/netty/events","assignees_url":"https://api.github.com/repos/slandelle/netty/assignees{/user}","branches_url":"https://api.github.com/repos/slandelle/netty/branches{/branch}","tags_url":"https://api.github.com/repos/slandelle/netty/tags","blobs_url":"https://api.github.com/repos/slandelle/netty/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/slandelle/netty/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/slandelle/netty/git/refs{/sha}","trees_url":"https://api.github.com/repos/slandelle/netty/git/trees{/sha}","statuses_url":"https://api.github.com/repos/slandelle/netty/statuses/{sha}","languages_url":"https://api.github.com/repos/slandelle/netty/languages","stargazers_url":"https://api.github.com/repos/slandelle/netty/stargazers","contributors_url":"https://api.github.com/repos/slandelle/netty/contributors","subscribers_url":"https://api.github.com/repos/slandelle/netty/subscribers","subscription_url":"https://api.github.com/repos/slandelle/netty/subscription","commits_url":"https://api.github.com/repos/slandelle/netty/commits{/sha}","git_commits_url":"https://api.github.com/repos/slandelle/netty/git/commits{/sha}","comments_url":"https://api.github.com/repos/slandelle/netty/comments{/number}","issue_comment_url":"https://api.github.com/repos/slandelle/netty/issues/comments{/number}","contents_url":"https://api.github.com/repos/slandelle/netty/contents/{+path}","compare_url":"https://api.github.com/repos/slandelle/netty/compare/{base}...{head}","merges_url":"https://api.github.com/repos/slandelle/netty/merges","archive_url":"https://api.github.com/repos/slandelle/netty/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/slandelle/netty/downloads","issues_url":"https://api.github.com/repos/slandelle/netty/issues{/number}","pulls_url":"https://api.github.com/repos/slandelle/netty/pulls{/number}","milestones_url":"https://api.github.com/repos/slandelle/netty/milestones{/number}","notifications_url":"https://api.github.com/repos/slandelle/netty/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/slandelle/netty/labels{/name}","releases_url":"https://api.github.com/repos/slandelle/netty/releases{/id}","created_at":"2015-04-14T11:58:26Z","updated_at":"2015-04-14T11:58:34Z","pushed_at":"2015-12-15T14:37:59Z","git_url":"git://github.com/slandelle/netty.git","ssh_url":"git@github.com:slandelle/netty.git","clone_url":"https://github.com/slandelle/netty.git","svn_url":"https://github.com/slandelle/netty","homepage":"http://netty.io/","size":45047,"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":"master"}},"base":{"label":"netty:4.1","ref":"4.1","sha":"27b330d8b1094ce9875f121aef5ec525e6b35030","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}","created_at":"2010-11-09T09:22:21Z","updated_at":"2015-12-15T16:38:06Z","pushed_at":"2015-12-15T15:08:24Z","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":57832,"stargazers_count":5770,"watchers_count":5770,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2925,"mirror_url":null,"open_issues_count":343,"forks":2925,"open_issues":343,"watchers":5770,"default_branch":"4.1"}},"_links":{"self":{"href":"https://api.github.com/repos/netty/netty/pulls/4567"},"html":{"href":"https://github.com/netty/netty/pull/4567"},"issue":{"href":"https://api.github.com/repos/netty/netty/issues/4567"},"comments":{"href":"https://api.github.com/repos/netty/netty/issues/4567/comments"},"review_comments":{"href":"https://api.github.com/repos/netty/netty/pulls/4567/comments"},"review_comment":{"href":"https://api.github.com/repos/netty/netty/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/netty/netty/pulls/4567/commits"},"statuses":{"href":"https://api.github.com/repos/netty/netty/statuses/9d0d85521187a49fabbff342457c2338d7deee67"}}}}