{"action":"created","comment":{"url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/pulls/comments/102640380","pull_request_review_id":23400235,"id":102640380,"diff_hunk":"@@ -33,22 +35,20 @@ public String getString(@StringRes int resId, Object... formatArgs) {\n \n     public String loadJSONFromAsset(final String jsonFileName) {\n         String json = null;\n-        InputStream is = null;\n+        BufferedSource bufferedSource = null;\n         try {\n-            is = context.getAssets().open(\"json/\" + jsonFileName);\n-            int size = is.available();\n-            byte[] buffer = new byte[size];\n-            is.read(buffer);\n-            json = new String(buffer, \"UTF-8\");\n+            InputStream is = context.getAssets().open(\"json/\" + jsonFileName);\n+            bufferedSource = Okio.buffer(Okio.source(is));\n+            json = bufferedSource.readUtf8();\n         } catch (IOException e) {\n-            Timber.e(TAG, e.getMessage(), e);\n+            Timber.tag(TAG).e(e, \"assets/json/%s: read failed\", jsonFileName);\n         } finally {\n             try {\n-                if (is != null) {\n-                    is.close();\n+                if (bufferedSource != null) {\n+                    bufferedSource.close();\n                 }\n             } catch (IOException e) {\n-                Timber.e(TAG, e.getMessage(), e);\n+                // ignore","path":"app/src/main/java/io/github/droidkaigi/confsched2017/view/helper/ResourceResolver.java","position":36,"original_position":36,"commit_id":"28a50d486a767acedfcab5cb688acf0e002181fa","original_commit_id":"28a50d486a767acedfcab5cb688acf0e002181fa","user":{"login":"konifar","id":1269214,"avatar_url":"https://avatars.githubusercontent.com/u/1269214?v=3","gravatar_id":"","url":"https://api.github.com/users/konifar","html_url":"https://github.com/konifar","followers_url":"https://api.github.com/users/konifar/followers","following_url":"https://api.github.com/users/konifar/following{/other_user}","gists_url":"https://api.github.com/users/konifar/gists{/gist_id}","starred_url":"https://api.github.com/users/konifar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/konifar/subscriptions","organizations_url":"https://api.github.com/users/konifar/orgs","repos_url":"https://api.github.com/users/konifar/repos","events_url":"https://api.github.com/users/konifar/events{/privacy}","received_events_url":"https://api.github.com/users/konifar/received_events","type":"User","site_admin":false},"body":"🙋 Why did you ignore here?","created_at":"2017-02-23T05:12:37Z","updated_at":"2017-02-23T05:12:37Z","html_url":"https://github.com/DroidKaigi/conference-app-2017/pull/368#discussion_r102640380","pull_request_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/pulls/368","_links":{"self":{"href":"https://api.github.com/repos/DroidKaigi/conference-app-2017/pulls/comments/102640380"},"html":{"href":"https://github.com/DroidKaigi/conference-app-2017/pull/368#discussion_r102640380"},"pull_request":{"href":"https://api.github.com/repos/DroidKaigi/conference-app-2017/pulls/368"}}},"pull_request":{"url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/pulls/368","id":106907796,"html_url":"https://github.com/DroidKaigi/conference-app-2017/pull/368","diff_url":"https://github.com/DroidKaigi/conference-app-2017/pull/368.diff","patch_url":"https://github.com/DroidKaigi/conference-app-2017/pull/368.patch","issue_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/issues/368","number":368,"state":"open","locked":false,"title":"Fix potential problems in ResourceResolver.loadJSONFromAsset()","user":{"login":"sumio","id":3140018,"avatar_url":"https://avatars.githubusercontent.com/u/3140018?v=3","gravatar_id":"","url":"https://api.github.com/users/sumio","html_url":"https://github.com/sumio","followers_url":"https://api.github.com/users/sumio/followers","following_url":"https://api.github.com/users/sumio/following{/other_user}","gists_url":"https://api.github.com/users/sumio/gists{/gist_id}","starred_url":"https://api.github.com/users/sumio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sumio/subscriptions","organizations_url":"https://api.github.com/users/sumio/orgs","repos_url":"https://api.github.com/users/sumio/repos","events_url":"https://api.github.com/users/sumio/events{/privacy}","received_events_url":"https://api.github.com/users/sumio/received_events","type":"User","site_admin":false},"body":"## Issue\r\n\r\n`ResourceResolver.loadJSONFromAsset()` has the following code:\r\n\r\n```java\r\n            is = context.getAssets().open(\"json/\" + jsonFileName);\r\n            int size = is.available();\r\n            byte[] buffer = new byte[size];\r\n            is.read(buffer);\r\n            json = new String(buffer, \"UTF-8\");\r\n```\r\n\r\nThe above code may read only partial content of the file because `is.available()` may return less than the length of the file.\r\n\r\n## Overview (Required)\r\n\r\n- Use Apache Commons IO to avoid handling such a complicated stream behavior.\r\n\r\n## Links\r\n\r\nN/A\r\n\r\n## Screenshot\r\n\r\nN/A","created_at":"2017-02-19T16:57:01Z","updated_at":"2017-02-23T05:12:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"af41e6bc21a3d80140b4b00687aca18843d3d411","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/pulls/368/commits","review_comments_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/pulls/368/comments","review_comment_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/issues/368/comments","statuses_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/statuses/28a50d486a767acedfcab5cb688acf0e002181fa","head":{"label":"sumio:fix-reading-inputstream","ref":"fix-reading-inputstream","sha":"28a50d486a767acedfcab5cb688acf0e002181fa","user":{"login":"sumio","id":3140018,"avatar_url":"https://avatars.githubusercontent.com/u/3140018?v=3","gravatar_id":"","url":"https://api.github.com/users/sumio","html_url":"https://github.com/sumio","followers_url":"https://api.github.com/users/sumio/followers","following_url":"https://api.github.com/users/sumio/following{/other_user}","gists_url":"https://api.github.com/users/sumio/gists{/gist_id}","starred_url":"https://api.github.com/users/sumio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sumio/subscriptions","organizations_url":"https://api.github.com/users/sumio/orgs","repos_url":"https://api.github.com/users/sumio/repos","events_url":"https://api.github.com/users/sumio/events{/privacy}","received_events_url":"https://api.github.com/users/sumio/received_events","type":"User","site_admin":false},"repo":{"id":82470912,"name":"conference-app-2017","full_name":"sumio/conference-app-2017","owner":{"login":"sumio","id":3140018,"avatar_url":"https://avatars.githubusercontent.com/u/3140018?v=3","gravatar_id":"","url":"https://api.github.com/users/sumio","html_url":"https://github.com/sumio","followers_url":"https://api.github.com/users/sumio/followers","following_url":"https://api.github.com/users/sumio/following{/other_user}","gists_url":"https://api.github.com/users/sumio/gists{/gist_id}","starred_url":"https://api.github.com/users/sumio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sumio/subscriptions","organizations_url":"https://api.github.com/users/sumio/orgs","repos_url":"https://api.github.com/users/sumio/repos","events_url":"https://api.github.com/users/sumio/events{/privacy}","received_events_url":"https://api.github.com/users/sumio/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sumio/conference-app-2017","description":"The Official Conference App for DroidKaigi 2017 Tokyo","fork":true,"url":"https://api.github.com/repos/sumio/conference-app-2017","forks_url":"https://api.github.com/repos/sumio/conference-app-2017/forks","keys_url":"https://api.github.com/repos/sumio/conference-app-2017/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sumio/conference-app-2017/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sumio/conference-app-2017/teams","hooks_url":"https://api.github.com/repos/sumio/conference-app-2017/hooks","issue_events_url":"https://api.github.com/repos/sumio/conference-app-2017/issues/events{/number}","events_url":"https://api.github.com/repos/sumio/conference-app-2017/events","assignees_url":"https://api.github.com/repos/sumio/conference-app-2017/assignees{/user}","branches_url":"https://api.github.com/repos/sumio/conference-app-2017/branches{/branch}","tags_url":"https://api.github.com/repos/sumio/conference-app-2017/tags","blobs_url":"https://api.github.com/repos/sumio/conference-app-2017/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sumio/conference-app-2017/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sumio/conference-app-2017/git/refs{/sha}","trees_url":"https://api.github.com/repos/sumio/conference-app-2017/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sumio/conference-app-2017/statuses/{sha}","languages_url":"https://api.github.com/repos/sumio/conference-app-2017/languages","stargazers_url":"https://api.github.com/repos/sumio/conference-app-2017/stargazers","contributors_url":"https://api.github.com/repos/sumio/conference-app-2017/contributors","subscribers_url":"https://api.github.com/repos/sumio/conference-app-2017/subscribers","subscription_url":"https://api.github.com/repos/sumio/conference-app-2017/subscription","commits_url":"https://api.github.com/repos/sumio/conference-app-2017/commits{/sha}","git_commits_url":"https://api.github.com/repos/sumio/conference-app-2017/git/commits{/sha}","comments_url":"https://api.github.com/repos/sumio/conference-app-2017/comments{/number}","issue_comment_url":"https://api.github.com/repos/sumio/conference-app-2017/issues/comments{/number}","contents_url":"https://api.github.com/repos/sumio/conference-app-2017/contents/{+path}","compare_url":"https://api.github.com/repos/sumio/conference-app-2017/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sumio/conference-app-2017/merges","archive_url":"https://api.github.com/repos/sumio/conference-app-2017/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sumio/conference-app-2017/downloads","issues_url":"https://api.github.com/repos/sumio/conference-app-2017/issues{/number}","pulls_url":"https://api.github.com/repos/sumio/conference-app-2017/pulls{/number}","milestones_url":"https://api.github.com/repos/sumio/conference-app-2017/milestones{/number}","notifications_url":"https://api.github.com/repos/sumio/conference-app-2017/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sumio/conference-app-2017/labels{/name}","releases_url":"https://api.github.com/repos/sumio/conference-app-2017/releases{/id}","deployments_url":"https://api.github.com/repos/sumio/conference-app-2017/deployments","created_at":"2017-02-19T16:00:20Z","updated_at":"2017-02-19T16:00:22Z","pushed_at":"2017-02-20T16:50:35Z","git_url":"git://github.com/sumio/conference-app-2017.git","ssh_url":"git@github.com:sumio/conference-app-2017.git","clone_url":"https://github.com/sumio/conference-app-2017.git","svn_url":"https://github.com/sumio/conference-app-2017","homepage":"","size":11949,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"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":"master"}},"base":{"label":"DroidKaigi:master","ref":"master","sha":"0748ee1fcf6e849701f946c2ad198d0db3e21202","user":{"login":"DroidKaigi","id":10727543,"avatar_url":"https://avatars.githubusercontent.com/u/10727543?v=3","gravatar_id":"","url":"https://api.github.com/users/DroidKaigi","html_url":"https://github.com/DroidKaigi","followers_url":"https://api.github.com/users/DroidKaigi/followers","following_url":"https://api.github.com/users/DroidKaigi/following{/other_user}","gists_url":"https://api.github.com/users/DroidKaigi/gists{/gist_id}","starred_url":"https://api.github.com/users/DroidKaigi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DroidKaigi/subscriptions","organizations_url":"https://api.github.com/users/DroidKaigi/orgs","repos_url":"https://api.github.com/users/DroidKaigi/repos","events_url":"https://api.github.com/users/DroidKaigi/events{/privacy}","received_events_url":"https://api.github.com/users/DroidKaigi/received_events","type":"Organization","site_admin":false},"repo":{"id":79104433,"name":"conference-app-2017","full_name":"DroidKaigi/conference-app-2017","owner":{"login":"DroidKaigi","id":10727543,"avatar_url":"https://avatars.githubusercontent.com/u/10727543?v=3","gravatar_id":"","url":"https://api.github.com/users/DroidKaigi","html_url":"https://github.com/DroidKaigi","followers_url":"https://api.github.com/users/DroidKaigi/followers","following_url":"https://api.github.com/users/DroidKaigi/following{/other_user}","gists_url":"https://api.github.com/users/DroidKaigi/gists{/gist_id}","starred_url":"https://api.github.com/users/DroidKaigi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DroidKaigi/subscriptions","organizations_url":"https://api.github.com/users/DroidKaigi/orgs","repos_url":"https://api.github.com/users/DroidKaigi/repos","events_url":"https://api.github.com/users/DroidKaigi/events{/privacy}","received_events_url":"https://api.github.com/users/DroidKaigi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DroidKaigi/conference-app-2017","description":"The Official Conference App for DroidKaigi 2017 Tokyo","fork":false,"url":"https://api.github.com/repos/DroidKaigi/conference-app-2017","forks_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/forks","keys_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/teams","hooks_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/hooks","issue_events_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/issues/events{/number}","events_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/events","assignees_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/assignees{/user}","branches_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/branches{/branch}","tags_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/tags","blobs_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/git/refs{/sha}","trees_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/statuses/{sha}","languages_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/languages","stargazers_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/stargazers","contributors_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/contributors","subscribers_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/subscribers","subscription_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/subscription","commits_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/commits{/sha}","git_commits_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/git/commits{/sha}","comments_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/comments{/number}","issue_comment_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/issues/comments{/number}","contents_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/contents/{+path}","compare_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/merges","archive_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/downloads","issues_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/issues{/number}","pulls_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/pulls{/number}","milestones_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/milestones{/number}","notifications_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/labels{/name}","releases_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/releases{/id}","deployments_url":"https://api.github.com/repos/DroidKaigi/conference-app-2017/deployments","created_at":"2017-01-16T09:47:53Z","updated_at":"2017-02-23T04:38:56Z","pushed_at":"2017-02-23T05:03:14Z","git_url":"git://github.com/DroidKaigi/conference-app-2017.git","ssh_url":"git@github.com:DroidKaigi/conference-app-2017.git","clone_url":"https://github.com/DroidKaigi/conference-app-2017.git","svn_url":"https://github.com/DroidKaigi/conference-app-2017","homepage":"","size":11961,"stargazers_count":304,"watchers_count":304,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":109,"mirror_url":null,"open_issues_count":34,"forks":109,"open_issues":34,"watchers":304,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DroidKaigi/conference-app-2017/pulls/368"},"html":{"href":"https://github.com/DroidKaigi/conference-app-2017/pull/368"},"issue":{"href":"https://api.github.com/repos/DroidKaigi/conference-app-2017/issues/368"},"comments":{"href":"https://api.github.com/repos/DroidKaigi/conference-app-2017/issues/368/comments"},"review_comments":{"href":"https://api.github.com/repos/DroidKaigi/conference-app-2017/pulls/368/comments"},"review_comment":{"href":"https://api.github.com/repos/DroidKaigi/conference-app-2017/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DroidKaigi/conference-app-2017/pulls/368/commits"},"statuses":{"href":"https://api.github.com/repos/DroidKaigi/conference-app-2017/statuses/28a50d486a767acedfcab5cb688acf0e002181fa"}}}}
{"actor":{"display_login":"konifar"}}