{"action":"created","comment":{"url":"https://api.github.com/repos/k9mail/k-9/pulls/comments/25135411","id":25135411,"diff_hunk":"@@ -0,0 +1,31 @@\n+package com.fsck.k9.account;\n+\n+import com.fsck.k9.Account.DeletePolicy;\n+import com.fsck.k9.mail.ServerSettings.Type;\n+\n+import java.util.HashMap;\n+import java.util.Map;\n+\n+/**\n+ * Deals with logic surrounding account creation.\n+ * <p/>\n+ * TODO Move much of the code from com.fsck.k9.activity.setup.* into here\n+ */\n+public class AccountCreator {\n+\n+    private static Map<Type, DeletePolicy> defaults;\n+\n+    public static DeletePolicy calculateDefaultDeletePolicy(Type type) {\n+        return getDefaults().get(type);\n+    }\n+\n+    private static synchronized Map<Type, DeletePolicy> getDefaults() {\n+        if (null == defaults) {","path":"k9mail/src/main/java/com/fsck/k9/account/AccountCreator.java","position":23,"original_position":23,"commit_id":"1a706c3113da12ea540f4ff2b9381a57b7b5d92e","original_commit_id":"1a706c3113da12ea540f4ff2b9381a57b7b5d92e","user":{"login":"cketti","id":218061,"avatar_url":"https://avatars.githubusercontent.com/u/218061?v=3","gravatar_id":"","url":"https://api.github.com/users/cketti","html_url":"https://github.com/cketti","followers_url":"https://api.github.com/users/cketti/followers","following_url":"https://api.github.com/users/cketti/following{/other_user}","gists_url":"https://api.github.com/users/cketti/gists{/gist_id}","starred_url":"https://api.github.com/users/cketti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cketti/subscriptions","organizations_url":"https://api.github.com/users/cketti/orgs","repos_url":"https://api.github.com/users/cketti/repos","events_url":"https://api.github.com/users/cketti/events{/privacy}","received_events_url":"https://api.github.com/users/cketti/received_events","type":"User","site_admin":false},"body":"Please follow the K-9 code style. We always put `null` on the right side of a comparison.\r\n\r\nYou could avoid `synchronized` on this method by putting the initialization code in a static initializer.\r\n","created_at":"2015-02-22T19:20:15Z","updated_at":"2015-02-22T19:20:15Z","html_url":"https://github.com/k9mail/k-9/pull/557#discussion_r25135411","pull_request_url":"https://api.github.com/repos/k9mail/k-9/pulls/557","_links":{"self":{"href":"https://api.github.com/repos/k9mail/k-9/pulls/comments/25135411"},"html":{"href":"https://github.com/k9mail/k-9/pull/557#discussion_r25135411"},"pull_request":{"href":"https://api.github.com/repos/k9mail/k-9/pulls/557"}}},"pull_request":{"url":"https://api.github.com/repos/k9mail/k-9/pulls/557","id":29556420,"html_url":"https://github.com/k9mail/k-9/pull/557","diff_url":"https://github.com/k9mail/k-9/pull/557.diff","patch_url":"https://github.com/k9mail/k-9/pull/557.patch","issue_url":"https://api.github.com/repos/k9mail/k-9/issues/557","number":557,"state":"open","locked":false,"title":"Remove duplication, enum-ify String","user":{"login":"artbristol","id":925073,"avatar_url":"https://avatars.githubusercontent.com/u/925073?v=3","gravatar_id":"","url":"https://api.github.com/users/artbristol","html_url":"https://github.com/artbristol","followers_url":"https://api.github.com/users/artbristol/followers","following_url":"https://api.github.com/users/artbristol/following{/other_user}","gists_url":"https://api.github.com/users/artbristol/gists{/gist_id}","starred_url":"https://api.github.com/users/artbristol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artbristol/subscriptions","organizations_url":"https://api.github.com/users/artbristol/orgs","repos_url":"https://api.github.com/users/artbristol/repos","events_url":"https://api.github.com/users/artbristol/events{/privacy}","received_events_url":"https://api.github.com/users/artbristol/received_events","type":"User","site_admin":false},"body":"Planning to separate account creation logic from the activity to enable unit testing. Small refactorings first, so you don't have to review a giant pull request.","created_at":"2015-02-18T19:45:54Z","updated_at":"2015-02-22T19:20:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"95dd4be7a81226610b5b7c216591cd3b5f085862","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/k9mail/k-9/pulls/557/commits","review_comments_url":"https://api.github.com/repos/k9mail/k-9/pulls/557/comments","review_comment_url":"https://api.github.com/repos/k9mail/k-9/pulls/comments{/number}","comments_url":"https://api.github.com/repos/k9mail/k-9/issues/557/comments","statuses_url":"https://api.github.com/repos/k9mail/k-9/statuses/1a706c3113da12ea540f4ff2b9381a57b7b5d92e","head":{"label":"artbristol:art/account-creation-refactor-2","ref":"art/account-creation-refactor-2","sha":"1a706c3113da12ea540f4ff2b9381a57b7b5d92e","user":{"login":"artbristol","id":925073,"avatar_url":"https://avatars.githubusercontent.com/u/925073?v=3","gravatar_id":"","url":"https://api.github.com/users/artbristol","html_url":"https://github.com/artbristol","followers_url":"https://api.github.com/users/artbristol/followers","following_url":"https://api.github.com/users/artbristol/following{/other_user}","gists_url":"https://api.github.com/users/artbristol/gists{/gist_id}","starred_url":"https://api.github.com/users/artbristol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artbristol/subscriptions","organizations_url":"https://api.github.com/users/artbristol/orgs","repos_url":"https://api.github.com/users/artbristol/repos","events_url":"https://api.github.com/users/artbristol/events{/privacy}","received_events_url":"https://api.github.com/users/artbristol/received_events","type":"User","site_admin":false},"repo":{"id":26498001,"name":"k-9","full_name":"artbristol/k-9","owner":{"login":"artbristol","id":925073,"avatar_url":"https://avatars.githubusercontent.com/u/925073?v=3","gravatar_id":"","url":"https://api.github.com/users/artbristol","html_url":"https://github.com/artbristol","followers_url":"https://api.github.com/users/artbristol/followers","following_url":"https://api.github.com/users/artbristol/following{/other_user}","gists_url":"https://api.github.com/users/artbristol/gists{/gist_id}","starred_url":"https://api.github.com/users/artbristol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artbristol/subscriptions","organizations_url":"https://api.github.com/users/artbristol/orgs","repos_url":"https://api.github.com/users/artbristol/repos","events_url":"https://api.github.com/users/artbristol/events{/privacy}","received_events_url":"https://api.github.com/users/artbristol/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/artbristol/k-9","description":"K-9 Mail, An advanced email client for Android","fork":true,"url":"https://api.github.com/repos/artbristol/k-9","forks_url":"https://api.github.com/repos/artbristol/k-9/forks","keys_url":"https://api.github.com/repos/artbristol/k-9/keys{/key_id}","collaborators_url":"https://api.github.com/repos/artbristol/k-9/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/artbristol/k-9/teams","hooks_url":"https://api.github.com/repos/artbristol/k-9/hooks","issue_events_url":"https://api.github.com/repos/artbristol/k-9/issues/events{/number}","events_url":"https://api.github.com/repos/artbristol/k-9/events","assignees_url":"https://api.github.com/repos/artbristol/k-9/assignees{/user}","branches_url":"https://api.github.com/repos/artbristol/k-9/branches{/branch}","tags_url":"https://api.github.com/repos/artbristol/k-9/tags","blobs_url":"https://api.github.com/repos/artbristol/k-9/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/artbristol/k-9/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/artbristol/k-9/git/refs{/sha}","trees_url":"https://api.github.com/repos/artbristol/k-9/git/trees{/sha}","statuses_url":"https://api.github.com/repos/artbristol/k-9/statuses/{sha}","languages_url":"https://api.github.com/repos/artbristol/k-9/languages","stargazers_url":"https://api.github.com/repos/artbristol/k-9/stargazers","contributors_url":"https://api.github.com/repos/artbristol/k-9/contributors","subscribers_url":"https://api.github.com/repos/artbristol/k-9/subscribers","subscription_url":"https://api.github.com/repos/artbristol/k-9/subscription","commits_url":"https://api.github.com/repos/artbristol/k-9/commits{/sha}","git_commits_url":"https://api.github.com/repos/artbristol/k-9/git/commits{/sha}","comments_url":"https://api.github.com/repos/artbristol/k-9/comments{/number}","issue_comment_url":"https://api.github.com/repos/artbristol/k-9/issues/comments{/number}","contents_url":"https://api.github.com/repos/artbristol/k-9/contents/{+path}","compare_url":"https://api.github.com/repos/artbristol/k-9/compare/{base}...{head}","merges_url":"https://api.github.com/repos/artbristol/k-9/merges","archive_url":"https://api.github.com/repos/artbristol/k-9/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/artbristol/k-9/downloads","issues_url":"https://api.github.com/repos/artbristol/k-9/issues{/number}","pulls_url":"https://api.github.com/repos/artbristol/k-9/pulls{/number}","milestones_url":"https://api.github.com/repos/artbristol/k-9/milestones{/number}","notifications_url":"https://api.github.com/repos/artbristol/k-9/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/artbristol/k-9/labels{/name}","releases_url":"https://api.github.com/repos/artbristol/k-9/releases{/id}","created_at":"2014-11-11T18:19:34Z","updated_at":"2014-11-11T16:00:51Z","pushed_at":"2015-02-22T17:01:40Z","git_url":"git://github.com/artbristol/k-9.git","ssh_url":"git@github.com:artbristol/k-9.git","clone_url":"https://github.com/artbristol/k-9.git","svn_url":"https://github.com/artbristol/k-9","homepage":"","size":34853,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"k9mail:master","ref":"master","sha":"ebef8eccb91d705887a3dc3887b89cb28e63cfa6","user":{"login":"k9mail","id":567044,"avatar_url":"https://avatars.githubusercontent.com/u/567044?v=3","gravatar_id":"","url":"https://api.github.com/users/k9mail","html_url":"https://github.com/k9mail","followers_url":"https://api.github.com/users/k9mail/followers","following_url":"https://api.github.com/users/k9mail/following{/other_user}","gists_url":"https://api.github.com/users/k9mail/gists{/gist_id}","starred_url":"https://api.github.com/users/k9mail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k9mail/subscriptions","organizations_url":"https://api.github.com/users/k9mail/orgs","repos_url":"https://api.github.com/users/k9mail/repos","events_url":"https://api.github.com/users/k9mail/events{/privacy}","received_events_url":"https://api.github.com/users/k9mail/received_events","type":"Organization","site_admin":false},"repo":{"id":1326671,"name":"k-9","full_name":"k9mail/k-9","owner":{"login":"k9mail","id":567044,"avatar_url":"https://avatars.githubusercontent.com/u/567044?v=3","gravatar_id":"","url":"https://api.github.com/users/k9mail","html_url":"https://github.com/k9mail","followers_url":"https://api.github.com/users/k9mail/followers","following_url":"https://api.github.com/users/k9mail/following{/other_user}","gists_url":"https://api.github.com/users/k9mail/gists{/gist_id}","starred_url":"https://api.github.com/users/k9mail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k9mail/subscriptions","organizations_url":"https://api.github.com/users/k9mail/orgs","repos_url":"https://api.github.com/users/k9mail/repos","events_url":"https://api.github.com/users/k9mail/events{/privacy}","received_events_url":"https://api.github.com/users/k9mail/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/k9mail/k-9","description":"K-9 Mail, An advanced email client for Android","fork":false,"url":"https://api.github.com/repos/k9mail/k-9","forks_url":"https://api.github.com/repos/k9mail/k-9/forks","keys_url":"https://api.github.com/repos/k9mail/k-9/keys{/key_id}","collaborators_url":"https://api.github.com/repos/k9mail/k-9/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/k9mail/k-9/teams","hooks_url":"https://api.github.com/repos/k9mail/k-9/hooks","issue_events_url":"https://api.github.com/repos/k9mail/k-9/issues/events{/number}","events_url":"https://api.github.com/repos/k9mail/k-9/events","assignees_url":"https://api.github.com/repos/k9mail/k-9/assignees{/user}","branches_url":"https://api.github.com/repos/k9mail/k-9/branches{/branch}","tags_url":"https://api.github.com/repos/k9mail/k-9/tags","blobs_url":"https://api.github.com/repos/k9mail/k-9/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/k9mail/k-9/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/k9mail/k-9/git/refs{/sha}","trees_url":"https://api.github.com/repos/k9mail/k-9/git/trees{/sha}","statuses_url":"https://api.github.com/repos/k9mail/k-9/statuses/{sha}","languages_url":"https://api.github.com/repos/k9mail/k-9/languages","stargazers_url":"https://api.github.com/repos/k9mail/k-9/stargazers","contributors_url":"https://api.github.com/repos/k9mail/k-9/contributors","subscribers_url":"https://api.github.com/repos/k9mail/k-9/subscribers","subscription_url":"https://api.github.com/repos/k9mail/k-9/subscription","commits_url":"https://api.github.com/repos/k9mail/k-9/commits{/sha}","git_commits_url":"https://api.github.com/repos/k9mail/k-9/git/commits{/sha}","comments_url":"https://api.github.com/repos/k9mail/k-9/comments{/number}","issue_comment_url":"https://api.github.com/repos/k9mail/k-9/issues/comments{/number}","contents_url":"https://api.github.com/repos/k9mail/k-9/contents/{+path}","compare_url":"https://api.github.com/repos/k9mail/k-9/compare/{base}...{head}","merges_url":"https://api.github.com/repos/k9mail/k-9/merges","archive_url":"https://api.github.com/repos/k9mail/k-9/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/k9mail/k-9/downloads","issues_url":"https://api.github.com/repos/k9mail/k-9/issues{/number}","pulls_url":"https://api.github.com/repos/k9mail/k-9/pulls{/number}","milestones_url":"https://api.github.com/repos/k9mail/k-9/milestones{/number}","notifications_url":"https://api.github.com/repos/k9mail/k-9/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/k9mail/k-9/labels{/name}","releases_url":"https://api.github.com/repos/k9mail/k-9/releases{/id}","created_at":"2011-02-04T02:40:00Z","updated_at":"2015-02-21T14:19:35Z","pushed_at":"2015-02-21T06:44:28Z","git_url":"git://github.com/k9mail/k-9.git","ssh_url":"git@github.com:k9mail/k-9.git","clone_url":"https://github.com/k9mail/k-9.git","svn_url":"https://github.com/k9mail/k-9","homepage":"","size":79581,"stargazers_count":1760,"watchers_count":1760,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1124,"mirror_url":null,"open_issues_count":25,"forks":1124,"open_issues":25,"watchers":1760,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/k9mail/k-9/pulls/557"},"html":{"href":"https://github.com/k9mail/k-9/pull/557"},"issue":{"href":"https://api.github.com/repos/k9mail/k-9/issues/557"},"comments":{"href":"https://api.github.com/repos/k9mail/k-9/issues/557/comments"},"review_comments":{"href":"https://api.github.com/repos/k9mail/k-9/pulls/557/comments"},"review_comment":{"href":"https://api.github.com/repos/k9mail/k-9/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/k9mail/k-9/pulls/557/commits"},"statuses":{"href":"https://api.github.com/repos/k9mail/k-9/statuses/1a706c3113da12ea540f4ff2b9381a57b7b5d92e"}}}}