{"action":"created","comment":{"url":"https://api.github.com/repos/dropwizard/metrics/pulls/comments/185733050","pull_request_review_id":117180059,"id":185733050,"diff_hunk":"@@ -13,10 +15,35 @@\n     @Override\n     public ObjectName createName(String type, String domain, String name) {\n         try {\n-            ObjectName objectName = new ObjectName(domain, \"name\", name);\n-            if (objectName.isPattern()) {\n-                objectName = new ObjectName(domain, \"name\", ObjectName.quote(name));\n+            ObjectName objectName;\n+            Hashtable<String, String> properties = new Hashtable<>();\n+\n+            properties.put(\"name\", name);\n+            properties.put(\"type\", type);\n+            objectName = new ObjectName(domain, properties);\n+\n+            /*\n+             * The only way we can find out if we need to quote the properties is by\n+             * checking an ObjectName that we've constructed.\n+             */\n+            boolean retry = false;\n+            if (objectName.isDomainPattern()) {\n+                domain = ObjectName.quote(domain);\n+                retry = true;\n+            }\n+            if (objectName.isPropertyValuePattern(\"name\")) {\n+                properties.put(\"name\", ObjectName.quote(name));\n+                retry = true;\n             }\n+            if (objectName.isPropertyValuePattern(\"type\")) {\n+                properties.put(\"type\", ObjectName.quote(type));\n+                retry = true;","path":"metrics-jmx/src/main/java/com/codahale/metrics/jmx/DefaultObjectNameFactory.java","position":37,"original_position":37,"commit_id":"1116eaa2dc483075d2374c9b91eddddd4f8393ae","original_commit_id":"1116eaa2dc483075d2374c9b91eddddd4f8393ae","user":{"login":"michaelpj","id":1699466,"avatar_url":"https://avatars2.githubusercontent.com/u/1699466?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelpj","html_url":"https://github.com/michaelpj","followers_url":"https://api.github.com/users/michaelpj/followers","following_url":"https://api.github.com/users/michaelpj/following{/other_user}","gists_url":"https://api.github.com/users/michaelpj/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelpj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelpj/subscriptions","organizations_url":"https://api.github.com/users/michaelpj/orgs","repos_url":"https://api.github.com/users/michaelpj/repos","events_url":"https://api.github.com/users/michaelpj/events{/privacy}","received_events_url":"https://api.github.com/users/michaelpj/received_events","type":"User","site_admin":false},"body":"Sure.","created_at":"2018-05-03T08:55:50Z","updated_at":"2018-05-03T08:55:50Z","html_url":"https://github.com/dropwizard/metrics/pull/1310#discussion_r185733050","pull_request_url":"https://api.github.com/repos/dropwizard/metrics/pulls/1310","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dropwizard/metrics/pulls/comments/185733050"},"html":{"href":"https://github.com/dropwizard/metrics/pull/1310#discussion_r185733050"},"pull_request":{"href":"https://api.github.com/repos/dropwizard/metrics/pulls/1310"}},"in_reply_to_id":185627351},"pull_request":{"url":"https://api.github.com/repos/dropwizard/metrics/pulls/1310","id":185481849,"html_url":"https://github.com/dropwizard/metrics/pull/1310","diff_url":"https://github.com/dropwizard/metrics/pull/1310.diff","patch_url":"https://github.com/dropwizard/metrics/pull/1310.patch","issue_url":"https://api.github.com/repos/dropwizard/metrics/issues/1310","number":1310,"state":"open","locked":false,"title":"DefaultObjectNameFactory: use type, be a bit more conservative about quoting","user":{"login":"michaelpj","id":1699466,"avatar_url":"https://avatars2.githubusercontent.com/u/1699466?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelpj","html_url":"https://github.com/michaelpj","followers_url":"https://api.github.com/users/michaelpj/followers","following_url":"https://api.github.com/users/michaelpj/following{/other_user}","gists_url":"https://api.github.com/users/michaelpj/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelpj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelpj/subscriptions","organizations_url":"https://api.github.com/users/michaelpj/orgs","repos_url":"https://api.github.com/users/michaelpj/repos","events_url":"https://api.github.com/users/michaelpj/events{/privacy}","received_events_url":"https://api.github.com/users/michaelpj/received_events","type":"User","site_admin":false},"body":"This makes `DefaultObjectNameFactory` a little cleverer. In particular, it uses the `type` argument as the `type` property of the `ObjectName`. This is used by tools like `visualvm` to give another layer of grouping, which is quite helpful.\r\n\r\nIn addition, we can be a little more conservative about which part of the name we need to quote if we need to quote something.","created_at":"2018-05-02T15:48:27Z","updated_at":"2018-05-03T08:55:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c3f1e7271107d4a34d636f93d3a37207b79152e8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":656368,"url":"https://api.github.com/repos/dropwizard/metrics/labels/improvement","name":"improvement","color":"0b02e1","default":false}],"milestone":{"url":"https://api.github.com/repos/dropwizard/metrics/milestones/25","html_url":"https://github.com/dropwizard/metrics/milestone/25","labels_url":"https://api.github.com/repos/dropwizard/metrics/milestones/25/labels","id":3015395,"number":25,"title":"4.1.0","description":"","creator":{"login":"jplock","id":49093,"avatar_url":"https://avatars1.githubusercontent.com/u/49093?v=4","gravatar_id":"","url":"https://api.github.com/users/jplock","html_url":"https://github.com/jplock","followers_url":"https://api.github.com/users/jplock/followers","following_url":"https://api.github.com/users/jplock/following{/other_user}","gists_url":"https://api.github.com/users/jplock/gists{/gist_id}","starred_url":"https://api.github.com/users/jplock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jplock/subscriptions","organizations_url":"https://api.github.com/users/jplock/orgs","repos_url":"https://api.github.com/users/jplock/repos","events_url":"https://api.github.com/users/jplock/events{/privacy}","received_events_url":"https://api.github.com/users/jplock/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":12,"state":"open","created_at":"2018-01-05T15:35:12Z","updated_at":"2018-05-02T20:32:34Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/dropwizard/metrics/pulls/1310/commits","review_comments_url":"https://api.github.com/repos/dropwizard/metrics/pulls/1310/comments","review_comment_url":"https://api.github.com/repos/dropwizard/metrics/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dropwizard/metrics/issues/1310/comments","statuses_url":"https://api.github.com/repos/dropwizard/metrics/statuses/1116eaa2dc483075d2374c9b91eddddd4f8393ae","head":{"label":"michaelpj:default-object-name","ref":"default-object-name","sha":"1116eaa2dc483075d2374c9b91eddddd4f8393ae","user":{"login":"michaelpj","id":1699466,"avatar_url":"https://avatars2.githubusercontent.com/u/1699466?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelpj","html_url":"https://github.com/michaelpj","followers_url":"https://api.github.com/users/michaelpj/followers","following_url":"https://api.github.com/users/michaelpj/following{/other_user}","gists_url":"https://api.github.com/users/michaelpj/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelpj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelpj/subscriptions","organizations_url":"https://api.github.com/users/michaelpj/orgs","repos_url":"https://api.github.com/users/michaelpj/repos","events_url":"https://api.github.com/users/michaelpj/events{/privacy}","received_events_url":"https://api.github.com/users/michaelpj/received_events","type":"User","site_admin":false},"repo":{"id":129912289,"name":"metrics","full_name":"michaelpj/metrics","owner":{"login":"michaelpj","id":1699466,"avatar_url":"https://avatars2.githubusercontent.com/u/1699466?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelpj","html_url":"https://github.com/michaelpj","followers_url":"https://api.github.com/users/michaelpj/followers","following_url":"https://api.github.com/users/michaelpj/following{/other_user}","gists_url":"https://api.github.com/users/michaelpj/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelpj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelpj/subscriptions","organizations_url":"https://api.github.com/users/michaelpj/orgs","repos_url":"https://api.github.com/users/michaelpj/repos","events_url":"https://api.github.com/users/michaelpj/events{/privacy}","received_events_url":"https://api.github.com/users/michaelpj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/michaelpj/metrics","description":":chart_with_upwards_trend: Capturing JVM- and application-level metrics. So you know what's going on.","fork":true,"url":"https://api.github.com/repos/michaelpj/metrics","forks_url":"https://api.github.com/repos/michaelpj/metrics/forks","keys_url":"https://api.github.com/repos/michaelpj/metrics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/michaelpj/metrics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/michaelpj/metrics/teams","hooks_url":"https://api.github.com/repos/michaelpj/metrics/hooks","issue_events_url":"https://api.github.com/repos/michaelpj/metrics/issues/events{/number}","events_url":"https://api.github.com/repos/michaelpj/metrics/events","assignees_url":"https://api.github.com/repos/michaelpj/metrics/assignees{/user}","branches_url":"https://api.github.com/repos/michaelpj/metrics/branches{/branch}","tags_url":"https://api.github.com/repos/michaelpj/metrics/tags","blobs_url":"https://api.github.com/repos/michaelpj/metrics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/michaelpj/metrics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/michaelpj/metrics/git/refs{/sha}","trees_url":"https://api.github.com/repos/michaelpj/metrics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/michaelpj/metrics/statuses/{sha}","languages_url":"https://api.github.com/repos/michaelpj/metrics/languages","stargazers_url":"https://api.github.com/repos/michaelpj/metrics/stargazers","contributors_url":"https://api.github.com/repos/michaelpj/metrics/contributors","subscribers_url":"https://api.github.com/repos/michaelpj/metrics/subscribers","subscription_url":"https://api.github.com/repos/michaelpj/metrics/subscription","commits_url":"https://api.github.com/repos/michaelpj/metrics/commits{/sha}","git_commits_url":"https://api.github.com/repos/michaelpj/metrics/git/commits{/sha}","comments_url":"https://api.github.com/repos/michaelpj/metrics/comments{/number}","issue_comment_url":"https://api.github.com/repos/michaelpj/metrics/issues/comments{/number}","contents_url":"https://api.github.com/repos/michaelpj/metrics/contents/{+path}","compare_url":"https://api.github.com/repos/michaelpj/metrics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/michaelpj/metrics/merges","archive_url":"https://api.github.com/repos/michaelpj/metrics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/michaelpj/metrics/downloads","issues_url":"https://api.github.com/repos/michaelpj/metrics/issues{/number}","pulls_url":"https://api.github.com/repos/michaelpj/metrics/pulls{/number}","milestones_url":"https://api.github.com/repos/michaelpj/metrics/milestones{/number}","notifications_url":"https://api.github.com/repos/michaelpj/metrics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/michaelpj/metrics/labels{/name}","releases_url":"https://api.github.com/repos/michaelpj/metrics/releases{/id}","deployments_url":"https://api.github.com/repos/michaelpj/metrics/deployments","created_at":"2018-04-17T13:53:42Z","updated_at":"2018-04-17T13:53:44Z","pushed_at":"2018-05-02T15:48:22Z","git_url":"git://github.com/michaelpj/metrics.git","ssh_url":"git@github.com:michaelpj/metrics.git","clone_url":"https://github.com/michaelpj/metrics.git","svn_url":"https://github.com/michaelpj/metrics","homepage":"http://metrics.dropwizard.io","size":8491,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"4.1-development"}},"base":{"label":"dropwizard:4.1-development","ref":"4.1-development","sha":"43da91ed96dcfa4f27032487b617f8fef12f28eb","user":{"login":"dropwizard","id":5478557,"avatar_url":"https://avatars3.githubusercontent.com/u/5478557?v=4","gravatar_id":"","url":"https://api.github.com/users/dropwizard","html_url":"https://github.com/dropwizard","followers_url":"https://api.github.com/users/dropwizard/followers","following_url":"https://api.github.com/users/dropwizard/following{/other_user}","gists_url":"https://api.github.com/users/dropwizard/gists{/gist_id}","starred_url":"https://api.github.com/users/dropwizard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dropwizard/subscriptions","organizations_url":"https://api.github.com/users/dropwizard/orgs","repos_url":"https://api.github.com/users/dropwizard/repos","events_url":"https://api.github.com/users/dropwizard/events{/privacy}","received_events_url":"https://api.github.com/users/dropwizard/received_events","type":"Organization","site_admin":false},"repo":{"id":537800,"name":"metrics","full_name":"dropwizard/metrics","owner":{"login":"dropwizard","id":5478557,"avatar_url":"https://avatars3.githubusercontent.com/u/5478557?v=4","gravatar_id":"","url":"https://api.github.com/users/dropwizard","html_url":"https://github.com/dropwizard","followers_url":"https://api.github.com/users/dropwizard/followers","following_url":"https://api.github.com/users/dropwizard/following{/other_user}","gists_url":"https://api.github.com/users/dropwizard/gists{/gist_id}","starred_url":"https://api.github.com/users/dropwizard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dropwizard/subscriptions","organizations_url":"https://api.github.com/users/dropwizard/orgs","repos_url":"https://api.github.com/users/dropwizard/repos","events_url":"https://api.github.com/users/dropwizard/events{/privacy}","received_events_url":"https://api.github.com/users/dropwizard/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dropwizard/metrics","description":":chart_with_upwards_trend: Capturing JVM- and application-level metrics. So you know what's going on.","fork":false,"url":"https://api.github.com/repos/dropwizard/metrics","forks_url":"https://api.github.com/repos/dropwizard/metrics/forks","keys_url":"https://api.github.com/repos/dropwizard/metrics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dropwizard/metrics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dropwizard/metrics/teams","hooks_url":"https://api.github.com/repos/dropwizard/metrics/hooks","issue_events_url":"https://api.github.com/repos/dropwizard/metrics/issues/events{/number}","events_url":"https://api.github.com/repos/dropwizard/metrics/events","assignees_url":"https://api.github.com/repos/dropwizard/metrics/assignees{/user}","branches_url":"https://api.github.com/repos/dropwizard/metrics/branches{/branch}","tags_url":"https://api.github.com/repos/dropwizard/metrics/tags","blobs_url":"https://api.github.com/repos/dropwizard/metrics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dropwizard/metrics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dropwizard/metrics/git/refs{/sha}","trees_url":"https://api.github.com/repos/dropwizard/metrics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dropwizard/metrics/statuses/{sha}","languages_url":"https://api.github.com/repos/dropwizard/metrics/languages","stargazers_url":"https://api.github.com/repos/dropwizard/metrics/stargazers","contributors_url":"https://api.github.com/repos/dropwizard/metrics/contributors","subscribers_url":"https://api.github.com/repos/dropwizard/metrics/subscribers","subscription_url":"https://api.github.com/repos/dropwizard/metrics/subscription","commits_url":"https://api.github.com/repos/dropwizard/metrics/commits{/sha}","git_commits_url":"https://api.github.com/repos/dropwizard/metrics/git/commits{/sha}","comments_url":"https://api.github.com/repos/dropwizard/metrics/comments{/number}","issue_comment_url":"https://api.github.com/repos/dropwizard/metrics/issues/comments{/number}","contents_url":"https://api.github.com/repos/dropwizard/metrics/contents/{+path}","compare_url":"https://api.github.com/repos/dropwizard/metrics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dropwizard/metrics/merges","archive_url":"https://api.github.com/repos/dropwizard/metrics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dropwizard/metrics/downloads","issues_url":"https://api.github.com/repos/dropwizard/metrics/issues{/number}","pulls_url":"https://api.github.com/repos/dropwizard/metrics/pulls{/number}","milestones_url":"https://api.github.com/repos/dropwizard/metrics/milestones{/number}","notifications_url":"https://api.github.com/repos/dropwizard/metrics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dropwizard/metrics/labels{/name}","releases_url":"https://api.github.com/repos/dropwizard/metrics/releases{/id}","deployments_url":"https://api.github.com/repos/dropwizard/metrics/deployments","created_at":"2010-02-26T19:44:42Z","updated_at":"2018-05-03T03:03:43Z","pushed_at":"2018-05-02T21:25:22Z","git_url":"git://github.com/dropwizard/metrics.git","ssh_url":"git@github.com:dropwizard/metrics.git","clone_url":"https://github.com/dropwizard/metrics.git","svn_url":"https://github.com/dropwizard/metrics","homepage":"http://metrics.dropwizard.io","size":8510,"stargazers_count":5704,"watchers_count":5704,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":1491,"mirror_url":null,"archived":false,"open_issues_count":129,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":1491,"open_issues":129,"watchers":5704,"default_branch":"4.1-development"}},"_links":{"self":{"href":"https://api.github.com/repos/dropwizard/metrics/pulls/1310"},"html":{"href":"https://github.com/dropwizard/metrics/pull/1310"},"issue":{"href":"https://api.github.com/repos/dropwizard/metrics/issues/1310"},"comments":{"href":"https://api.github.com/repos/dropwizard/metrics/issues/1310/comments"},"review_comments":{"href":"https://api.github.com/repos/dropwizard/metrics/pulls/1310/comments"},"review_comment":{"href":"https://api.github.com/repos/dropwizard/metrics/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dropwizard/metrics/pulls/1310/commits"},"statuses":{"href":"https://api.github.com/repos/dropwizard/metrics/statuses/1116eaa2dc483075d2374c9b91eddddd4f8393ae"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"michaelpj"}}