{"action":"created","comment":{"url":"https://api.github.com/repos/Workiva/w_common/pulls/comments/122249871","pull_request_review_id":44350383,"id":122249871,"diff_hunk":"@@ -0,0 +1,164 @@\n+// Copyright 2016 Workiva Inc.\n+//\n+// Licensed under the Apache License, Version 2.0 (the \"License\");\n+// you may not use this file except in compliance with the License.\n+// You may obtain a copy of the License at\n+//\n+//     http://www.apache.org/licenses/LICENSE-2.0\n+//\n+// Unless required by applicable law or agreed to in writing, software\n+// distributed under the License is distributed on an \"AS IS\" BASIS,\n+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+// See the License for the specific language governing permissions and\n+// limitations under the License.\n+\n+library over_react.transformer.impl_generation;\n+\n+import 'package:analyzer/analyzer.dart';\n+import 'package:barback/barback.dart';\n+import 'package:source_span/source_span.dart';\n+import 'package:transformer_utils/transformer_utils.dart';\n+\n+const String _generatedPrefix = r'_$';\n+const String _publicGeneratedPrefix = r'$';\n+\n+/// Transforms a class that has been annotated with @AutoNullFieldsOnDispose by\n+/// inserting a method that nulls-out or clears as many fields on the class as\n+/// possible. The onDispose() implementation will either be inserted or\n+/// augmented in order to call this method as the very last step.\n+void transformAutoNullClass(ClassDeclaration classDecl,\n+    TransformedSourceFile transformedFile, TransformLogger logger) {\n+  final SourceFile sourceFile = transformedFile.sourceFile;\n+\n+  // Discover all fields on the class that can either be nulled out or cleared.\n+  var clearableFieldNames = <String>[];\n+  var nullableFieldNames = <String>[];\n+  for (var member in classDecl.members) {\n+    if (member is FieldDeclaration) {\n+      if (member.isStatic) continue;\n+      for (var variable in member.fields.variables) {\n+        if (variable.isFinal || variable.isConst) {\n+          if (member.fields.type.name.name == 'List' ||\n+              member.fields.type.name.name == 'Map') {","path":"lib/src/disposable/transformer/impl_generation.dart","position":42,"original_position":42,"commit_id":"5701743924236993155e653b149449c6ad8ddf73","original_commit_id":"5701743924236993155e653b149449c6ad8ddf73","user":{"login":"jeroencranendonk-wf","id":6576568,"avatar_url":"https://avatars2.githubusercontent.com/u/6576568?v=3","gravatar_id":"","url":"https://api.github.com/users/jeroencranendonk-wf","html_url":"https://github.com/jeroencranendonk-wf","followers_url":"https://api.github.com/users/jeroencranendonk-wf/followers","following_url":"https://api.github.com/users/jeroencranendonk-wf/following{/other_user}","gists_url":"https://api.github.com/users/jeroencranendonk-wf/gists{/gist_id}","starred_url":"https://api.github.com/users/jeroencranendonk-wf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeroencranendonk-wf/subscriptions","organizations_url":"https://api.github.com/users/jeroencranendonk-wf/orgs","repos_url":"https://api.github.com/users/jeroencranendonk-wf/repos","events_url":"https://api.github.com/users/jeroencranendonk-wf/events{/privacy}","received_events_url":"https://api.github.com/users/jeroencranendonk-wf/received_events","type":"User","site_admin":false},"body":"What about Sets?","created_at":"2017-06-15T16:32:08Z","updated_at":"2017-06-15T16:32:11Z","html_url":"https://github.com/Workiva/w_common/pull/34#discussion_r122249871","pull_request_url":"https://api.github.com/repos/Workiva/w_common/pulls/34","_links":{"self":{"href":"https://api.github.com/repos/Workiva/w_common/pulls/comments/122249871"},"html":{"href":"https://github.com/Workiva/w_common/pull/34#discussion_r122249871"},"pull_request":{"href":"https://api.github.com/repos/Workiva/w_common/pulls/34"}}},"pull_request":{"url":"https://api.github.com/repos/Workiva/w_common/pulls/34","id":125854377,"html_url":"https://github.com/Workiva/w_common/pull/34","diff_url":"https://github.com/Workiva/w_common/pull/34.diff","patch_url":"https://github.com/Workiva/w_common/pull/34.patch","issue_url":"https://api.github.com/repos/Workiva/w_common/issues/34","number":34,"state":"open","locked":false,"title":"Add transformer for AutoNullFieldsOnDispose functionality","user":{"login":"evanweible-wf","id":1738457,"avatar_url":"https://avatars1.githubusercontent.com/u/1738457?v=3","gravatar_id":"","url":"https://api.github.com/users/evanweible-wf","html_url":"https://github.com/evanweible-wf","followers_url":"https://api.github.com/users/evanweible-wf/followers","following_url":"https://api.github.com/users/evanweible-wf/following{/other_user}","gists_url":"https://api.github.com/users/evanweible-wf/gists{/gist_id}","starred_url":"https://api.github.com/users/evanweible-wf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evanweible-wf/subscriptions","organizations_url":"https://api.github.com/users/evanweible-wf/orgs","repos_url":"https://api.github.com/users/evanweible-wf/repos","events_url":"https://api.github.com/users/evanweible-wf/events{/privacy}","received_events_url":"https://api.github.com/users/evanweible-wf/received_events","type":"User","site_admin":false},"body":"### Description\r\n\r\nTransformer that finds classes annotated with `@AutoNullFieldsOnDispose` and augments them such that all non-final fields are nulled-out as the last step of disposal.\r\n\r\n### Changes\r\n\r\n- Adds a `disposable_transformer.dart` entry point\r\n- Adds an `AutoNullFieldsOnDispose()` const class for annotation use\r\n\r\n### TODO\r\n\r\n- [ ] Tests\r\n\r\n### Semantic Versioning\r\n\r\n- [ ] **Patch**\r\n  - [ ] This change does not affect the public API\r\n  - [ ] This change fixes existing incorrect behavior without any additions\r\n- [ ] **Minor**\r\n  - [x] This change adds something to the public API\r\n  - [ ] This change deprecates a part of the public API\r\n* [ ] Major\r\n  - [ ] This change modifies part of the public API in a backwards-incompatible manner\r\n  - [ ] This change removes part of the public API\r\n\r\n### Testing/QA\r\n\r\n- [ ] CI passes\r\n\r\n### Code Review\r\n\r\n@dustinlessard-wf\r\n@evanweible-wf\r\n@jayudey-wf\r\n@maxwellpeterson-wf\r\n@sebastianmalysa-wf\r\n@trentgrover-wf\r\n\r\n","created_at":"2017-06-15T15:51:37Z","updated_at":"2017-06-15T16:32:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Workiva/w_common/pulls/34/commits","review_comments_url":"https://api.github.com/repos/Workiva/w_common/pulls/34/comments","review_comment_url":"https://api.github.com/repos/Workiva/w_common/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Workiva/w_common/issues/34/comments","statuses_url":"https://api.github.com/repos/Workiva/w_common/statuses/5701743924236993155e653b149449c6ad8ddf73","head":{"label":"Workiva:auto_null_fields_on_dispose_transformer","ref":"auto_null_fields_on_dispose_transformer","sha":"5701743924236993155e653b149449c6ad8ddf73","user":{"login":"Workiva","id":1087529,"avatar_url":"https://avatars0.githubusercontent.com/u/1087529?v=3","gravatar_id":"","url":"https://api.github.com/users/Workiva","html_url":"https://github.com/Workiva","followers_url":"https://api.github.com/users/Workiva/followers","following_url":"https://api.github.com/users/Workiva/following{/other_user}","gists_url":"https://api.github.com/users/Workiva/gists{/gist_id}","starred_url":"https://api.github.com/users/Workiva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Workiva/subscriptions","organizations_url":"https://api.github.com/users/Workiva/orgs","repos_url":"https://api.github.com/users/Workiva/repos","events_url":"https://api.github.com/users/Workiva/events{/privacy}","received_events_url":"https://api.github.com/users/Workiva/received_events","type":"Organization","site_admin":false},"repo":{"id":71292440,"name":"w_common","full_name":"Workiva/w_common","owner":{"login":"Workiva","id":1087529,"avatar_url":"https://avatars0.githubusercontent.com/u/1087529?v=3","gravatar_id":"","url":"https://api.github.com/users/Workiva","html_url":"https://github.com/Workiva","followers_url":"https://api.github.com/users/Workiva/followers","following_url":"https://api.github.com/users/Workiva/following{/other_user}","gists_url":"https://api.github.com/users/Workiva/gists{/gist_id}","starred_url":"https://api.github.com/users/Workiva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Workiva/subscriptions","organizations_url":"https://api.github.com/users/Workiva/orgs","repos_url":"https://api.github.com/users/Workiva/repos","events_url":"https://api.github.com/users/Workiva/events{/privacy}","received_events_url":"https://api.github.com/users/Workiva/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Workiva/w_common","description":"A collection of helpful utilities for use in Dart projects.","fork":false,"url":"https://api.github.com/repos/Workiva/w_common","forks_url":"https://api.github.com/repos/Workiva/w_common/forks","keys_url":"https://api.github.com/repos/Workiva/w_common/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Workiva/w_common/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Workiva/w_common/teams","hooks_url":"https://api.github.com/repos/Workiva/w_common/hooks","issue_events_url":"https://api.github.com/repos/Workiva/w_common/issues/events{/number}","events_url":"https://api.github.com/repos/Workiva/w_common/events","assignees_url":"https://api.github.com/repos/Workiva/w_common/assignees{/user}","branches_url":"https://api.github.com/repos/Workiva/w_common/branches{/branch}","tags_url":"https://api.github.com/repos/Workiva/w_common/tags","blobs_url":"https://api.github.com/repos/Workiva/w_common/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Workiva/w_common/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Workiva/w_common/git/refs{/sha}","trees_url":"https://api.github.com/repos/Workiva/w_common/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Workiva/w_common/statuses/{sha}","languages_url":"https://api.github.com/repos/Workiva/w_common/languages","stargazers_url":"https://api.github.com/repos/Workiva/w_common/stargazers","contributors_url":"https://api.github.com/repos/Workiva/w_common/contributors","subscribers_url":"https://api.github.com/repos/Workiva/w_common/subscribers","subscription_url":"https://api.github.com/repos/Workiva/w_common/subscription","commits_url":"https://api.github.com/repos/Workiva/w_common/commits{/sha}","git_commits_url":"https://api.github.com/repos/Workiva/w_common/git/commits{/sha}","comments_url":"https://api.github.com/repos/Workiva/w_common/comments{/number}","issue_comment_url":"https://api.github.com/repos/Workiva/w_common/issues/comments{/number}","contents_url":"https://api.github.com/repos/Workiva/w_common/contents/{+path}","compare_url":"https://api.github.com/repos/Workiva/w_common/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Workiva/w_common/merges","archive_url":"https://api.github.com/repos/Workiva/w_common/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Workiva/w_common/downloads","issues_url":"https://api.github.com/repos/Workiva/w_common/issues{/number}","pulls_url":"https://api.github.com/repos/Workiva/w_common/pulls{/number}","milestones_url":"https://api.github.com/repos/Workiva/w_common/milestones{/number}","notifications_url":"https://api.github.com/repos/Workiva/w_common/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Workiva/w_common/labels{/name}","releases_url":"https://api.github.com/repos/Workiva/w_common/releases{/id}","deployments_url":"https://api.github.com/repos/Workiva/w_common/deployments","created_at":"2016-10-18T21:21:38Z","updated_at":"2016-10-28T13:50:24Z","pushed_at":"2017-06-15T15:51:38Z","git_url":"git://github.com/Workiva/w_common.git","ssh_url":"git@github.com:Workiva/w_common.git","clone_url":"https://github.com/Workiva/w_common.git","svn_url":"https://github.com/Workiva/w_common","homepage":"","size":149,"stargazers_count":0,"watchers_count":0,"language":"Dart","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Workiva:master","ref":"master","sha":"a966012bbd026102a3c417232037733fc9f18510","user":{"login":"Workiva","id":1087529,"avatar_url":"https://avatars0.githubusercontent.com/u/1087529?v=3","gravatar_id":"","url":"https://api.github.com/users/Workiva","html_url":"https://github.com/Workiva","followers_url":"https://api.github.com/users/Workiva/followers","following_url":"https://api.github.com/users/Workiva/following{/other_user}","gists_url":"https://api.github.com/users/Workiva/gists{/gist_id}","starred_url":"https://api.github.com/users/Workiva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Workiva/subscriptions","organizations_url":"https://api.github.com/users/Workiva/orgs","repos_url":"https://api.github.com/users/Workiva/repos","events_url":"https://api.github.com/users/Workiva/events{/privacy}","received_events_url":"https://api.github.com/users/Workiva/received_events","type":"Organization","site_admin":false},"repo":{"id":71292440,"name":"w_common","full_name":"Workiva/w_common","owner":{"login":"Workiva","id":1087529,"avatar_url":"https://avatars0.githubusercontent.com/u/1087529?v=3","gravatar_id":"","url":"https://api.github.com/users/Workiva","html_url":"https://github.com/Workiva","followers_url":"https://api.github.com/users/Workiva/followers","following_url":"https://api.github.com/users/Workiva/following{/other_user}","gists_url":"https://api.github.com/users/Workiva/gists{/gist_id}","starred_url":"https://api.github.com/users/Workiva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Workiva/subscriptions","organizations_url":"https://api.github.com/users/Workiva/orgs","repos_url":"https://api.github.com/users/Workiva/repos","events_url":"https://api.github.com/users/Workiva/events{/privacy}","received_events_url":"https://api.github.com/users/Workiva/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Workiva/w_common","description":"A collection of helpful utilities for use in Dart projects.","fork":false,"url":"https://api.github.com/repos/Workiva/w_common","forks_url":"https://api.github.com/repos/Workiva/w_common/forks","keys_url":"https://api.github.com/repos/Workiva/w_common/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Workiva/w_common/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Workiva/w_common/teams","hooks_url":"https://api.github.com/repos/Workiva/w_common/hooks","issue_events_url":"https://api.github.com/repos/Workiva/w_common/issues/events{/number}","events_url":"https://api.github.com/repos/Workiva/w_common/events","assignees_url":"https://api.github.com/repos/Workiva/w_common/assignees{/user}","branches_url":"https://api.github.com/repos/Workiva/w_common/branches{/branch}","tags_url":"https://api.github.com/repos/Workiva/w_common/tags","blobs_url":"https://api.github.com/repos/Workiva/w_common/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Workiva/w_common/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Workiva/w_common/git/refs{/sha}","trees_url":"https://api.github.com/repos/Workiva/w_common/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Workiva/w_common/statuses/{sha}","languages_url":"https://api.github.com/repos/Workiva/w_common/languages","stargazers_url":"https://api.github.com/repos/Workiva/w_common/stargazers","contributors_url":"https://api.github.com/repos/Workiva/w_common/contributors","subscribers_url":"https://api.github.com/repos/Workiva/w_common/subscribers","subscription_url":"https://api.github.com/repos/Workiva/w_common/subscription","commits_url":"https://api.github.com/repos/Workiva/w_common/commits{/sha}","git_commits_url":"https://api.github.com/repos/Workiva/w_common/git/commits{/sha}","comments_url":"https://api.github.com/repos/Workiva/w_common/comments{/number}","issue_comment_url":"https://api.github.com/repos/Workiva/w_common/issues/comments{/number}","contents_url":"https://api.github.com/repos/Workiva/w_common/contents/{+path}","compare_url":"https://api.github.com/repos/Workiva/w_common/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Workiva/w_common/merges","archive_url":"https://api.github.com/repos/Workiva/w_common/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Workiva/w_common/downloads","issues_url":"https://api.github.com/repos/Workiva/w_common/issues{/number}","pulls_url":"https://api.github.com/repos/Workiva/w_common/pulls{/number}","milestones_url":"https://api.github.com/repos/Workiva/w_common/milestones{/number}","notifications_url":"https://api.github.com/repos/Workiva/w_common/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Workiva/w_common/labels{/name}","releases_url":"https://api.github.com/repos/Workiva/w_common/releases{/id}","deployments_url":"https://api.github.com/repos/Workiva/w_common/deployments","created_at":"2016-10-18T21:21:38Z","updated_at":"2016-10-28T13:50:24Z","pushed_at":"2017-06-15T15:51:38Z","git_url":"git://github.com/Workiva/w_common.git","ssh_url":"git@github.com:Workiva/w_common.git","clone_url":"https://github.com/Workiva/w_common.git","svn_url":"https://github.com/Workiva/w_common","homepage":"","size":149,"stargazers_count":0,"watchers_count":0,"language":"Dart","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Workiva/w_common/pulls/34"},"html":{"href":"https://github.com/Workiva/w_common/pull/34"},"issue":{"href":"https://api.github.com/repos/Workiva/w_common/issues/34"},"comments":{"href":"https://api.github.com/repos/Workiva/w_common/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/Workiva/w_common/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/Workiva/w_common/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Workiva/w_common/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/Workiva/w_common/statuses/5701743924236993155e653b149449c6ad8ddf73"}}}}
{"actor":{"display_login":"jeroencranendonk-wf"}}