{"action":"created","comment":{"url":"https://api.github.com/repos/xitu/gold-miner/pulls/comments/126626676","pull_request_review_id":49116567,"id":126626676,"diff_hunk":"@@ -215,48 +216,48 @@ class MyClass {\n }\n ```\n \n-That code looks neat and simple, but what happens behind the scenes is quite ugly.\n+这段代码看起来干净整洁，但是幕后发生的事情却十分不堪。\n \n-For the same reasons mentioned above, **accessing a **`**private**`** constant declared in the companion object will actually generate an additional synthetic getter method in the companion object implementation class**.\n+基于上述原因，**访问**一个在伴生对象中声明为**私有**的常量实际上会在这个伴生对象的实现类中生成一个额外的、合成的 getter 方法。\n \n ```\n GETSTATIC be/myapplication/MyClass.Companion : Lbe/myapplication/MyClass$Companion;\n INVOKESTATIC be/myapplication/MyClass$Companion.access$getTAG$p (Lbe/myapplication/MyClass$Companion;)Ljava/lang/String;\n ASTORE 1\n ```\n \n-But things get worse. The synthetic method does not actually return the value; it calls an instance method which is a getter generated by Kotlin:\n+但是更糟的是，这个合成方法实际上并没有返回值；它调用了 Kotlin 生成的实例 getter 方法：\n \n ```\n ALOAD 0\n INVOKESPECIAL be/myapplication/MyClass$Companion.getTAG ()Ljava/lang/String;\n ARETURN\n ```\n \n-When the constant is declared `public` instead of `private`, this getter method is public and able to be called directly, so the synthetic method of the previous step is not needed. But Kotlin still requires calling a getter method to read a constant.\n+当常量被声明为 `public` 而不是 `private` 时，getter 方法是公共的并且可以被直接调用，因此不需要上一步的方法。但是 Kotlin 仍然必须通过调用 getter 方法来访问常量。\n \n-So, are we done yet? No! It turns out that in order to store the constant value, the Kotlin compiler generates an actual `private static final` field at the main class level and not inside the companion object. But, **because the static field is declared private in the class, another synthetic method is needed to access it from the companion object**.\n+所以我们完成了吗？并没有！事实证明，为了存储常量值，Kotlin 编译器实际上在主类级别上而不是伴生对象中生成了一个 `private static final` 字段。但是，**因为在类中静态字段被声明为私有的，在伴生对象中需要有一个另外的合成方法来访问它**","path":"TODO/exploring-kotlins-hidden-costs-part-1.md","position":267,"original_position":267,"commit_id":"f2ddb0b2ab505c336a0148683593ea1600e5cf8a","original_commit_id":"f2ddb0b2ab505c336a0148683593ea1600e5cf8a","user":{"login":"phxnirvana","id":1379562,"avatar_url":"https://avatars3.githubusercontent.com/u/1379562?v=3","gravatar_id":"","url":"https://api.github.com/users/phxnirvana","html_url":"https://github.com/phxnirvana","followers_url":"https://api.github.com/users/phxnirvana/followers","following_url":"https://api.github.com/users/phxnirvana/following{/other_user}","gists_url":"https://api.github.com/users/phxnirvana/gists{/gist_id}","starred_url":"https://api.github.com/users/phxnirvana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phxnirvana/subscriptions","organizations_url":"https://api.github.com/users/phxnirvana/orgs","repos_url":"https://api.github.com/users/phxnirvana/repos","events_url":"https://api.github.com/users/phxnirvana/events{/privacy}","received_events_url":"https://api.github.com/users/phxnirvana/received_events","type":"User","site_admin":false},"body":"> 所以我们完成了吗？\r\n\r\n所以我们（真的）解决了（问题）吗？","created_at":"2017-07-11T08:32:12Z","updated_at":"2017-07-11T08:41:56Z","html_url":"https://github.com/xitu/gold-miner/pull/1843#discussion_r126626676","pull_request_url":"https://api.github.com/repos/xitu/gold-miner/pulls/1843","_links":{"self":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/comments/126626676"},"html":{"href":"https://github.com/xitu/gold-miner/pull/1843#discussion_r126626676"},"pull_request":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/1843"}}},"pull_request":{"url":"https://api.github.com/repos/xitu/gold-miner/pulls/1843","id":128714682,"html_url":"https://github.com/xitu/gold-miner/pull/1843","diff_url":"https://github.com/xitu/gold-miner/pull/1843.diff","patch_url":"https://github.com/xitu/gold-miner/pull/1843.patch","issue_url":"https://api.github.com/repos/xitu/gold-miner/issues/1843","number":1843,"state":"open","locked":false,"title":"探索 Kotlin 中的隐性成本（第一部分）","user":{"login":"Feximin","id":7529206,"avatar_url":"https://avatars3.githubusercontent.com/u/7529206?v=3","gravatar_id":"","url":"https://api.github.com/users/Feximin","html_url":"https://github.com/Feximin","followers_url":"https://api.github.com/users/Feximin/followers","following_url":"https://api.github.com/users/Feximin/following{/other_user}","gists_url":"https://api.github.com/users/Feximin/gists{/gist_id}","starred_url":"https://api.github.com/users/Feximin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Feximin/subscriptions","organizations_url":"https://api.github.com/users/Feximin/orgs","repos_url":"https://api.github.com/users/Feximin/repos","events_url":"https://api.github.com/users/Feximin/events{/privacy}","received_events_url":"https://api.github.com/users/Feximin/received_events","type":"User","site_admin":false},"body":"[Exploring Kotlin’s hidden costs — Part 1](https://github.com/xitu/gold-miner/issues/1812)\r\n初翻完成，请校对大佬指正T__\r\n\r\nIssue 地址：#1812","created_at":"2017-07-04T02:16:30Z","updated_at":"2017-07-11T08:41:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"30b0680b4605be9eda7004fd1dfcb01daa7af01a","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/xitu/gold-miner/pulls/1843/commits","review_comments_url":"https://api.github.com/repos/xitu/gold-miner/pulls/1843/comments","review_comment_url":"https://api.github.com/repos/xitu/gold-miner/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xitu/gold-miner/issues/1843/comments","statuses_url":"https://api.github.com/repos/xitu/gold-miner/statuses/f2ddb0b2ab505c336a0148683593ea1600e5cf8a","head":{"label":"Feximin:translate1","ref":"translate1","sha":"f2ddb0b2ab505c336a0148683593ea1600e5cf8a","user":{"login":"Feximin","id":7529206,"avatar_url":"https://avatars3.githubusercontent.com/u/7529206?v=3","gravatar_id":"","url":"https://api.github.com/users/Feximin","html_url":"https://github.com/Feximin","followers_url":"https://api.github.com/users/Feximin/followers","following_url":"https://api.github.com/users/Feximin/following{/other_user}","gists_url":"https://api.github.com/users/Feximin/gists{/gist_id}","starred_url":"https://api.github.com/users/Feximin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Feximin/subscriptions","organizations_url":"https://api.github.com/users/Feximin/orgs","repos_url":"https://api.github.com/users/Feximin/repos","events_url":"https://api.github.com/users/Feximin/events{/privacy}","received_events_url":"https://api.github.com/users/Feximin/received_events","type":"User","site_admin":false},"repo":{"id":95284420,"name":"gold-miner","full_name":"Feximin/gold-miner","owner":{"login":"Feximin","id":7529206,"avatar_url":"https://avatars3.githubusercontent.com/u/7529206?v=3","gravatar_id":"","url":"https://api.github.com/users/Feximin","html_url":"https://github.com/Feximin","followers_url":"https://api.github.com/users/Feximin/followers","following_url":"https://api.github.com/users/Feximin/following{/other_user}","gists_url":"https://api.github.com/users/Feximin/gists{/gist_id}","starred_url":"https://api.github.com/users/Feximin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Feximin/subscriptions","organizations_url":"https://api.github.com/users/Feximin/orgs","repos_url":"https://api.github.com/users/Feximin/repos","events_url":"https://api.github.com/users/Feximin/events{/privacy}","received_events_url":"https://api.github.com/users/Feximin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Feximin/gold-miner","description":"掘金翻译计划，翻译掘金上优质的英文文章","fork":true,"url":"https://api.github.com/repos/Feximin/gold-miner","forks_url":"https://api.github.com/repos/Feximin/gold-miner/forks","keys_url":"https://api.github.com/repos/Feximin/gold-miner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Feximin/gold-miner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Feximin/gold-miner/teams","hooks_url":"https://api.github.com/repos/Feximin/gold-miner/hooks","issue_events_url":"https://api.github.com/repos/Feximin/gold-miner/issues/events{/number}","events_url":"https://api.github.com/repos/Feximin/gold-miner/events","assignees_url":"https://api.github.com/repos/Feximin/gold-miner/assignees{/user}","branches_url":"https://api.github.com/repos/Feximin/gold-miner/branches{/branch}","tags_url":"https://api.github.com/repos/Feximin/gold-miner/tags","blobs_url":"https://api.github.com/repos/Feximin/gold-miner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Feximin/gold-miner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Feximin/gold-miner/git/refs{/sha}","trees_url":"https://api.github.com/repos/Feximin/gold-miner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Feximin/gold-miner/statuses/{sha}","languages_url":"https://api.github.com/repos/Feximin/gold-miner/languages","stargazers_url":"https://api.github.com/repos/Feximin/gold-miner/stargazers","contributors_url":"https://api.github.com/repos/Feximin/gold-miner/contributors","subscribers_url":"https://api.github.com/repos/Feximin/gold-miner/subscribers","subscription_url":"https://api.github.com/repos/Feximin/gold-miner/subscription","commits_url":"https://api.github.com/repos/Feximin/gold-miner/commits{/sha}","git_commits_url":"https://api.github.com/repos/Feximin/gold-miner/git/commits{/sha}","comments_url":"https://api.github.com/repos/Feximin/gold-miner/comments{/number}","issue_comment_url":"https://api.github.com/repos/Feximin/gold-miner/issues/comments{/number}","contents_url":"https://api.github.com/repos/Feximin/gold-miner/contents/{+path}","compare_url":"https://api.github.com/repos/Feximin/gold-miner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Feximin/gold-miner/merges","archive_url":"https://api.github.com/repos/Feximin/gold-miner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Feximin/gold-miner/downloads","issues_url":"https://api.github.com/repos/Feximin/gold-miner/issues{/number}","pulls_url":"https://api.github.com/repos/Feximin/gold-miner/pulls{/number}","milestones_url":"https://api.github.com/repos/Feximin/gold-miner/milestones{/number}","notifications_url":"https://api.github.com/repos/Feximin/gold-miner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Feximin/gold-miner/labels{/name}","releases_url":"https://api.github.com/repos/Feximin/gold-miner/releases{/id}","deployments_url":"https://api.github.com/repos/Feximin/gold-miner/deployments","created_at":"2017-06-24T08:06:53Z","updated_at":"2017-06-24T03:23:43Z","pushed_at":"2017-07-11T05:56:28Z","git_url":"git://github.com/Feximin/gold-miner.git","ssh_url":"git@github.com:Feximin/gold-miner.git","clone_url":"https://github.com/Feximin/gold-miner.git","svn_url":"https://github.com/Feximin/gold-miner","homepage":"https://juejin.im/tag/掘金翻译计划","size":24713,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"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":"xitu:master","ref":"master","sha":"b082c51765202115ad309f3be78ff3ef79e15fab","user":{"login":"xitu","id":10482599,"avatar_url":"https://avatars1.githubusercontent.com/u/10482599?v=3","gravatar_id":"","url":"https://api.github.com/users/xitu","html_url":"https://github.com/xitu","followers_url":"https://api.github.com/users/xitu/followers","following_url":"https://api.github.com/users/xitu/following{/other_user}","gists_url":"https://api.github.com/users/xitu/gists{/gist_id}","starred_url":"https://api.github.com/users/xitu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xitu/subscriptions","organizations_url":"https://api.github.com/users/xitu/orgs","repos_url":"https://api.github.com/users/xitu/repos","events_url":"https://api.github.com/users/xitu/events{/privacy}","received_events_url":"https://api.github.com/users/xitu/received_events","type":"Organization","site_admin":false},"repo":{"id":45512989,"name":"gold-miner","full_name":"xitu/gold-miner","owner":{"login":"xitu","id":10482599,"avatar_url":"https://avatars1.githubusercontent.com/u/10482599?v=3","gravatar_id":"","url":"https://api.github.com/users/xitu","html_url":"https://github.com/xitu","followers_url":"https://api.github.com/users/xitu/followers","following_url":"https://api.github.com/users/xitu/following{/other_user}","gists_url":"https://api.github.com/users/xitu/gists{/gist_id}","starred_url":"https://api.github.com/users/xitu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xitu/subscriptions","organizations_url":"https://api.github.com/users/xitu/orgs","repos_url":"https://api.github.com/users/xitu/repos","events_url":"https://api.github.com/users/xitu/events{/privacy}","received_events_url":"https://api.github.com/users/xitu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xitu/gold-miner","description":"掘金翻译计划，翻译掘金上优质的英文文章","fork":false,"url":"https://api.github.com/repos/xitu/gold-miner","forks_url":"https://api.github.com/repos/xitu/gold-miner/forks","keys_url":"https://api.github.com/repos/xitu/gold-miner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xitu/gold-miner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xitu/gold-miner/teams","hooks_url":"https://api.github.com/repos/xitu/gold-miner/hooks","issue_events_url":"https://api.github.com/repos/xitu/gold-miner/issues/events{/number}","events_url":"https://api.github.com/repos/xitu/gold-miner/events","assignees_url":"https://api.github.com/repos/xitu/gold-miner/assignees{/user}","branches_url":"https://api.github.com/repos/xitu/gold-miner/branches{/branch}","tags_url":"https://api.github.com/repos/xitu/gold-miner/tags","blobs_url":"https://api.github.com/repos/xitu/gold-miner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xitu/gold-miner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xitu/gold-miner/git/refs{/sha}","trees_url":"https://api.github.com/repos/xitu/gold-miner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xitu/gold-miner/statuses/{sha}","languages_url":"https://api.github.com/repos/xitu/gold-miner/languages","stargazers_url":"https://api.github.com/repos/xitu/gold-miner/stargazers","contributors_url":"https://api.github.com/repos/xitu/gold-miner/contributors","subscribers_url":"https://api.github.com/repos/xitu/gold-miner/subscribers","subscription_url":"https://api.github.com/repos/xitu/gold-miner/subscription","commits_url":"https://api.github.com/repos/xitu/gold-miner/commits{/sha}","git_commits_url":"https://api.github.com/repos/xitu/gold-miner/git/commits{/sha}","comments_url":"https://api.github.com/repos/xitu/gold-miner/comments{/number}","issue_comment_url":"https://api.github.com/repos/xitu/gold-miner/issues/comments{/number}","contents_url":"https://api.github.com/repos/xitu/gold-miner/contents/{+path}","compare_url":"https://api.github.com/repos/xitu/gold-miner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xitu/gold-miner/merges","archive_url":"https://api.github.com/repos/xitu/gold-miner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xitu/gold-miner/downloads","issues_url":"https://api.github.com/repos/xitu/gold-miner/issues{/number}","pulls_url":"https://api.github.com/repos/xitu/gold-miner/pulls{/number}","milestones_url":"https://api.github.com/repos/xitu/gold-miner/milestones{/number}","notifications_url":"https://api.github.com/repos/xitu/gold-miner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xitu/gold-miner/labels{/name}","releases_url":"https://api.github.com/repos/xitu/gold-miner/releases{/id}","deployments_url":"https://api.github.com/repos/xitu/gold-miner/deployments","created_at":"2015-11-04T03:29:13Z","updated_at":"2017-07-11T07:54:15Z","pushed_at":"2017-07-11T05:58:58Z","git_url":"git://github.com/xitu/gold-miner.git","ssh_url":"git@github.com:xitu/gold-miner.git","clone_url":"https://github.com/xitu/gold-miner.git","svn_url":"https://github.com/xitu/gold-miner","homepage":"https://juejin.im/tag/掘金翻译计划","size":24868,"stargazers_count":8347,"watchers_count":8347,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1553,"mirror_url":null,"open_issues_count":34,"forks":1553,"open_issues":34,"watchers":8347,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/1843"},"html":{"href":"https://github.com/xitu/gold-miner/pull/1843"},"issue":{"href":"https://api.github.com/repos/xitu/gold-miner/issues/1843"},"comments":{"href":"https://api.github.com/repos/xitu/gold-miner/issues/1843/comments"},"review_comments":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/1843/comments"},"review_comment":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/1843/commits"},"statuses":{"href":"https://api.github.com/repos/xitu/gold-miner/statuses/f2ddb0b2ab505c336a0148683593ea1600e5cf8a"}}}}
{"actor":{"display_login":"phxnirvana"}}