{"action":"created","comment":{"url":"https://api.github.com/repos/dart-lang/vm_service_drivers/pulls/comments/42313975","id":42313975,"diff_hunk":"@@ -895,8 +897,13 @@ class TypeRef {\n       if (isArray) {\n         print('skipped accessor body for $propertyName');\n       } else {\n-        writer.addLine(\n-            'return $name.valueOf(json.get(\"$propertyName\").getAsString());');\n+        writer\n+            .addLine('String name = json.get(\"$propertyName\").getAsString();');\n+        writer.addLine('try {');\n+        writer.addLine('  return $name.valueOf(name);');\n+        writer.addLine('} catch (IllegalArgumentException e) {');\n+        writer.addLine('  return $name.Unknown;');","path":"dart/tool/java/generate_java.dart","position":39,"original_position":39,"commit_id":"84f0735c3fd78fa444106d30b3f49faddb045594","original_commit_id":"84f0735c3fd78fa444106d30b3f49faddb045594","user":{"login":"devoncarew","id":1269969,"avatar_url":"https://avatars.githubusercontent.com/u/1269969?v=3","gravatar_id":"","url":"https://api.github.com/users/devoncarew","html_url":"https://github.com/devoncarew","followers_url":"https://api.github.com/users/devoncarew/followers","following_url":"https://api.github.com/users/devoncarew/following{/other_user}","gists_url":"https://api.github.com/users/devoncarew/gists{/gist_id}","starred_url":"https://api.github.com/users/devoncarew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devoncarew/subscriptions","organizations_url":"https://api.github.com/users/devoncarew/orgs","repos_url":"https://api.github.com/users/devoncarew/repos","events_url":"https://api.github.com/users/devoncarew/events{/privacy}","received_events_url":"https://api.github.com/users/devoncarew/received_events","type":"User","site_admin":false},"body":"Would returning `null` instead work? That would mean that we don't have to insert an artificial enum value.","created_at":"2015-10-17T20:38:30Z","updated_at":"2015-10-17T20:38:30Z","html_url":"https://github.com/dart-lang/vm_service_drivers/pull/102#discussion_r42313975","pull_request_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/pulls/102","_links":{"self":{"href":"https://api.github.com/repos/dart-lang/vm_service_drivers/pulls/comments/42313975"},"html":{"href":"https://github.com/dart-lang/vm_service_drivers/pull/102#discussion_r42313975"},"pull_request":{"href":"https://api.github.com/repos/dart-lang/vm_service_drivers/pulls/102"}}},"pull_request":{"url":"https://api.github.com/repos/dart-lang/vm_service_drivers/pulls/102","id":47994310,"html_url":"https://github.com/dart-lang/vm_service_drivers/pull/102","diff_url":"https://github.com/dart-lang/vm_service_drivers/pull/102.diff","patch_url":"https://github.com/dart-lang/vm_service_drivers/pull/102.patch","issue_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/issues/102","number":102,"state":"open","locked":false,"title":"gracefully degrade to return \"Unknown\" if VM returns unknown enum","user":{"login":"danrubel","id":2891888,"avatar_url":"https://avatars.githubusercontent.com/u/2891888?v=3","gravatar_id":"","url":"https://api.github.com/users/danrubel","html_url":"https://github.com/danrubel","followers_url":"https://api.github.com/users/danrubel/followers","following_url":"https://api.github.com/users/danrubel/following{/other_user}","gists_url":"https://api.github.com/users/danrubel/gists{/gist_id}","starred_url":"https://api.github.com/users/danrubel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danrubel/subscriptions","organizations_url":"https://api.github.com/users/danrubel/orgs","repos_url":"https://api.github.com/users/danrubel/repos","events_url":"https://api.github.com/users/danrubel/events{/privacy}","received_events_url":"https://api.github.com/users/danrubel/received_events","type":"User","site_admin":false},"body":"@devoncarew \r\ngracefully degrade to return \"Unknown\" if VM returns unknown enum\r\nsort enum values\r\nupdate docs","created_at":"2015-10-17T20:12:42Z","updated_at":"2015-10-17T20:38:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a40e4f98066426a8aa30df27758a4e58673e7a48","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/pulls/102/commits","review_comments_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/pulls/102/comments","review_comment_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/issues/102/comments","statuses_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/statuses/84f0735c3fd78fa444106d30b3f49faddb045594","head":{"label":"dart-lang:enum-cleanup","ref":"enum-cleanup","sha":"84f0735c3fd78fa444106d30b3f49faddb045594","user":{"login":"dart-lang","id":1609975,"avatar_url":"https://avatars.githubusercontent.com/u/1609975?v=3","gravatar_id":"","url":"https://api.github.com/users/dart-lang","html_url":"https://github.com/dart-lang","followers_url":"https://api.github.com/users/dart-lang/followers","following_url":"https://api.github.com/users/dart-lang/following{/other_user}","gists_url":"https://api.github.com/users/dart-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/dart-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dart-lang/subscriptions","organizations_url":"https://api.github.com/users/dart-lang/orgs","repos_url":"https://api.github.com/users/dart-lang/repos","events_url":"https://api.github.com/users/dart-lang/events{/privacy}","received_events_url":"https://api.github.com/users/dart-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":41927271,"name":"vm_service_drivers","full_name":"dart-lang/vm_service_drivers","owner":{"login":"dart-lang","id":1609975,"avatar_url":"https://avatars.githubusercontent.com/u/1609975?v=3","gravatar_id":"","url":"https://api.github.com/users/dart-lang","html_url":"https://github.com/dart-lang","followers_url":"https://api.github.com/users/dart-lang/followers","following_url":"https://api.github.com/users/dart-lang/following{/other_user}","gists_url":"https://api.github.com/users/dart-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/dart-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dart-lang/subscriptions","organizations_url":"https://api.github.com/users/dart-lang/orgs","repos_url":"https://api.github.com/users/dart-lang/repos","events_url":"https://api.github.com/users/dart-lang/events{/privacy}","received_events_url":"https://api.github.com/users/dart-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dart-lang/vm_service_drivers","description":"Libraries to access the Dart VM Service Protocol","fork":false,"url":"https://api.github.com/repos/dart-lang/vm_service_drivers","forks_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/forks","keys_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/teams","hooks_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/hooks","issue_events_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/issues/events{/number}","events_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/events","assignees_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/assignees{/user}","branches_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/branches{/branch}","tags_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/tags","blobs_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/git/refs{/sha}","trees_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/statuses/{sha}","languages_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/languages","stargazers_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/stargazers","contributors_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/contributors","subscribers_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/subscribers","subscription_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/subscription","commits_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/commits{/sha}","git_commits_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/git/commits{/sha}","comments_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/comments{/number}","issue_comment_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/issues/comments{/number}","contents_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/contents/{+path}","compare_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/merges","archive_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/downloads","issues_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/issues{/number}","pulls_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/pulls{/number}","milestones_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/milestones{/number}","notifications_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/labels{/name}","releases_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/releases{/id}","created_at":"2015-09-04T16:53:18Z","updated_at":"2015-10-14T20:45:31Z","pushed_at":"2015-10-17T20:12:42Z","git_url":"git://github.com/dart-lang/vm_service_drivers.git","ssh_url":"git@github.com:dart-lang/vm_service_drivers.git","clone_url":"https://github.com/dart-lang/vm_service_drivers.git","svn_url":"https://github.com/dart-lang/vm_service_drivers","homepage":"https://pub.dartlang.org/packages/vm_service_lib","size":3192,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":8,"forks":0,"open_issues":8,"watchers":3,"default_branch":"master"}},"base":{"label":"dart-lang:master","ref":"master","sha":"50c4b4bd7bae78111f6fb39a1898b4f2c266adb1","user":{"login":"dart-lang","id":1609975,"avatar_url":"https://avatars.githubusercontent.com/u/1609975?v=3","gravatar_id":"","url":"https://api.github.com/users/dart-lang","html_url":"https://github.com/dart-lang","followers_url":"https://api.github.com/users/dart-lang/followers","following_url":"https://api.github.com/users/dart-lang/following{/other_user}","gists_url":"https://api.github.com/users/dart-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/dart-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dart-lang/subscriptions","organizations_url":"https://api.github.com/users/dart-lang/orgs","repos_url":"https://api.github.com/users/dart-lang/repos","events_url":"https://api.github.com/users/dart-lang/events{/privacy}","received_events_url":"https://api.github.com/users/dart-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":41927271,"name":"vm_service_drivers","full_name":"dart-lang/vm_service_drivers","owner":{"login":"dart-lang","id":1609975,"avatar_url":"https://avatars.githubusercontent.com/u/1609975?v=3","gravatar_id":"","url":"https://api.github.com/users/dart-lang","html_url":"https://github.com/dart-lang","followers_url":"https://api.github.com/users/dart-lang/followers","following_url":"https://api.github.com/users/dart-lang/following{/other_user}","gists_url":"https://api.github.com/users/dart-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/dart-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dart-lang/subscriptions","organizations_url":"https://api.github.com/users/dart-lang/orgs","repos_url":"https://api.github.com/users/dart-lang/repos","events_url":"https://api.github.com/users/dart-lang/events{/privacy}","received_events_url":"https://api.github.com/users/dart-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dart-lang/vm_service_drivers","description":"Libraries to access the Dart VM Service Protocol","fork":false,"url":"https://api.github.com/repos/dart-lang/vm_service_drivers","forks_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/forks","keys_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/teams","hooks_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/hooks","issue_events_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/issues/events{/number}","events_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/events","assignees_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/assignees{/user}","branches_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/branches{/branch}","tags_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/tags","blobs_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/git/refs{/sha}","trees_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/statuses/{sha}","languages_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/languages","stargazers_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/stargazers","contributors_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/contributors","subscribers_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/subscribers","subscription_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/subscription","commits_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/commits{/sha}","git_commits_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/git/commits{/sha}","comments_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/comments{/number}","issue_comment_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/issues/comments{/number}","contents_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/contents/{+path}","compare_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/merges","archive_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/downloads","issues_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/issues{/number}","pulls_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/pulls{/number}","milestones_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/milestones{/number}","notifications_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/labels{/name}","releases_url":"https://api.github.com/repos/dart-lang/vm_service_drivers/releases{/id}","created_at":"2015-09-04T16:53:18Z","updated_at":"2015-10-14T20:45:31Z","pushed_at":"2015-10-17T20:12:42Z","git_url":"git://github.com/dart-lang/vm_service_drivers.git","ssh_url":"git@github.com:dart-lang/vm_service_drivers.git","clone_url":"https://github.com/dart-lang/vm_service_drivers.git","svn_url":"https://github.com/dart-lang/vm_service_drivers","homepage":"https://pub.dartlang.org/packages/vm_service_lib","size":3192,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":8,"forks":0,"open_issues":8,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dart-lang/vm_service_drivers/pulls/102"},"html":{"href":"https://github.com/dart-lang/vm_service_drivers/pull/102"},"issue":{"href":"https://api.github.com/repos/dart-lang/vm_service_drivers/issues/102"},"comments":{"href":"https://api.github.com/repos/dart-lang/vm_service_drivers/issues/102/comments"},"review_comments":{"href":"https://api.github.com/repos/dart-lang/vm_service_drivers/pulls/102/comments"},"review_comment":{"href":"https://api.github.com/repos/dart-lang/vm_service_drivers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dart-lang/vm_service_drivers/pulls/102/commits"},"statuses":{"href":"https://api.github.com/repos/dart-lang/vm_service_drivers/statuses/84f0735c3fd78fa444106d30b3f49faddb045594"}}}}