{"action":"created","comment":{"url":"https://api.github.com/repos/allegro/hermes/pulls/comments/34443262","id":34443262,"diff_hunk":"@@ -44,9 +55,16 @@ private boolean validateWithTemplate(String address, ConstraintValidatorContext\n         return true;\n     }\n \n-    protected void createConstraintMessage(ConstraintValidatorContext context, String message) {\n+    private void createConstraintMessage(ConstraintValidatorContext context, String message) {\n         context.buildConstraintViolationWithTemplate(message)\n                 .addConstraintViolation()\n                 .disableDefaultConstraintViolation();\n     }\n+\n+    private boolean isInvalidHost(UriTemplate template) {\n+        Map<String, Object> uriKeysWithEmptyValues = Arrays.asList(template.getVariables()).stream().collect(toMap(v -> v, v -> \"empty\"));\n+\n+        //check if host is null due to bug in jdk http://bugs.java.com/view_bug.do?bug_id=5083594\n+        return URI.create(template.expand(uriKeysWithEmptyValues)).getHost() == null;","path":"hermes-api/src/main/java/pl/allegro/tech/hermes/api/constraints/EndpointAddressValidator.java","position":52,"original_position":52,"commit_id":"2546109e6fc2cfe7b9f15dec875ef74a7da68bc0","original_commit_id":"2546109e6fc2cfe7b9f15dec875ef74a7da68bc0","user":{"login":"pjagielski","id":513361,"avatar_url":"https://avatars.githubusercontent.com/u/513361?v=3","gravatar_id":"","url":"https://api.github.com/users/pjagielski","html_url":"https://github.com/pjagielski","followers_url":"https://api.github.com/users/pjagielski/followers","following_url":"https://api.github.com/users/pjagielski/following{/other_user}","gists_url":"https://api.github.com/users/pjagielski/gists{/gist_id}","starred_url":"https://api.github.com/users/pjagielski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjagielski/subscriptions","organizations_url":"https://api.github.com/users/pjagielski/orgs","repos_url":"https://api.github.com/users/pjagielski/repos","events_url":"https://api.github.com/users/pjagielski/events{/privacy}","received_events_url":"https://api.github.com/users/pjagielski/received_events","type":"User","site_admin":false},"body":"I think it's not a good solution to propagate this JDK behaviour into our code. If it doesn't work we should use something different to validate the uri.","created_at":"2015-07-13T08:46:36Z","updated_at":"2015-07-13T08:46:36Z","html_url":"https://github.com/allegro/hermes/pull/124#discussion_r34443262","pull_request_url":"https://api.github.com/repos/allegro/hermes/pulls/124","_links":{"self":{"href":"https://api.github.com/repos/allegro/hermes/pulls/comments/34443262"},"html":{"href":"https://github.com/allegro/hermes/pull/124#discussion_r34443262"},"pull_request":{"href":"https://api.github.com/repos/allegro/hermes/pulls/124"}}},"pull_request":{"url":"https://api.github.com/repos/allegro/hermes/pulls/124","id":39685550,"html_url":"https://github.com/allegro/hermes/pull/124","diff_url":"https://github.com/allegro/hermes/pull/124.diff","patch_url":"https://github.com/allegro/hermes/pull/124.patch","issue_url":"https://api.github.com/repos/allegro/hermes/issues/124","number":124,"state":"open","locked":false,"title":"Handling invalid host name instead of throwing NPE #123","user":{"login":"druminski","id":4473056,"avatar_url":"https://avatars.githubusercontent.com/u/4473056?v=3","gravatar_id":"","url":"https://api.github.com/users/druminski","html_url":"https://github.com/druminski","followers_url":"https://api.github.com/users/druminski/followers","following_url":"https://api.github.com/users/druminski/following{/other_user}","gists_url":"https://api.github.com/users/druminski/gists{/gist_id}","starred_url":"https://api.github.com/users/druminski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/druminski/subscriptions","organizations_url":"https://api.github.com/users/druminski/orgs","repos_url":"https://api.github.com/users/druminski/repos","events_url":"https://api.github.com/users/druminski/events{/privacy}","received_events_url":"https://api.github.com/users/druminski/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-10T13:51:59Z","updated_at":"2015-07-13T08:46:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"65d1eb46df167f3c5a7c8c7e124ce58e725cd43d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/allegro/hermes/pulls/124/commits","review_comments_url":"https://api.github.com/repos/allegro/hermes/pulls/124/comments","review_comment_url":"https://api.github.com/repos/allegro/hermes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/allegro/hermes/issues/124/comments","statuses_url":"https://api.github.com/repos/allegro/hermes/statuses/2546109e6fc2cfe7b9f15dec875ef74a7da68bc0","head":{"label":"allegro:123_invalid_host_name","ref":"123_invalid_host_name","sha":"2546109e6fc2cfe7b9f15dec875ef74a7da68bc0","user":{"login":"allegro","id":562236,"avatar_url":"https://avatars.githubusercontent.com/u/562236?v=3","gravatar_id":"","url":"https://api.github.com/users/allegro","html_url":"https://github.com/allegro","followers_url":"https://api.github.com/users/allegro/followers","following_url":"https://api.github.com/users/allegro/following{/other_user}","gists_url":"https://api.github.com/users/allegro/gists{/gist_id}","starred_url":"https://api.github.com/users/allegro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allegro/subscriptions","organizations_url":"https://api.github.com/users/allegro/orgs","repos_url":"https://api.github.com/users/allegro/repos","events_url":"https://api.github.com/users/allegro/events{/privacy}","received_events_url":"https://api.github.com/users/allegro/received_events","type":"Organization","site_admin":false},"repo":{"id":35662043,"name":"hermes","full_name":"allegro/hermes","owner":{"login":"allegro","id":562236,"avatar_url":"https://avatars.githubusercontent.com/u/562236?v=3","gravatar_id":"","url":"https://api.github.com/users/allegro","html_url":"https://github.com/allegro","followers_url":"https://api.github.com/users/allegro/followers","following_url":"https://api.github.com/users/allegro/following{/other_user}","gists_url":"https://api.github.com/users/allegro/gists{/gist_id}","starred_url":"https://api.github.com/users/allegro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allegro/subscriptions","organizations_url":"https://api.github.com/users/allegro/orgs","repos_url":"https://api.github.com/users/allegro/repos","events_url":"https://api.github.com/users/allegro/events{/privacy}","received_events_url":"https://api.github.com/users/allegro/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/allegro/hermes","description":"Fast and reliable message broker built on top of Kafka.","fork":false,"url":"https://api.github.com/repos/allegro/hermes","forks_url":"https://api.github.com/repos/allegro/hermes/forks","keys_url":"https://api.github.com/repos/allegro/hermes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/allegro/hermes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/allegro/hermes/teams","hooks_url":"https://api.github.com/repos/allegro/hermes/hooks","issue_events_url":"https://api.github.com/repos/allegro/hermes/issues/events{/number}","events_url":"https://api.github.com/repos/allegro/hermes/events","assignees_url":"https://api.github.com/repos/allegro/hermes/assignees{/user}","branches_url":"https://api.github.com/repos/allegro/hermes/branches{/branch}","tags_url":"https://api.github.com/repos/allegro/hermes/tags","blobs_url":"https://api.github.com/repos/allegro/hermes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/allegro/hermes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/allegro/hermes/git/refs{/sha}","trees_url":"https://api.github.com/repos/allegro/hermes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/allegro/hermes/statuses/{sha}","languages_url":"https://api.github.com/repos/allegro/hermes/languages","stargazers_url":"https://api.github.com/repos/allegro/hermes/stargazers","contributors_url":"https://api.github.com/repos/allegro/hermes/contributors","subscribers_url":"https://api.github.com/repos/allegro/hermes/subscribers","subscription_url":"https://api.github.com/repos/allegro/hermes/subscription","commits_url":"https://api.github.com/repos/allegro/hermes/commits{/sha}","git_commits_url":"https://api.github.com/repos/allegro/hermes/git/commits{/sha}","comments_url":"https://api.github.com/repos/allegro/hermes/comments{/number}","issue_comment_url":"https://api.github.com/repos/allegro/hermes/issues/comments{/number}","contents_url":"https://api.github.com/repos/allegro/hermes/contents/{+path}","compare_url":"https://api.github.com/repos/allegro/hermes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/allegro/hermes/merges","archive_url":"https://api.github.com/repos/allegro/hermes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/allegro/hermes/downloads","issues_url":"https://api.github.com/repos/allegro/hermes/issues{/number}","pulls_url":"https://api.github.com/repos/allegro/hermes/pulls{/number}","milestones_url":"https://api.github.com/repos/allegro/hermes/milestones{/number}","notifications_url":"https://api.github.com/repos/allegro/hermes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/allegro/hermes/labels{/name}","releases_url":"https://api.github.com/repos/allegro/hermes/releases{/id}","created_at":"2015-05-15T08:11:16Z","updated_at":"2015-07-10T17:21:46Z","pushed_at":"2015-07-13T08:29:49Z","git_url":"git://github.com/allegro/hermes.git","ssh_url":"git@github.com:allegro/hermes.git","clone_url":"https://github.com/allegro/hermes.git","svn_url":"https://github.com/allegro/hermes","homepage":"http://hermes.allegrotech.io","size":2394,"stargazers_count":112,"watchers_count":112,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":10,"forks":10,"open_issues":10,"watchers":112,"default_branch":"master"}},"base":{"label":"allegro:develop","ref":"develop","sha":"756bbe5dc65734845c1a7a74a21561dfc8baa757","user":{"login":"allegro","id":562236,"avatar_url":"https://avatars.githubusercontent.com/u/562236?v=3","gravatar_id":"","url":"https://api.github.com/users/allegro","html_url":"https://github.com/allegro","followers_url":"https://api.github.com/users/allegro/followers","following_url":"https://api.github.com/users/allegro/following{/other_user}","gists_url":"https://api.github.com/users/allegro/gists{/gist_id}","starred_url":"https://api.github.com/users/allegro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allegro/subscriptions","organizations_url":"https://api.github.com/users/allegro/orgs","repos_url":"https://api.github.com/users/allegro/repos","events_url":"https://api.github.com/users/allegro/events{/privacy}","received_events_url":"https://api.github.com/users/allegro/received_events","type":"Organization","site_admin":false},"repo":{"id":35662043,"name":"hermes","full_name":"allegro/hermes","owner":{"login":"allegro","id":562236,"avatar_url":"https://avatars.githubusercontent.com/u/562236?v=3","gravatar_id":"","url":"https://api.github.com/users/allegro","html_url":"https://github.com/allegro","followers_url":"https://api.github.com/users/allegro/followers","following_url":"https://api.github.com/users/allegro/following{/other_user}","gists_url":"https://api.github.com/users/allegro/gists{/gist_id}","starred_url":"https://api.github.com/users/allegro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allegro/subscriptions","organizations_url":"https://api.github.com/users/allegro/orgs","repos_url":"https://api.github.com/users/allegro/repos","events_url":"https://api.github.com/users/allegro/events{/privacy}","received_events_url":"https://api.github.com/users/allegro/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/allegro/hermes","description":"Fast and reliable message broker built on top of Kafka.","fork":false,"url":"https://api.github.com/repos/allegro/hermes","forks_url":"https://api.github.com/repos/allegro/hermes/forks","keys_url":"https://api.github.com/repos/allegro/hermes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/allegro/hermes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/allegro/hermes/teams","hooks_url":"https://api.github.com/repos/allegro/hermes/hooks","issue_events_url":"https://api.github.com/repos/allegro/hermes/issues/events{/number}","events_url":"https://api.github.com/repos/allegro/hermes/events","assignees_url":"https://api.github.com/repos/allegro/hermes/assignees{/user}","branches_url":"https://api.github.com/repos/allegro/hermes/branches{/branch}","tags_url":"https://api.github.com/repos/allegro/hermes/tags","blobs_url":"https://api.github.com/repos/allegro/hermes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/allegro/hermes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/allegro/hermes/git/refs{/sha}","trees_url":"https://api.github.com/repos/allegro/hermes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/allegro/hermes/statuses/{sha}","languages_url":"https://api.github.com/repos/allegro/hermes/languages","stargazers_url":"https://api.github.com/repos/allegro/hermes/stargazers","contributors_url":"https://api.github.com/repos/allegro/hermes/contributors","subscribers_url":"https://api.github.com/repos/allegro/hermes/subscribers","subscription_url":"https://api.github.com/repos/allegro/hermes/subscription","commits_url":"https://api.github.com/repos/allegro/hermes/commits{/sha}","git_commits_url":"https://api.github.com/repos/allegro/hermes/git/commits{/sha}","comments_url":"https://api.github.com/repos/allegro/hermes/comments{/number}","issue_comment_url":"https://api.github.com/repos/allegro/hermes/issues/comments{/number}","contents_url":"https://api.github.com/repos/allegro/hermes/contents/{+path}","compare_url":"https://api.github.com/repos/allegro/hermes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/allegro/hermes/merges","archive_url":"https://api.github.com/repos/allegro/hermes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/allegro/hermes/downloads","issues_url":"https://api.github.com/repos/allegro/hermes/issues{/number}","pulls_url":"https://api.github.com/repos/allegro/hermes/pulls{/number}","milestones_url":"https://api.github.com/repos/allegro/hermes/milestones{/number}","notifications_url":"https://api.github.com/repos/allegro/hermes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/allegro/hermes/labels{/name}","releases_url":"https://api.github.com/repos/allegro/hermes/releases{/id}","created_at":"2015-05-15T08:11:16Z","updated_at":"2015-07-10T17:21:46Z","pushed_at":"2015-07-13T08:29:49Z","git_url":"git://github.com/allegro/hermes.git","ssh_url":"git@github.com:allegro/hermes.git","clone_url":"https://github.com/allegro/hermes.git","svn_url":"https://github.com/allegro/hermes","homepage":"http://hermes.allegrotech.io","size":2394,"stargazers_count":112,"watchers_count":112,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":10,"forks":10,"open_issues":10,"watchers":112,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/allegro/hermes/pulls/124"},"html":{"href":"https://github.com/allegro/hermes/pull/124"},"issue":{"href":"https://api.github.com/repos/allegro/hermes/issues/124"},"comments":{"href":"https://api.github.com/repos/allegro/hermes/issues/124/comments"},"review_comments":{"href":"https://api.github.com/repos/allegro/hermes/pulls/124/comments"},"review_comment":{"href":"https://api.github.com/repos/allegro/hermes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/allegro/hermes/pulls/124/commits"},"statuses":{"href":"https://api.github.com/repos/allegro/hermes/statuses/2546109e6fc2cfe7b9f15dec875ef74a7da68bc0"}}}}