{"action":"created","comment":{"url":"https://api.github.com/repos/pmd/pmd/pulls/comments/140402403","pull_request_review_id":64471576,"id":140402403,"diff_hunk":"@@ -0,0 +1,61 @@\n+/**\n+ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html\n+ */\n+\n+package net.sourceforge.pmd.autofixes;\n+\n+import java.util.Objects;\n+\n+public class DocumentImp implements Document {\n+\n+    private StringBuffer stream;","path":"pmd-core/src/main/java/net/sourceforge/pmd/autofixes/DocumentImp.java","position":11,"original_position":11,"commit_id":"0ea10ce7294d0d5cfbcbbb6c106011551a10c270","original_commit_id":"0ea10ce7294d0d5cfbcbbb6c106011551a10c270","user":{"login":"gibarsin","id":9052089,"avatar_url":"https://avatars0.githubusercontent.com/u/9052089?v=4","gravatar_id":"","url":"https://api.github.com/users/gibarsin","html_url":"https://github.com/gibarsin","followers_url":"https://api.github.com/users/gibarsin/followers","following_url":"https://api.github.com/users/gibarsin/following{/other_user}","gists_url":"https://api.github.com/users/gibarsin/gists{/gist_id}","starred_url":"https://api.github.com/users/gibarsin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gibarsin/subscriptions","organizations_url":"https://api.github.com/users/gibarsin/orgs","repos_url":"https://api.github.com/users/gibarsin/repos","events_url":"https://api.github.com/users/gibarsin/events{/privacy}","received_events_url":"https://api.github.com/users/gibarsin/received_events","type":"User","site_admin":false},"body":"I did it as a proof of concept to test TextOperation, surely it will not be a final implementation. Should I move it to the test package?","created_at":"2017-09-22T02:44:32Z","updated_at":"2017-09-22T02:44:32Z","html_url":"https://github.com/pmd/pmd/pull/641#discussion_r140402403","pull_request_url":"https://api.github.com/repos/pmd/pmd/pulls/641","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/pmd/pmd/pulls/comments/140402403"},"html":{"href":"https://github.com/pmd/pmd/pull/641#discussion_r140402403"},"pull_request":{"href":"https://api.github.com/repos/pmd/pmd/pulls/641"}},"in_reply_to_id":140394637},"pull_request":{"url":"https://api.github.com/repos/pmd/pmd/pulls/641","id":142471016,"html_url":"https://github.com/pmd/pmd/pull/641","diff_url":"https://github.com/pmd/pmd/pull/641.diff","patch_url":"https://github.com/pmd/pmd/pull/641.patch","issue_url":"https://api.github.com/repos/pmd/pmd/issues/641","number":641,"state":"open","locked":false,"title":"[core] Add text operations to manipulate a document","user":{"login":"gibarsin","id":9052089,"avatar_url":"https://avatars0.githubusercontent.com/u/9052089?v=4","gravatar_id":"","url":"https://api.github.com/users/gibarsin","html_url":"https://github.com/gibarsin","followers_url":"https://api.github.com/users/gibarsin/followers","following_url":"https://api.github.com/users/gibarsin/following{/other_user}","gists_url":"https://api.github.com/users/gibarsin/gists{/gist_id}","starred_url":"https://api.github.com/users/gibarsin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gibarsin/subscriptions","organizations_url":"https://api.github.com/users/gibarsin/orgs","repos_url":"https://api.github.com/users/gibarsin/repos","events_url":"https://api.github.com/users/gibarsin/events{/privacy}","received_events_url":"https://api.github.com/users/gibarsin/received_events","type":"User","site_admin":false},"body":"# Prologue\r\nHi to everyone, this is my first contribution to the project! This is the first of the many upcoming changes to the PMD project. This contribution is part of the feature [**Autofixable issues**](https://github.com/pmd/pmd/wiki/Project-Ideas-%5BMature%5D#auto-fixable-issues). Many of the changes which support this feature will be brought by my partner @MatiasComercio and me. Our mentor is @jsotuyod.\r\nAny feedback, sugestion or problem with the following changes are welcome!\r\n\r\n# Concepts\r\n## Document\r\nA document is a representation of a source file which can be read or updated. To represent the order of application of those manipulations, the concept of text operation is introduced.\r\n\r\n## Text Operation\r\nA text operation can be represented as an insertion, replacement or deletion on a document, at a given offset and of a determined length. They are represented in a tree manner, which means that any text operation may have children text operations. At any depth level the children are ordered by region. To insert a child the following requirements must be satisfied:\r\n\r\n- A parent may have only children on which their regions are contained inside his region. \r\n- Siblings may not have their regions overlapped.\r\n\r\n## Region\r\nA region is defined by an non-negative offset and a non-negative length, and represent a region in a document.\r\n\r\n# Summary\r\nText manipulations are to be applied to a document after ending the AST traversal where rule violations are found and reported.","created_at":"2017-09-21T23:56:38Z","updated_at":"2017-09-22T02:44:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d0a85c8715f256817945d12468ad54089a0e9310","assignee":{"login":"jsotuyod","id":802626,"avatar_url":"https://avatars3.githubusercontent.com/u/802626?v=4","gravatar_id":"","url":"https://api.github.com/users/jsotuyod","html_url":"https://github.com/jsotuyod","followers_url":"https://api.github.com/users/jsotuyod/followers","following_url":"https://api.github.com/users/jsotuyod/following{/other_user}","gists_url":"https://api.github.com/users/jsotuyod/gists{/gist_id}","starred_url":"https://api.github.com/users/jsotuyod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsotuyod/subscriptions","organizations_url":"https://api.github.com/users/jsotuyod/orgs","repos_url":"https://api.github.com/users/jsotuyod/repos","events_url":"https://api.github.com/users/jsotuyod/events{/privacy}","received_events_url":"https://api.github.com/users/jsotuyod/received_events","type":"User","site_admin":false},"assignees":[{"login":"jsotuyod","id":802626,"avatar_url":"https://avatars3.githubusercontent.com/u/802626?v=4","gravatar_id":"","url":"https://api.github.com/users/jsotuyod","html_url":"https://github.com/jsotuyod","followers_url":"https://api.github.com/users/jsotuyod/followers","following_url":"https://api.github.com/users/jsotuyod/following{/other_user}","gists_url":"https://api.github.com/users/jsotuyod/gists{/gist_id}","starred_url":"https://api.github.com/users/jsotuyod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsotuyod/subscriptions","organizations_url":"https://api.github.com/users/jsotuyod/orgs","repos_url":"https://api.github.com/users/jsotuyod/repos","events_url":"https://api.github.com/users/jsotuyod/events{/privacy}","received_events_url":"https://api.github.com/users/jsotuyod/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/pmd/pmd/pulls/641/commits","review_comments_url":"https://api.github.com/repos/pmd/pmd/pulls/641/comments","review_comment_url":"https://api.github.com/repos/pmd/pmd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pmd/pmd/issues/641/comments","statuses_url":"https://api.github.com/repos/pmd/pmd/statuses/0ea10ce7294d0d5cfbcbbb6c106011551a10c270","head":{"label":"gibarsin:text-manipulation","ref":"text-manipulation","sha":"0ea10ce7294d0d5cfbcbbb6c106011551a10c270","user":{"login":"gibarsin","id":9052089,"avatar_url":"https://avatars0.githubusercontent.com/u/9052089?v=4","gravatar_id":"","url":"https://api.github.com/users/gibarsin","html_url":"https://github.com/gibarsin","followers_url":"https://api.github.com/users/gibarsin/followers","following_url":"https://api.github.com/users/gibarsin/following{/other_user}","gists_url":"https://api.github.com/users/gibarsin/gists{/gist_id}","starred_url":"https://api.github.com/users/gibarsin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gibarsin/subscriptions","organizations_url":"https://api.github.com/users/gibarsin/orgs","repos_url":"https://api.github.com/users/gibarsin/repos","events_url":"https://api.github.com/users/gibarsin/events{/privacy}","received_events_url":"https://api.github.com/users/gibarsin/received_events","type":"User","site_admin":false},"repo":{"id":104400096,"name":"pmd","full_name":"gibarsin/pmd","owner":{"login":"gibarsin","id":9052089,"avatar_url":"https://avatars0.githubusercontent.com/u/9052089?v=4","gravatar_id":"","url":"https://api.github.com/users/gibarsin","html_url":"https://github.com/gibarsin","followers_url":"https://api.github.com/users/gibarsin/followers","following_url":"https://api.github.com/users/gibarsin/following{/other_user}","gists_url":"https://api.github.com/users/gibarsin/gists{/gist_id}","starred_url":"https://api.github.com/users/gibarsin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gibarsin/subscriptions","organizations_url":"https://api.github.com/users/gibarsin/orgs","repos_url":"https://api.github.com/users/gibarsin/repos","events_url":"https://api.github.com/users/gibarsin/events{/privacy}","received_events_url":"https://api.github.com/users/gibarsin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gibarsin/pmd","description":"An extensible cross-language static code analyzer.","fork":true,"url":"https://api.github.com/repos/gibarsin/pmd","forks_url":"https://api.github.com/repos/gibarsin/pmd/forks","keys_url":"https://api.github.com/repos/gibarsin/pmd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gibarsin/pmd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gibarsin/pmd/teams","hooks_url":"https://api.github.com/repos/gibarsin/pmd/hooks","issue_events_url":"https://api.github.com/repos/gibarsin/pmd/issues/events{/number}","events_url":"https://api.github.com/repos/gibarsin/pmd/events","assignees_url":"https://api.github.com/repos/gibarsin/pmd/assignees{/user}","branches_url":"https://api.github.com/repos/gibarsin/pmd/branches{/branch}","tags_url":"https://api.github.com/repos/gibarsin/pmd/tags","blobs_url":"https://api.github.com/repos/gibarsin/pmd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gibarsin/pmd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gibarsin/pmd/git/refs{/sha}","trees_url":"https://api.github.com/repos/gibarsin/pmd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gibarsin/pmd/statuses/{sha}","languages_url":"https://api.github.com/repos/gibarsin/pmd/languages","stargazers_url":"https://api.github.com/repos/gibarsin/pmd/stargazers","contributors_url":"https://api.github.com/repos/gibarsin/pmd/contributors","subscribers_url":"https://api.github.com/repos/gibarsin/pmd/subscribers","subscription_url":"https://api.github.com/repos/gibarsin/pmd/subscription","commits_url":"https://api.github.com/repos/gibarsin/pmd/commits{/sha}","git_commits_url":"https://api.github.com/repos/gibarsin/pmd/git/commits{/sha}","comments_url":"https://api.github.com/repos/gibarsin/pmd/comments{/number}","issue_comment_url":"https://api.github.com/repos/gibarsin/pmd/issues/comments{/number}","contents_url":"https://api.github.com/repos/gibarsin/pmd/contents/{+path}","compare_url":"https://api.github.com/repos/gibarsin/pmd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gibarsin/pmd/merges","archive_url":"https://api.github.com/repos/gibarsin/pmd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gibarsin/pmd/downloads","issues_url":"https://api.github.com/repos/gibarsin/pmd/issues{/number}","pulls_url":"https://api.github.com/repos/gibarsin/pmd/pulls{/number}","milestones_url":"https://api.github.com/repos/gibarsin/pmd/milestones{/number}","notifications_url":"https://api.github.com/repos/gibarsin/pmd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gibarsin/pmd/labels{/name}","releases_url":"https://api.github.com/repos/gibarsin/pmd/releases{/id}","deployments_url":"https://api.github.com/repos/gibarsin/pmd/deployments","created_at":"2017-09-21T21:19:55Z","updated_at":"2017-09-21T21:20:02Z","pushed_at":"2017-09-21T23:20:39Z","git_url":"git://github.com/gibarsin/pmd.git","ssh_url":"git@github.com:gibarsin/pmd.git","clone_url":"https://github.com/gibarsin/pmd.git","svn_url":"https://github.com/gibarsin/pmd","homepage":"https://pmd.github.io","size":235312,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"pmd:master","ref":"master","sha":"df87db8d7aeb8d5f6fefc7e94c7637d658729462","user":{"login":"pmd","id":1958157,"avatar_url":"https://avatars0.githubusercontent.com/u/1958157?v=4","gravatar_id":"","url":"https://api.github.com/users/pmd","html_url":"https://github.com/pmd","followers_url":"https://api.github.com/users/pmd/followers","following_url":"https://api.github.com/users/pmd/following{/other_user}","gists_url":"https://api.github.com/users/pmd/gists{/gist_id}","starred_url":"https://api.github.com/users/pmd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmd/subscriptions","organizations_url":"https://api.github.com/users/pmd/orgs","repos_url":"https://api.github.com/users/pmd/repos","events_url":"https://api.github.com/users/pmd/events{/privacy}","received_events_url":"https://api.github.com/users/pmd/received_events","type":"Organization","site_admin":false},"repo":{"id":4992906,"name":"pmd","full_name":"pmd/pmd","owner":{"login":"pmd","id":1958157,"avatar_url":"https://avatars0.githubusercontent.com/u/1958157?v=4","gravatar_id":"","url":"https://api.github.com/users/pmd","html_url":"https://github.com/pmd","followers_url":"https://api.github.com/users/pmd/followers","following_url":"https://api.github.com/users/pmd/following{/other_user}","gists_url":"https://api.github.com/users/pmd/gists{/gist_id}","starred_url":"https://api.github.com/users/pmd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmd/subscriptions","organizations_url":"https://api.github.com/users/pmd/orgs","repos_url":"https://api.github.com/users/pmd/repos","events_url":"https://api.github.com/users/pmd/events{/privacy}","received_events_url":"https://api.github.com/users/pmd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pmd/pmd","description":"An extensible cross-language static code analyzer.","fork":false,"url":"https://api.github.com/repos/pmd/pmd","forks_url":"https://api.github.com/repos/pmd/pmd/forks","keys_url":"https://api.github.com/repos/pmd/pmd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pmd/pmd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pmd/pmd/teams","hooks_url":"https://api.github.com/repos/pmd/pmd/hooks","issue_events_url":"https://api.github.com/repos/pmd/pmd/issues/events{/number}","events_url":"https://api.github.com/repos/pmd/pmd/events","assignees_url":"https://api.github.com/repos/pmd/pmd/assignees{/user}","branches_url":"https://api.github.com/repos/pmd/pmd/branches{/branch}","tags_url":"https://api.github.com/repos/pmd/pmd/tags","blobs_url":"https://api.github.com/repos/pmd/pmd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pmd/pmd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pmd/pmd/git/refs{/sha}","trees_url":"https://api.github.com/repos/pmd/pmd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pmd/pmd/statuses/{sha}","languages_url":"https://api.github.com/repos/pmd/pmd/languages","stargazers_url":"https://api.github.com/repos/pmd/pmd/stargazers","contributors_url":"https://api.github.com/repos/pmd/pmd/contributors","subscribers_url":"https://api.github.com/repos/pmd/pmd/subscribers","subscription_url":"https://api.github.com/repos/pmd/pmd/subscription","commits_url":"https://api.github.com/repos/pmd/pmd/commits{/sha}","git_commits_url":"https://api.github.com/repos/pmd/pmd/git/commits{/sha}","comments_url":"https://api.github.com/repos/pmd/pmd/comments{/number}","issue_comment_url":"https://api.github.com/repos/pmd/pmd/issues/comments{/number}","contents_url":"https://api.github.com/repos/pmd/pmd/contents/{+path}","compare_url":"https://api.github.com/repos/pmd/pmd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pmd/pmd/merges","archive_url":"https://api.github.com/repos/pmd/pmd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pmd/pmd/downloads","issues_url":"https://api.github.com/repos/pmd/pmd/issues{/number}","pulls_url":"https://api.github.com/repos/pmd/pmd/pulls{/number}","milestones_url":"https://api.github.com/repos/pmd/pmd/milestones{/number}","notifications_url":"https://api.github.com/repos/pmd/pmd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pmd/pmd/labels{/name}","releases_url":"https://api.github.com/repos/pmd/pmd/releases{/id}","deployments_url":"https://api.github.com/repos/pmd/pmd/deployments","created_at":"2012-07-11T18:03:00Z","updated_at":"2017-09-21T14:24:21Z","pushed_at":"2017-09-21T23:56:39Z","git_url":"git://github.com/pmd/pmd.git","ssh_url":"git@github.com:pmd/pmd.git","clone_url":"https://github.com/pmd/pmd.git","svn_url":"https://github.com/pmd/pmd","homepage":"https://pmd.github.io","size":235300,"stargazers_count":1132,"watchers_count":1132,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":405,"mirror_url":null,"open_issues_count":97,"forks":405,"open_issues":97,"watchers":1132,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pmd/pmd/pulls/641"},"html":{"href":"https://github.com/pmd/pmd/pull/641"},"issue":{"href":"https://api.github.com/repos/pmd/pmd/issues/641"},"comments":{"href":"https://api.github.com/repos/pmd/pmd/issues/641/comments"},"review_comments":{"href":"https://api.github.com/repos/pmd/pmd/pulls/641/comments"},"review_comment":{"href":"https://api.github.com/repos/pmd/pmd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pmd/pmd/pulls/641/commits"},"statuses":{"href":"https://api.github.com/repos/pmd/pmd/statuses/0ea10ce7294d0d5cfbcbbb6c106011551a10c270"}},"author_association":"NONE"}}
{"actor":{"display_login":"gibarsin"}}