{"action":"created","comment":{"url":"https://api.github.com/repos/apache/twill/pulls/comments/131708495","pull_request_review_id":54714198,"id":131708495,"diff_hunk":"@@ -171,9 +168,27 @@ public String getKafkaZKConnect() {\n   /**\n    * Returns the minimum heap ratio ({@link Configs.Keys#HEAP_RESERVED_MIN_RATIO}) based on the given configuration.\n    */\n-  private double getMinHeapRatio(Map<String, String> config) {\n-    return config.containsKey(Configs.Keys.HEAP_RESERVED_MIN_RATIO) ?\n-      Double.parseDouble(config.get(Configs.Keys.HEAP_RESERVED_MIN_RATIO)) :\n-      Configs.Defaults.HEAP_RESERVED_MIN_RATIO;\n+  private double getMinHeapRatio(@Nullable Map<String, String> config, double defaultValue) {\n+    if (config == null) {","path":"twill-core/src/main/java/org/apache/twill/internal/TwillRuntimeSpecification.java","position":null,"original_position":49,"commit_id":"8a42f8c720462b566b8f59de7a23fb8400b98fcb","original_commit_id":"4efe21fbc535a7717fe25a949fa5563253635f82","user":{"login":"anew","id":483004,"avatar_url":"https://avatars2.githubusercontent.com/u/483004?v=4","gravatar_id":"","url":"https://api.github.com/users/anew","html_url":"https://github.com/anew","followers_url":"https://api.github.com/users/anew/followers","following_url":"https://api.github.com/users/anew/following{/other_user}","gists_url":"https://api.github.com/users/anew/gists{/gist_id}","starred_url":"https://api.github.com/users/anew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anew/subscriptions","organizations_url":"https://api.github.com/users/anew/orgs","repos_url":"https://api.github.com/users/anew/repos","events_url":"https://api.github.com/users/anew/events{/privacy}","received_events_url":"https://api.github.com/users/anew/received_events","type":"User","site_admin":false},"body":"I think this would be easier to read, and it would give better errors, as follows:\r\n```\r\nif (config == null || !config.containsKey(...)) {\r\n  return defaultValue;\r\n} \r\ntry {\r\n  double ratio = Double.parseDouble(config.get(...));\r\n} catch (NumberFormatException) {\r\n  // either warn or throw a more informative exn (including runnable name and the bad value)\r\n}\r\nif (ratio <= 0d) {\r\n  // either warn or throw a more informative exn (including runnable name and the bad value)\r\n}\r\nreturn ratio;\r\n```","created_at":"2017-08-07T16:58:32Z","updated_at":"2017-08-07T16:58:33Z","html_url":"https://github.com/apache/twill/pull/59#discussion_r131708495","pull_request_url":"https://api.github.com/repos/apache/twill/pulls/59","_links":{"self":{"href":"https://api.github.com/repos/apache/twill/pulls/comments/131708495"},"html":{"href":"https://github.com/apache/twill/pull/59#discussion_r131708495"},"pull_request":{"href":"https://api.github.com/repos/apache/twill/pulls/59"}}},"pull_request":{"url":"https://api.github.com/repos/apache/twill/pulls/59","id":134273810,"html_url":"https://github.com/apache/twill/pull/59","diff_url":"https://github.com/apache/twill/pull/59.diff","patch_url":"https://github.com/apache/twill/pull/59.patch","issue_url":"https://api.github.com/repos/apache/twill/issues/59","number":59,"state":"open","locked":false,"title":"(TWILL-241) Added per runnable configuration and jvm options support","user":{"login":"chtyim","id":885032,"avatar_url":"https://avatars1.githubusercontent.com/u/885032?v=4","gravatar_id":"","url":"https://api.github.com/users/chtyim","html_url":"https://github.com/chtyim","followers_url":"https://api.github.com/users/chtyim/followers","following_url":"https://api.github.com/users/chtyim/following{/other_user}","gists_url":"https://api.github.com/users/chtyim/gists{/gist_id}","starred_url":"https://api.github.com/users/chtyim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chtyim/subscriptions","organizations_url":"https://api.github.com/users/chtyim/orgs","repos_url":"https://api.github.com/users/chtyim/repos","events_url":"https://api.github.com/users/chtyim/events{/privacy}","received_events_url":"https://api.github.com/users/chtyim/received_events","type":"User","site_admin":false},"body":"This PR has two commits, one for adding per runnable configuration, the other for adding per runnable jvm options.","created_at":"2017-08-05T01:08:23Z","updated_at":"2017-08-07T16:58:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f765d8df2f37759cfd76fee747ab4340453a6d84","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/twill/pulls/59/commits","review_comments_url":"https://api.github.com/repos/apache/twill/pulls/59/comments","review_comment_url":"https://api.github.com/repos/apache/twill/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/twill/issues/59/comments","statuses_url":"https://api.github.com/repos/apache/twill/statuses/8a42f8c720462b566b8f59de7a23fb8400b98fcb","head":{"label":"chtyim:feature/TWILL-241-per-runnable-opts","ref":"feature/TWILL-241-per-runnable-opts","sha":"8a42f8c720462b566b8f59de7a23fb8400b98fcb","user":{"login":"chtyim","id":885032,"avatar_url":"https://avatars1.githubusercontent.com/u/885032?v=4","gravatar_id":"","url":"https://api.github.com/users/chtyim","html_url":"https://github.com/chtyim","followers_url":"https://api.github.com/users/chtyim/followers","following_url":"https://api.github.com/users/chtyim/following{/other_user}","gists_url":"https://api.github.com/users/chtyim/gists{/gist_id}","starred_url":"https://api.github.com/users/chtyim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chtyim/subscriptions","organizations_url":"https://api.github.com/users/chtyim/orgs","repos_url":"https://api.github.com/users/chtyim/repos","events_url":"https://api.github.com/users/chtyim/events{/privacy}","received_events_url":"https://api.github.com/users/chtyim/received_events","type":"User","site_admin":false},"repo":{"id":66505484,"name":"twill","full_name":"chtyim/twill","owner":{"login":"chtyim","id":885032,"avatar_url":"https://avatars1.githubusercontent.com/u/885032?v=4","gravatar_id":"","url":"https://api.github.com/users/chtyim","html_url":"https://github.com/chtyim","followers_url":"https://api.github.com/users/chtyim/followers","following_url":"https://api.github.com/users/chtyim/following{/other_user}","gists_url":"https://api.github.com/users/chtyim/gists{/gist_id}","starred_url":"https://api.github.com/users/chtyim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chtyim/subscriptions","organizations_url":"https://api.github.com/users/chtyim/orgs","repos_url":"https://api.github.com/users/chtyim/repos","events_url":"https://api.github.com/users/chtyim/events{/privacy}","received_events_url":"https://api.github.com/users/chtyim/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chtyim/twill","description":"Mirror of Apache Twill","fork":true,"url":"https://api.github.com/repos/chtyim/twill","forks_url":"https://api.github.com/repos/chtyim/twill/forks","keys_url":"https://api.github.com/repos/chtyim/twill/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chtyim/twill/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chtyim/twill/teams","hooks_url":"https://api.github.com/repos/chtyim/twill/hooks","issue_events_url":"https://api.github.com/repos/chtyim/twill/issues/events{/number}","events_url":"https://api.github.com/repos/chtyim/twill/events","assignees_url":"https://api.github.com/repos/chtyim/twill/assignees{/user}","branches_url":"https://api.github.com/repos/chtyim/twill/branches{/branch}","tags_url":"https://api.github.com/repos/chtyim/twill/tags","blobs_url":"https://api.github.com/repos/chtyim/twill/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chtyim/twill/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chtyim/twill/git/refs{/sha}","trees_url":"https://api.github.com/repos/chtyim/twill/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chtyim/twill/statuses/{sha}","languages_url":"https://api.github.com/repos/chtyim/twill/languages","stargazers_url":"https://api.github.com/repos/chtyim/twill/stargazers","contributors_url":"https://api.github.com/repos/chtyim/twill/contributors","subscribers_url":"https://api.github.com/repos/chtyim/twill/subscribers","subscription_url":"https://api.github.com/repos/chtyim/twill/subscription","commits_url":"https://api.github.com/repos/chtyim/twill/commits{/sha}","git_commits_url":"https://api.github.com/repos/chtyim/twill/git/commits{/sha}","comments_url":"https://api.github.com/repos/chtyim/twill/comments{/number}","issue_comment_url":"https://api.github.com/repos/chtyim/twill/issues/comments{/number}","contents_url":"https://api.github.com/repos/chtyim/twill/contents/{+path}","compare_url":"https://api.github.com/repos/chtyim/twill/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chtyim/twill/merges","archive_url":"https://api.github.com/repos/chtyim/twill/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chtyim/twill/downloads","issues_url":"https://api.github.com/repos/chtyim/twill/issues{/number}","pulls_url":"https://api.github.com/repos/chtyim/twill/pulls{/number}","milestones_url":"https://api.github.com/repos/chtyim/twill/milestones{/number}","notifications_url":"https://api.github.com/repos/chtyim/twill/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chtyim/twill/labels{/name}","releases_url":"https://api.github.com/repos/chtyim/twill/releases{/id}","deployments_url":"https://api.github.com/repos/chtyim/twill/deployments","created_at":"2016-08-24T22:53:29Z","updated_at":"2016-08-24T22:53:31Z","pushed_at":"2017-08-05T09:19:58Z","git_url":"git://github.com/chtyim/twill.git","ssh_url":"git@github.com:chtyim/twill.git","clone_url":"https://github.com/chtyim/twill.git","svn_url":"https://github.com/chtyim/twill","homepage":null,"size":10877,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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":"apache:master","ref":"master","sha":"dbbc2a349636cbc2f0c5991f5ad5281d97c0cbb0","user":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":64458355,"name":"twill","full_name":"apache/twill","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/twill","description":"Mirror of Apache Twill","fork":false,"url":"https://api.github.com/repos/apache/twill","forks_url":"https://api.github.com/repos/apache/twill/forks","keys_url":"https://api.github.com/repos/apache/twill/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/twill/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/twill/teams","hooks_url":"https://api.github.com/repos/apache/twill/hooks","issue_events_url":"https://api.github.com/repos/apache/twill/issues/events{/number}","events_url":"https://api.github.com/repos/apache/twill/events","assignees_url":"https://api.github.com/repos/apache/twill/assignees{/user}","branches_url":"https://api.github.com/repos/apache/twill/branches{/branch}","tags_url":"https://api.github.com/repos/apache/twill/tags","blobs_url":"https://api.github.com/repos/apache/twill/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/twill/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/twill/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/twill/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/twill/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/twill/languages","stargazers_url":"https://api.github.com/repos/apache/twill/stargazers","contributors_url":"https://api.github.com/repos/apache/twill/contributors","subscribers_url":"https://api.github.com/repos/apache/twill/subscribers","subscription_url":"https://api.github.com/repos/apache/twill/subscription","commits_url":"https://api.github.com/repos/apache/twill/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/twill/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/twill/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/twill/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/twill/contents/{+path}","compare_url":"https://api.github.com/repos/apache/twill/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/twill/merges","archive_url":"https://api.github.com/repos/apache/twill/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/twill/downloads","issues_url":"https://api.github.com/repos/apache/twill/issues{/number}","pulls_url":"https://api.github.com/repos/apache/twill/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/twill/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/twill/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/twill/labels{/name}","releases_url":"https://api.github.com/repos/apache/twill/releases{/id}","deployments_url":"https://api.github.com/repos/apache/twill/deployments","created_at":"2016-07-29T07:00:06Z","updated_at":"2017-07-24T18:38:28Z","pushed_at":"2017-08-05T09:19:59Z","git_url":"git://github.com/apache/twill.git","ssh_url":"git@github.com:apache/twill.git","clone_url":"https://github.com/apache/twill.git","svn_url":"https://github.com/apache/twill","homepage":null,"size":11841,"stargazers_count":24,"watchers_count":24,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":26,"mirror_url":"git://git.apache.org/twill.git","open_issues_count":3,"forks":26,"open_issues":3,"watchers":24,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/twill/pulls/59"},"html":{"href":"https://github.com/apache/twill/pull/59"},"issue":{"href":"https://api.github.com/repos/apache/twill/issues/59"},"comments":{"href":"https://api.github.com/repos/apache/twill/issues/59/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/twill/pulls/59/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/twill/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/twill/pulls/59/commits"},"statuses":{"href":"https://api.github.com/repos/apache/twill/statuses/8a42f8c720462b566b8f59de7a23fb8400b98fcb"}}}}
{"actor":{"display_login":"anew"}}