{"action":"created","comment":{"url":"https://api.github.com/repos/metamx/java-util/pulls/comments/53191626","id":53191626,"diff_hunk":"@@ -66,4 +67,21 @@ public static String fromUtf8(final ByteBuffer buffer)\n       throw Throwables.propagate(e);\n     }\n   }\n+\n+  public static String safeFormat(String message, Object... formatArgs)\n+  {\n+    if(formatArgs == null || formatArgs.length == 0) {\n+      return message;\n+    }\n+    try {\n+      return String.format(message, formatArgs);","path":"src/main/java/com/metamx/common/StringUtils.java","position":19,"original_position":19,"commit_id":"6d2735e7ea7bb63027a4a0d6dbff9a251722f711","original_commit_id":"6d2735e7ea7bb63027a4a0d6dbff9a251722f711","user":{"login":"drcrallen","id":8213081,"avatar_url":"https://avatars.githubusercontent.com/u/8213081?v=3","gravatar_id":"","url":"https://api.github.com/users/drcrallen","html_url":"https://github.com/drcrallen","followers_url":"https://api.github.com/users/drcrallen/followers","following_url":"https://api.github.com/users/drcrallen/following{/other_user}","gists_url":"https://api.github.com/users/drcrallen/gists{/gist_id}","starred_url":"https://api.github.com/users/drcrallen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drcrallen/subscriptions","organizations_url":"https://api.github.com/users/drcrallen/orgs","repos_url":"https://api.github.com/users/drcrallen/repos","events_url":"https://api.github.com/users/drcrallen/events{/privacy}","received_events_url":"https://api.github.com/users/drcrallen/received_events","type":"User","site_admin":false},"body":"As you noted below, this is a direct refactor out of Logger\r\n\r\nSuggest not changing this method in this PR since it is a direct move.","created_at":"2016-02-17T16:37:09Z","updated_at":"2016-02-17T16:37:09Z","html_url":"https://github.com/metamx/java-util/pull/39#discussion_r53191626","pull_request_url":"https://api.github.com/repos/metamx/java-util/pulls/39","_links":{"self":{"href":"https://api.github.com/repos/metamx/java-util/pulls/comments/53191626"},"html":{"href":"https://github.com/metamx/java-util/pull/39#discussion_r53191626"},"pull_request":{"href":"https://api.github.com/repos/metamx/java-util/pulls/39"}}},"pull_request":{"url":"https://api.github.com/repos/metamx/java-util/pulls/39","id":59580948,"html_url":"https://github.com/metamx/java-util/pull/39","diff_url":"https://github.com/metamx/java-util/pull/39.diff","patch_url":"https://github.com/metamx/java-util/pull/39.patch","issue_url":"https://api.github.com/repos/metamx/java-util/issues/39","number":39,"state":"open","locked":false,"title":"Make the exception shortcuts use safe string formatting","user":{"login":"drcrallen","id":8213081,"avatar_url":"https://avatars.githubusercontent.com/u/8213081?v=3","gravatar_id":"","url":"https://api.github.com/users/drcrallen","html_url":"https://github.com/drcrallen","followers_url":"https://api.github.com/users/drcrallen/followers","following_url":"https://api.github.com/users/drcrallen/following{/other_user}","gists_url":"https://api.github.com/users/drcrallen/gists{/gist_id}","starred_url":"https://api.github.com/users/drcrallen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drcrallen/subscriptions","organizations_url":"https://api.github.com/users/drcrallen/orgs","repos_url":"https://api.github.com/users/drcrallen/repos","events_url":"https://api.github.com/users/drcrallen/events{/privacy}","received_events_url":"https://api.github.com/users/drcrallen/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-17T00:59:12Z","updated_at":"2016-02-17T16:37:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2725a7ef1fc6cb8c8c0316c123660daa092ede77","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/metamx/java-util/pulls/39/commits","review_comments_url":"https://api.github.com/repos/metamx/java-util/pulls/39/comments","review_comment_url":"https://api.github.com/repos/metamx/java-util/pulls/comments{/number}","comments_url":"https://api.github.com/repos/metamx/java-util/issues/39/comments","statuses_url":"https://api.github.com/repos/metamx/java-util/statuses/6d2735e7ea7bb63027a4a0d6dbff9a251722f711","head":{"label":"metamx:safeStringFormat","ref":"safeStringFormat","sha":"6d2735e7ea7bb63027a4a0d6dbff9a251722f711","user":{"login":"metamx","id":299329,"avatar_url":"https://avatars.githubusercontent.com/u/299329?v=3","gravatar_id":"","url":"https://api.github.com/users/metamx","html_url":"https://github.com/metamx","followers_url":"https://api.github.com/users/metamx/followers","following_url":"https://api.github.com/users/metamx/following{/other_user}","gists_url":"https://api.github.com/users/metamx/gists{/gist_id}","starred_url":"https://api.github.com/users/metamx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metamx/subscriptions","organizations_url":"https://api.github.com/users/metamx/orgs","repos_url":"https://api.github.com/users/metamx/repos","events_url":"https://api.github.com/users/metamx/events{/privacy}","received_events_url":"https://api.github.com/users/metamx/received_events","type":"Organization","site_admin":false},"repo":{"id":2622329,"name":"java-util","full_name":"metamx/java-util","owner":{"login":"metamx","id":299329,"avatar_url":"https://avatars.githubusercontent.com/u/299329?v=3","gravatar_id":"","url":"https://api.github.com/users/metamx","html_url":"https://github.com/metamx","followers_url":"https://api.github.com/users/metamx/followers","following_url":"https://api.github.com/users/metamx/following{/other_user}","gists_url":"https://api.github.com/users/metamx/gists{/gist_id}","starred_url":"https://api.github.com/users/metamx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metamx/subscriptions","organizations_url":"https://api.github.com/users/metamx/orgs","repos_url":"https://api.github.com/users/metamx/repos","events_url":"https://api.github.com/users/metamx/events{/privacy}","received_events_url":"https://api.github.com/users/metamx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/metamx/java-util","description":"Utility code for java and jvm-based languages","fork":false,"url":"https://api.github.com/repos/metamx/java-util","forks_url":"https://api.github.com/repos/metamx/java-util/forks","keys_url":"https://api.github.com/repos/metamx/java-util/keys{/key_id}","collaborators_url":"https://api.github.com/repos/metamx/java-util/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/metamx/java-util/teams","hooks_url":"https://api.github.com/repos/metamx/java-util/hooks","issue_events_url":"https://api.github.com/repos/metamx/java-util/issues/events{/number}","events_url":"https://api.github.com/repos/metamx/java-util/events","assignees_url":"https://api.github.com/repos/metamx/java-util/assignees{/user}","branches_url":"https://api.github.com/repos/metamx/java-util/branches{/branch}","tags_url":"https://api.github.com/repos/metamx/java-util/tags","blobs_url":"https://api.github.com/repos/metamx/java-util/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/metamx/java-util/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/metamx/java-util/git/refs{/sha}","trees_url":"https://api.github.com/repos/metamx/java-util/git/trees{/sha}","statuses_url":"https://api.github.com/repos/metamx/java-util/statuses/{sha}","languages_url":"https://api.github.com/repos/metamx/java-util/languages","stargazers_url":"https://api.github.com/repos/metamx/java-util/stargazers","contributors_url":"https://api.github.com/repos/metamx/java-util/contributors","subscribers_url":"https://api.github.com/repos/metamx/java-util/subscribers","subscription_url":"https://api.github.com/repos/metamx/java-util/subscription","commits_url":"https://api.github.com/repos/metamx/java-util/commits{/sha}","git_commits_url":"https://api.github.com/repos/metamx/java-util/git/commits{/sha}","comments_url":"https://api.github.com/repos/metamx/java-util/comments{/number}","issue_comment_url":"https://api.github.com/repos/metamx/java-util/issues/comments{/number}","contents_url":"https://api.github.com/repos/metamx/java-util/contents/{+path}","compare_url":"https://api.github.com/repos/metamx/java-util/compare/{base}...{head}","merges_url":"https://api.github.com/repos/metamx/java-util/merges","archive_url":"https://api.github.com/repos/metamx/java-util/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/metamx/java-util/downloads","issues_url":"https://api.github.com/repos/metamx/java-util/issues{/number}","pulls_url":"https://api.github.com/repos/metamx/java-util/pulls{/number}","milestones_url":"https://api.github.com/repos/metamx/java-util/milestones{/number}","notifications_url":"https://api.github.com/repos/metamx/java-util/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/metamx/java-util/labels{/name}","releases_url":"https://api.github.com/repos/metamx/java-util/releases{/id}","deployments_url":"https://api.github.com/repos/metamx/java-util/deployments","created_at":"2011-10-21T18:41:10Z","updated_at":"2016-02-17T00:09:14Z","pushed_at":"2016-02-17T00:59:12Z","git_url":"git://github.com/metamx/java-util.git","ssh_url":"git@github.com:metamx/java-util.git","clone_url":"https://github.com/metamx/java-util.git","svn_url":"https://github.com/metamx/java-util","homepage":"","size":615,"stargazers_count":20,"watchers_count":20,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":31,"mirror_url":null,"open_issues_count":1,"forks":31,"open_issues":1,"watchers":20,"default_branch":"master"}},"base":{"label":"metamx:master","ref":"master","sha":"665e0851e6ce01d79da8eb0914c2e049eb22f60c","user":{"login":"metamx","id":299329,"avatar_url":"https://avatars.githubusercontent.com/u/299329?v=3","gravatar_id":"","url":"https://api.github.com/users/metamx","html_url":"https://github.com/metamx","followers_url":"https://api.github.com/users/metamx/followers","following_url":"https://api.github.com/users/metamx/following{/other_user}","gists_url":"https://api.github.com/users/metamx/gists{/gist_id}","starred_url":"https://api.github.com/users/metamx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metamx/subscriptions","organizations_url":"https://api.github.com/users/metamx/orgs","repos_url":"https://api.github.com/users/metamx/repos","events_url":"https://api.github.com/users/metamx/events{/privacy}","received_events_url":"https://api.github.com/users/metamx/received_events","type":"Organization","site_admin":false},"repo":{"id":2622329,"name":"java-util","full_name":"metamx/java-util","owner":{"login":"metamx","id":299329,"avatar_url":"https://avatars.githubusercontent.com/u/299329?v=3","gravatar_id":"","url":"https://api.github.com/users/metamx","html_url":"https://github.com/metamx","followers_url":"https://api.github.com/users/metamx/followers","following_url":"https://api.github.com/users/metamx/following{/other_user}","gists_url":"https://api.github.com/users/metamx/gists{/gist_id}","starred_url":"https://api.github.com/users/metamx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metamx/subscriptions","organizations_url":"https://api.github.com/users/metamx/orgs","repos_url":"https://api.github.com/users/metamx/repos","events_url":"https://api.github.com/users/metamx/events{/privacy}","received_events_url":"https://api.github.com/users/metamx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/metamx/java-util","description":"Utility code for java and jvm-based languages","fork":false,"url":"https://api.github.com/repos/metamx/java-util","forks_url":"https://api.github.com/repos/metamx/java-util/forks","keys_url":"https://api.github.com/repos/metamx/java-util/keys{/key_id}","collaborators_url":"https://api.github.com/repos/metamx/java-util/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/metamx/java-util/teams","hooks_url":"https://api.github.com/repos/metamx/java-util/hooks","issue_events_url":"https://api.github.com/repos/metamx/java-util/issues/events{/number}","events_url":"https://api.github.com/repos/metamx/java-util/events","assignees_url":"https://api.github.com/repos/metamx/java-util/assignees{/user}","branches_url":"https://api.github.com/repos/metamx/java-util/branches{/branch}","tags_url":"https://api.github.com/repos/metamx/java-util/tags","blobs_url":"https://api.github.com/repos/metamx/java-util/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/metamx/java-util/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/metamx/java-util/git/refs{/sha}","trees_url":"https://api.github.com/repos/metamx/java-util/git/trees{/sha}","statuses_url":"https://api.github.com/repos/metamx/java-util/statuses/{sha}","languages_url":"https://api.github.com/repos/metamx/java-util/languages","stargazers_url":"https://api.github.com/repos/metamx/java-util/stargazers","contributors_url":"https://api.github.com/repos/metamx/java-util/contributors","subscribers_url":"https://api.github.com/repos/metamx/java-util/subscribers","subscription_url":"https://api.github.com/repos/metamx/java-util/subscription","commits_url":"https://api.github.com/repos/metamx/java-util/commits{/sha}","git_commits_url":"https://api.github.com/repos/metamx/java-util/git/commits{/sha}","comments_url":"https://api.github.com/repos/metamx/java-util/comments{/number}","issue_comment_url":"https://api.github.com/repos/metamx/java-util/issues/comments{/number}","contents_url":"https://api.github.com/repos/metamx/java-util/contents/{+path}","compare_url":"https://api.github.com/repos/metamx/java-util/compare/{base}...{head}","merges_url":"https://api.github.com/repos/metamx/java-util/merges","archive_url":"https://api.github.com/repos/metamx/java-util/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/metamx/java-util/downloads","issues_url":"https://api.github.com/repos/metamx/java-util/issues{/number}","pulls_url":"https://api.github.com/repos/metamx/java-util/pulls{/number}","milestones_url":"https://api.github.com/repos/metamx/java-util/milestones{/number}","notifications_url":"https://api.github.com/repos/metamx/java-util/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/metamx/java-util/labels{/name}","releases_url":"https://api.github.com/repos/metamx/java-util/releases{/id}","deployments_url":"https://api.github.com/repos/metamx/java-util/deployments","created_at":"2011-10-21T18:41:10Z","updated_at":"2016-02-17T00:09:14Z","pushed_at":"2016-02-17T00:59:12Z","git_url":"git://github.com/metamx/java-util.git","ssh_url":"git@github.com:metamx/java-util.git","clone_url":"https://github.com/metamx/java-util.git","svn_url":"https://github.com/metamx/java-util","homepage":"","size":615,"stargazers_count":20,"watchers_count":20,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":31,"mirror_url":null,"open_issues_count":1,"forks":31,"open_issues":1,"watchers":20,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/metamx/java-util/pulls/39"},"html":{"href":"https://github.com/metamx/java-util/pull/39"},"issue":{"href":"https://api.github.com/repos/metamx/java-util/issues/39"},"comments":{"href":"https://api.github.com/repos/metamx/java-util/issues/39/comments"},"review_comments":{"href":"https://api.github.com/repos/metamx/java-util/pulls/39/comments"},"review_comment":{"href":"https://api.github.com/repos/metamx/java-util/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/metamx/java-util/pulls/39/commits"},"statuses":{"href":"https://api.github.com/repos/metamx/java-util/statuses/6d2735e7ea7bb63027a4a0d6dbff9a251722f711"}}}}