{"action":"created","comment":{"url":"https://api.github.com/repos/ankidroid/Anki-Android/pulls/comments/55916493","id":55916493,"diff_hunk":"@@ -49,15 +51,40 @@ static String joinFields(String[] list) {\n         return fields.split(\"\\\\x1f\", -1);\n     }\n \n+    private static final String TAG_SEPARATOR = \" \";\n+\n     static String joinTags(Set<String> tags) {\n-        for (String t : tags) {\n-            t.replaceAll(\" \", \"_\");\n+        if (tags == null || tags.isEmpty()) {\n+            return \"\";\n+        }\n+        StringBuilder sb = new StringBuilder();","path":"api/src/main/java/com/ichi2/anki/api/Utils.java","position":23,"original_position":23,"commit_id":"fa8702a2f9ad97d260f5ca82e6bc44de188efcaf","original_commit_id":"fa8702a2f9ad97d260f5ca82e6bc44de188efcaf","user":{"login":"timrae","id":2818274,"avatar_url":"https://avatars.githubusercontent.com/u/2818274?v=3","gravatar_id":"","url":"https://api.github.com/users/timrae","html_url":"https://github.com/timrae","followers_url":"https://api.github.com/users/timrae/followers","following_url":"https://api.github.com/users/timrae/following{/other_user}","gists_url":"https://api.github.com/users/timrae/gists{/gist_id}","starred_url":"https://api.github.com/users/timrae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timrae/subscriptions","organizations_url":"https://api.github.com/users/timrae/orgs","repos_url":"https://api.github.com/users/timrae/repos","events_url":"https://api.github.com/users/timrae/events{/privacy}","received_events_url":"https://api.github.com/users/timrae/received_events","type":"User","site_admin":false},"body":"Why all this extra code with the StringBuilder here? What's wrong with TextUtils.join()? If it's for performance it just looks like premature optimization resulting in unnecessary code.","created_at":"2016-03-12T05:16:35Z","updated_at":"2016-03-12T05:16:35Z","html_url":"https://github.com/ankidroid/Anki-Android/pull/4122#discussion_r55916493","pull_request_url":"https://api.github.com/repos/ankidroid/Anki-Android/pulls/4122","_links":{"self":{"href":"https://api.github.com/repos/ankidroid/Anki-Android/pulls/comments/55916493"},"html":{"href":"https://github.com/ankidroid/Anki-Android/pull/4122#discussion_r55916493"},"pull_request":{"href":"https://api.github.com/repos/ankidroid/Anki-Android/pulls/4122"}}},"pull_request":{"url":"https://api.github.com/repos/ankidroid/Anki-Android/pulls/4122","id":62186782,"html_url":"https://github.com/ankidroid/Anki-Android/pull/4122","diff_url":"https://github.com/ankidroid/Anki-Android/pull/4122.diff","patch_url":"https://github.com/ankidroid/Anki-Android/pull/4122.patch","issue_url":"https://api.github.com/repos/ankidroid/Anki-Android/issues/4122","number":4122,"state":"open","locked":false,"title":"Added Api support for updating notes and update permission checks in both Api and provider","user":{"login":"marcardar","id":409640,"avatar_url":"https://avatars.githubusercontent.com/u/409640?v=3","gravatar_id":"","url":"https://api.github.com/users/marcardar","html_url":"https://github.com/marcardar","followers_url":"https://api.github.com/users/marcardar/followers","following_url":"https://api.github.com/users/marcardar/following{/other_user}","gists_url":"https://api.github.com/users/marcardar/gists{/gist_id}","starred_url":"https://api.github.com/users/marcardar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcardar/subscriptions","organizations_url":"https://api.github.com/users/marcardar/orgs","repos_url":"https://api.github.com/users/marcardar/repos","events_url":"https://api.github.com/users/marcardar/events{/privacy}","received_events_url":"https://api.github.com/users/marcardar/received_events","type":"User","site_admin":false},"body":"Also added content provider run time permission check when calling update() and delete()","created_at":"2016-03-09T06:49:05Z","updated_at":"2016-03-12T05:16:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9ecce78b28bdf21713e692ab931409a196c803db","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ankidroid/Anki-Android/pulls/4122/commits","review_comments_url":"https://api.github.com/repos/ankidroid/Anki-Android/pulls/4122/comments","review_comment_url":"https://api.github.com/repos/ankidroid/Anki-Android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ankidroid/Anki-Android/issues/4122/comments","statuses_url":"https://api.github.com/repos/ankidroid/Anki-Android/statuses/fa8702a2f9ad97d260f5ca82e6bc44de188efcaf","head":{"label":"marcardar:notes-update-api","ref":"notes-update-api","sha":"fa8702a2f9ad97d260f5ca82e6bc44de188efcaf","user":{"login":"marcardar","id":409640,"avatar_url":"https://avatars.githubusercontent.com/u/409640?v=3","gravatar_id":"","url":"https://api.github.com/users/marcardar","html_url":"https://github.com/marcardar","followers_url":"https://api.github.com/users/marcardar/followers","following_url":"https://api.github.com/users/marcardar/following{/other_user}","gists_url":"https://api.github.com/users/marcardar/gists{/gist_id}","starred_url":"https://api.github.com/users/marcardar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcardar/subscriptions","organizations_url":"https://api.github.com/users/marcardar/orgs","repos_url":"https://api.github.com/users/marcardar/repos","events_url":"https://api.github.com/users/marcardar/events{/privacy}","received_events_url":"https://api.github.com/users/marcardar/received_events","type":"User","site_admin":false},"repo":{"id":52933751,"name":"Anki-Android","full_name":"marcardar/Anki-Android","owner":{"login":"marcardar","id":409640,"avatar_url":"https://avatars.githubusercontent.com/u/409640?v=3","gravatar_id":"","url":"https://api.github.com/users/marcardar","html_url":"https://github.com/marcardar","followers_url":"https://api.github.com/users/marcardar/followers","following_url":"https://api.github.com/users/marcardar/following{/other_user}","gists_url":"https://api.github.com/users/marcardar/gists{/gist_id}","starred_url":"https://api.github.com/users/marcardar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcardar/subscriptions","organizations_url":"https://api.github.com/users/marcardar/orgs","repos_url":"https://api.github.com/users/marcardar/repos","events_url":"https://api.github.com/users/marcardar/events{/privacy}","received_events_url":"https://api.github.com/users/marcardar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/marcardar/Anki-Android","description":"AnkiDroid: Anki on Android","fork":true,"url":"https://api.github.com/repos/marcardar/Anki-Android","forks_url":"https://api.github.com/repos/marcardar/Anki-Android/forks","keys_url":"https://api.github.com/repos/marcardar/Anki-Android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marcardar/Anki-Android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marcardar/Anki-Android/teams","hooks_url":"https://api.github.com/repos/marcardar/Anki-Android/hooks","issue_events_url":"https://api.github.com/repos/marcardar/Anki-Android/issues/events{/number}","events_url":"https://api.github.com/repos/marcardar/Anki-Android/events","assignees_url":"https://api.github.com/repos/marcardar/Anki-Android/assignees{/user}","branches_url":"https://api.github.com/repos/marcardar/Anki-Android/branches{/branch}","tags_url":"https://api.github.com/repos/marcardar/Anki-Android/tags","blobs_url":"https://api.github.com/repos/marcardar/Anki-Android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marcardar/Anki-Android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marcardar/Anki-Android/git/refs{/sha}","trees_url":"https://api.github.com/repos/marcardar/Anki-Android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marcardar/Anki-Android/statuses/{sha}","languages_url":"https://api.github.com/repos/marcardar/Anki-Android/languages","stargazers_url":"https://api.github.com/repos/marcardar/Anki-Android/stargazers","contributors_url":"https://api.github.com/repos/marcardar/Anki-Android/contributors","subscribers_url":"https://api.github.com/repos/marcardar/Anki-Android/subscribers","subscription_url":"https://api.github.com/repos/marcardar/Anki-Android/subscription","commits_url":"https://api.github.com/repos/marcardar/Anki-Android/commits{/sha}","git_commits_url":"https://api.github.com/repos/marcardar/Anki-Android/git/commits{/sha}","comments_url":"https://api.github.com/repos/marcardar/Anki-Android/comments{/number}","issue_comment_url":"https://api.github.com/repos/marcardar/Anki-Android/issues/comments{/number}","contents_url":"https://api.github.com/repos/marcardar/Anki-Android/contents/{+path}","compare_url":"https://api.github.com/repos/marcardar/Anki-Android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marcardar/Anki-Android/merges","archive_url":"https://api.github.com/repos/marcardar/Anki-Android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marcardar/Anki-Android/downloads","issues_url":"https://api.github.com/repos/marcardar/Anki-Android/issues{/number}","pulls_url":"https://api.github.com/repos/marcardar/Anki-Android/pulls{/number}","milestones_url":"https://api.github.com/repos/marcardar/Anki-Android/milestones{/number}","notifications_url":"https://api.github.com/repos/marcardar/Anki-Android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marcardar/Anki-Android/labels{/name}","releases_url":"https://api.github.com/repos/marcardar/Anki-Android/releases{/id}","deployments_url":"https://api.github.com/repos/marcardar/Anki-Android/deployments","created_at":"2016-03-02T04:26:22Z","updated_at":"2016-03-02T04:26:27Z","pushed_at":"2016-03-12T02:43:01Z","git_url":"git://github.com/marcardar/Anki-Android.git","ssh_url":"git@github.com:marcardar/Anki-Android.git","clone_url":"https://github.com/marcardar/Anki-Android.git","svn_url":"https://github.com/marcardar/Anki-Android","homepage":"","size":102514,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":false,"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":"develop"}},"base":{"label":"ankidroid:develop","ref":"develop","sha":"884ad342e8300c74b47775f1ecb6f3eaff6e77fb","user":{"login":"ankidroid","id":3320903,"avatar_url":"https://avatars.githubusercontent.com/u/3320903?v=3","gravatar_id":"","url":"https://api.github.com/users/ankidroid","html_url":"https://github.com/ankidroid","followers_url":"https://api.github.com/users/ankidroid/followers","following_url":"https://api.github.com/users/ankidroid/following{/other_user}","gists_url":"https://api.github.com/users/ankidroid/gists{/gist_id}","starred_url":"https://api.github.com/users/ankidroid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ankidroid/subscriptions","organizations_url":"https://api.github.com/users/ankidroid/orgs","repos_url":"https://api.github.com/users/ankidroid/repos","events_url":"https://api.github.com/users/ankidroid/events{/privacy}","received_events_url":"https://api.github.com/users/ankidroid/received_events","type":"Organization","site_admin":false},"repo":{"id":7716883,"name":"Anki-Android","full_name":"ankidroid/Anki-Android","owner":{"login":"ankidroid","id":3320903,"avatar_url":"https://avatars.githubusercontent.com/u/3320903?v=3","gravatar_id":"","url":"https://api.github.com/users/ankidroid","html_url":"https://github.com/ankidroid","followers_url":"https://api.github.com/users/ankidroid/followers","following_url":"https://api.github.com/users/ankidroid/following{/other_user}","gists_url":"https://api.github.com/users/ankidroid/gists{/gist_id}","starred_url":"https://api.github.com/users/ankidroid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ankidroid/subscriptions","organizations_url":"https://api.github.com/users/ankidroid/orgs","repos_url":"https://api.github.com/users/ankidroid/repos","events_url":"https://api.github.com/users/ankidroid/events{/privacy}","received_events_url":"https://api.github.com/users/ankidroid/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ankidroid/Anki-Android","description":"AnkiDroid: Anki on Android","fork":false,"url":"https://api.github.com/repos/ankidroid/Anki-Android","forks_url":"https://api.github.com/repos/ankidroid/Anki-Android/forks","keys_url":"https://api.github.com/repos/ankidroid/Anki-Android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ankidroid/Anki-Android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ankidroid/Anki-Android/teams","hooks_url":"https://api.github.com/repos/ankidroid/Anki-Android/hooks","issue_events_url":"https://api.github.com/repos/ankidroid/Anki-Android/issues/events{/number}","events_url":"https://api.github.com/repos/ankidroid/Anki-Android/events","assignees_url":"https://api.github.com/repos/ankidroid/Anki-Android/assignees{/user}","branches_url":"https://api.github.com/repos/ankidroid/Anki-Android/branches{/branch}","tags_url":"https://api.github.com/repos/ankidroid/Anki-Android/tags","blobs_url":"https://api.github.com/repos/ankidroid/Anki-Android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ankidroid/Anki-Android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ankidroid/Anki-Android/git/refs{/sha}","trees_url":"https://api.github.com/repos/ankidroid/Anki-Android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ankidroid/Anki-Android/statuses/{sha}","languages_url":"https://api.github.com/repos/ankidroid/Anki-Android/languages","stargazers_url":"https://api.github.com/repos/ankidroid/Anki-Android/stargazers","contributors_url":"https://api.github.com/repos/ankidroid/Anki-Android/contributors","subscribers_url":"https://api.github.com/repos/ankidroid/Anki-Android/subscribers","subscription_url":"https://api.github.com/repos/ankidroid/Anki-Android/subscription","commits_url":"https://api.github.com/repos/ankidroid/Anki-Android/commits{/sha}","git_commits_url":"https://api.github.com/repos/ankidroid/Anki-Android/git/commits{/sha}","comments_url":"https://api.github.com/repos/ankidroid/Anki-Android/comments{/number}","issue_comment_url":"https://api.github.com/repos/ankidroid/Anki-Android/issues/comments{/number}","contents_url":"https://api.github.com/repos/ankidroid/Anki-Android/contents/{+path}","compare_url":"https://api.github.com/repos/ankidroid/Anki-Android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ankidroid/Anki-Android/merges","archive_url":"https://api.github.com/repos/ankidroid/Anki-Android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ankidroid/Anki-Android/downloads","issues_url":"https://api.github.com/repos/ankidroid/Anki-Android/issues{/number}","pulls_url":"https://api.github.com/repos/ankidroid/Anki-Android/pulls{/number}","milestones_url":"https://api.github.com/repos/ankidroid/Anki-Android/milestones{/number}","notifications_url":"https://api.github.com/repos/ankidroid/Anki-Android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ankidroid/Anki-Android/labels{/name}","releases_url":"https://api.github.com/repos/ankidroid/Anki-Android/releases{/id}","deployments_url":"https://api.github.com/repos/ankidroid/Anki-Android/deployments","created_at":"2013-01-20T13:55:53Z","updated_at":"2016-03-08T16:15:35Z","pushed_at":"2016-03-12T04:22:50Z","git_url":"git://github.com/ankidroid/Anki-Android.git","ssh_url":"git@github.com:ankidroid/Anki-Android.git","clone_url":"https://github.com/ankidroid/Anki-Android.git","svn_url":"https://github.com/ankidroid/Anki-Android","homepage":"","size":124592,"stargazers_count":504,"watchers_count":504,"language":"Java","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":410,"mirror_url":null,"open_issues_count":277,"forks":410,"open_issues":277,"watchers":504,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ankidroid/Anki-Android/pulls/4122"},"html":{"href":"https://github.com/ankidroid/Anki-Android/pull/4122"},"issue":{"href":"https://api.github.com/repos/ankidroid/Anki-Android/issues/4122"},"comments":{"href":"https://api.github.com/repos/ankidroid/Anki-Android/issues/4122/comments"},"review_comments":{"href":"https://api.github.com/repos/ankidroid/Anki-Android/pulls/4122/comments"},"review_comment":{"href":"https://api.github.com/repos/ankidroid/Anki-Android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ankidroid/Anki-Android/pulls/4122/commits"},"statuses":{"href":"https://api.github.com/repos/ankidroid/Anki-Android/statuses/fa8702a2f9ad97d260f5ca82e6bc44de188efcaf"}}}}