{"action":"created","comment":{"url":"https://api.github.com/repos/edu-xored/tracker-web/pulls/comments/89259406","pull_request_review_id":9805080,"id":89259406,"diff_hunk":"@@ -0,0 +1,103 @@\n+package edu.xored.tracker;\n+\n+import java.util.ArrayList;\n+import java.util.Map;\n+import java.util.HashMap;\n+import java.util.List;\n+import java.util.stream.Collectors;\n+import java.util.stream.StreamSupport;\n+\n+public class IssueRepositoryImpl implements IssueRepository {\n+    private static Map<Long, Issue> issuesMap = new HashMap<>();\n+\n+    public <S extends Issue> S save(S issue) {\n+        issue.setHash(getIssueId());\n+        issuesMap.put(issue.getHash(), issue);\n+\n+        return issue;\n+    }\n+\n+    public <S extends Issue> Iterable<S> save(Iterable<S> issues) {\n+        if (issues == null) {\n+            return null;\n+        }\n+\n+        return StreamSupport.stream(issues.spliterator(), false)\n+                .map(this::save)\n+                .collect(Collectors.toList());\n+    }\n+\n+    public Issue findOne(Long issueId) {\n+        return issuesMap.getOrDefault(issueId, null);\n+    }\n+\n+    public boolean exists(Long issueId) {\n+        return issuesMap.containsKey(issueId);\n+    }\n+\n+    public Iterable<Issue> findAll() {\n+        return issuesMap.values();\n+    }\n+\n+    public Iterable<Issue> findAll(Iterable<Long> issuesId) {\n+        List<Issue> result = new ArrayList<>();\n+        issuesId.forEach(issueId -> result.add(findOne(issueId)));\n+\n+        return result;\n+    }\n+\n+    public long count() {\n+        return (issuesMap == null)\n+                ? 0\n+                : issuesMap.size();\n+    }\n+\n+    public void delete(Long issueId) {\n+        if (issueId == null) {\n+            return;\n+        }\n+\n+        issuesMap.remove(issueId);\n+    }\n+\n+    public void delete(Issue issue) {\n+        if (issue == null) {\n+            return;\n+        }\n+\n+        delete(issue.getHash());\n+    }\n+\n+    public void delete(Iterable<? extends Issue> issuesId) {\n+        issuesId.forEach(this::delete);\n+    }\n+\n+    public void deleteAll() {\n+        issuesMap.clear();\n+    }\n+\n+    public List<Issue> list() {\n+        return issuesMap.entrySet().stream()\n+                .map(Map.Entry::getValue)\n+                .collect(Collectors.toList());\n+    }\n+\n+    public Issue replace(Long hash, Issue issue) {\n+        return issuesMap.replace(hash, issue);\n+    }\n+\n+    public Iterable<Issue> findAll(Issue.Status status) {\n+        return issuesMap.entrySet().stream()\n+                .map(Map.Entry::getValue)\n+                .filter(entry -> entry.getStatus() == status)\n+                .collect(Collectors.toList());\n+    }\n+\n+    public void postComment(Comment comment, long hash) {\n+        findOne(hash).addComment(comment);\n+    }\n+\n+    private long getIssueId() {\n+        return issuesMap.size();\n+    }\n+}","path":"src/main/java/edu/xored/tracker/IssueRepositoryImpl.java","position":103,"original_position":103,"commit_id":"930629d57265d0bb7fa2f5fb9ac626311768d72a","original_commit_id":"930629d57265d0bb7fa2f5fb9ac626311768d72a","user":{"login":"kevromster","id":16014197,"avatar_url":"https://avatars.githubusercontent.com/u/16014197?v=3","gravatar_id":"","url":"https://api.github.com/users/kevromster","html_url":"https://github.com/kevromster","followers_url":"https://api.github.com/users/kevromster/followers","following_url":"https://api.github.com/users/kevromster/following{/other_user}","gists_url":"https://api.github.com/users/kevromster/gists{/gist_id}","starred_url":"https://api.github.com/users/kevromster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevromster/subscriptions","organizations_url":"https://api.github.com/users/kevromster/orgs","repos_url":"https://api.github.com/users/kevromster/repos","events_url":"https://api.github.com/users/kevromster/events{/privacy}","received_events_url":"https://api.github.com/users/kevromster/received_events","type":"User","site_admin":false},"body":"пустая строчка в конце файла.","created_at":"2016-11-23T05:51:36Z","updated_at":"2016-11-23T05:51:41Z","html_url":"https://github.com/edu-xored/tracker-web/pull/36#discussion_r89259406","pull_request_url":"https://api.github.com/repos/edu-xored/tracker-web/pulls/36","_links":{"self":{"href":"https://api.github.com/repos/edu-xored/tracker-web/pulls/comments/89259406"},"html":{"href":"https://github.com/edu-xored/tracker-web/pull/36#discussion_r89259406"},"pull_request":{"href":"https://api.github.com/repos/edu-xored/tracker-web/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/edu-xored/tracker-web/pulls/36","id":94842925,"html_url":"https://github.com/edu-xored/tracker-web/pull/36","diff_url":"https://github.com/edu-xored/tracker-web/pull/36.diff","patch_url":"https://github.com/edu-xored/tracker-web/pull/36.patch","issue_url":"https://api.github.com/repos/edu-xored/tracker-web/issues/36","number":36,"state":"open","locked":false,"title":"Add in-memory repositories for Issue (feature/8)","user":{"login":"zaNudda","id":1641125,"avatar_url":"https://avatars.githubusercontent.com/u/1641125?v=3","gravatar_id":"","url":"https://api.github.com/users/zaNudda","html_url":"https://github.com/zaNudda","followers_url":"https://api.github.com/users/zaNudda/followers","following_url":"https://api.github.com/users/zaNudda/following{/other_user}","gists_url":"https://api.github.com/users/zaNudda/gists{/gist_id}","starred_url":"https://api.github.com/users/zaNudda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zaNudda/subscriptions","organizations_url":"https://api.github.com/users/zaNudda/orgs","repos_url":"https://api.github.com/users/zaNudda/repos","events_url":"https://api.github.com/users/zaNudda/events{/privacy}","received_events_url":"https://api.github.com/users/zaNudda/received_events","type":"User","site_admin":false},"body":"Card: #8 ","created_at":"2016-11-22T16:01:25Z","updated_at":"2016-11-23T05:51:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"12d0bcd081cd7d4ccf351da0cff80d3a0cf8a704","assignee":{"login":"mgtriffid","id":3628883,"avatar_url":"https://avatars.githubusercontent.com/u/3628883?v=3","gravatar_id":"","url":"https://api.github.com/users/mgtriffid","html_url":"https://github.com/mgtriffid","followers_url":"https://api.github.com/users/mgtriffid/followers","following_url":"https://api.github.com/users/mgtriffid/following{/other_user}","gists_url":"https://api.github.com/users/mgtriffid/gists{/gist_id}","starred_url":"https://api.github.com/users/mgtriffid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgtriffid/subscriptions","organizations_url":"https://api.github.com/users/mgtriffid/orgs","repos_url":"https://api.github.com/users/mgtriffid/repos","events_url":"https://api.github.com/users/mgtriffid/events{/privacy}","received_events_url":"https://api.github.com/users/mgtriffid/received_events","type":"User","site_admin":false},"assignees":[{"login":"mgtriffid","id":3628883,"avatar_url":"https://avatars.githubusercontent.com/u/3628883?v=3","gravatar_id":"","url":"https://api.github.com/users/mgtriffid","html_url":"https://github.com/mgtriffid","followers_url":"https://api.github.com/users/mgtriffid/followers","following_url":"https://api.github.com/users/mgtriffid/following{/other_user}","gists_url":"https://api.github.com/users/mgtriffid/gists{/gist_id}","starred_url":"https://api.github.com/users/mgtriffid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgtriffid/subscriptions","organizations_url":"https://api.github.com/users/mgtriffid/orgs","repos_url":"https://api.github.com/users/mgtriffid/repos","events_url":"https://api.github.com/users/mgtriffid/events{/privacy}","received_events_url":"https://api.github.com/users/mgtriffid/received_events","type":"User","site_admin":false},{"login":"kevromster","id":16014197,"avatar_url":"https://avatars.githubusercontent.com/u/16014197?v=3","gravatar_id":"","url":"https://api.github.com/users/kevromster","html_url":"https://github.com/kevromster","followers_url":"https://api.github.com/users/kevromster/followers","following_url":"https://api.github.com/users/kevromster/following{/other_user}","gists_url":"https://api.github.com/users/kevromster/gists{/gist_id}","starred_url":"https://api.github.com/users/kevromster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevromster/subscriptions","organizations_url":"https://api.github.com/users/kevromster/orgs","repos_url":"https://api.github.com/users/kevromster/repos","events_url":"https://api.github.com/users/kevromster/events{/privacy}","received_events_url":"https://api.github.com/users/kevromster/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/edu-xored/tracker-web/pulls/36/commits","review_comments_url":"https://api.github.com/repos/edu-xored/tracker-web/pulls/36/comments","review_comment_url":"https://api.github.com/repos/edu-xored/tracker-web/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edu-xored/tracker-web/issues/36/comments","statuses_url":"https://api.github.com/repos/edu-xored/tracker-web/statuses/930629d57265d0bb7fa2f5fb9ac626311768d72a","head":{"label":"edu-xored:feature/8","ref":"feature/8","sha":"930629d57265d0bb7fa2f5fb9ac626311768d72a","user":{"login":"edu-xored","id":21689140,"avatar_url":"https://avatars.githubusercontent.com/u/21689140?v=3","gravatar_id":"","url":"https://api.github.com/users/edu-xored","html_url":"https://github.com/edu-xored","followers_url":"https://api.github.com/users/edu-xored/followers","following_url":"https://api.github.com/users/edu-xored/following{/other_user}","gists_url":"https://api.github.com/users/edu-xored/gists{/gist_id}","starred_url":"https://api.github.com/users/edu-xored/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edu-xored/subscriptions","organizations_url":"https://api.github.com/users/edu-xored/orgs","repos_url":"https://api.github.com/users/edu-xored/repos","events_url":"https://api.github.com/users/edu-xored/events{/privacy}","received_events_url":"https://api.github.com/users/edu-xored/received_events","type":"Organization","site_admin":false},"repo":{"id":71216313,"name":"tracker-web","full_name":"edu-xored/tracker-web","owner":{"login":"edu-xored","id":21689140,"avatar_url":"https://avatars.githubusercontent.com/u/21689140?v=3","gravatar_id":"","url":"https://api.github.com/users/edu-xored","html_url":"https://github.com/edu-xored","followers_url":"https://api.github.com/users/edu-xored/followers","following_url":"https://api.github.com/users/edu-xored/following{/other_user}","gists_url":"https://api.github.com/users/edu-xored/gists{/gist_id}","starred_url":"https://api.github.com/users/edu-xored/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edu-xored/subscriptions","organizations_url":"https://api.github.com/users/edu-xored/orgs","repos_url":"https://api.github.com/users/edu-xored/repos","events_url":"https://api.github.com/users/edu-xored/events{/privacy}","received_events_url":"https://api.github.com/users/edu-xored/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edu-xored/tracker-web","description":"Web UI for Git-based distributed issue tracker","fork":false,"url":"https://api.github.com/repos/edu-xored/tracker-web","forks_url":"https://api.github.com/repos/edu-xored/tracker-web/forks","keys_url":"https://api.github.com/repos/edu-xored/tracker-web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edu-xored/tracker-web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edu-xored/tracker-web/teams","hooks_url":"https://api.github.com/repos/edu-xored/tracker-web/hooks","issue_events_url":"https://api.github.com/repos/edu-xored/tracker-web/issues/events{/number}","events_url":"https://api.github.com/repos/edu-xored/tracker-web/events","assignees_url":"https://api.github.com/repos/edu-xored/tracker-web/assignees{/user}","branches_url":"https://api.github.com/repos/edu-xored/tracker-web/branches{/branch}","tags_url":"https://api.github.com/repos/edu-xored/tracker-web/tags","blobs_url":"https://api.github.com/repos/edu-xored/tracker-web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edu-xored/tracker-web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edu-xored/tracker-web/git/refs{/sha}","trees_url":"https://api.github.com/repos/edu-xored/tracker-web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edu-xored/tracker-web/statuses/{sha}","languages_url":"https://api.github.com/repos/edu-xored/tracker-web/languages","stargazers_url":"https://api.github.com/repos/edu-xored/tracker-web/stargazers","contributors_url":"https://api.github.com/repos/edu-xored/tracker-web/contributors","subscribers_url":"https://api.github.com/repos/edu-xored/tracker-web/subscribers","subscription_url":"https://api.github.com/repos/edu-xored/tracker-web/subscription","commits_url":"https://api.github.com/repos/edu-xored/tracker-web/commits{/sha}","git_commits_url":"https://api.github.com/repos/edu-xored/tracker-web/git/commits{/sha}","comments_url":"https://api.github.com/repos/edu-xored/tracker-web/comments{/number}","issue_comment_url":"https://api.github.com/repos/edu-xored/tracker-web/issues/comments{/number}","contents_url":"https://api.github.com/repos/edu-xored/tracker-web/contents/{+path}","compare_url":"https://api.github.com/repos/edu-xored/tracker-web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edu-xored/tracker-web/merges","archive_url":"https://api.github.com/repos/edu-xored/tracker-web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edu-xored/tracker-web/downloads","issues_url":"https://api.github.com/repos/edu-xored/tracker-web/issues{/number}","pulls_url":"https://api.github.com/repos/edu-xored/tracker-web/pulls{/number}","milestones_url":"https://api.github.com/repos/edu-xored/tracker-web/milestones{/number}","notifications_url":"https://api.github.com/repos/edu-xored/tracker-web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edu-xored/tracker-web/labels{/name}","releases_url":"https://api.github.com/repos/edu-xored/tracker-web/releases{/id}","deployments_url":"https://api.github.com/repos/edu-xored/tracker-web/deployments","created_at":"2016-10-18T06:32:58Z","updated_at":"2016-11-12T15:33:27Z","pushed_at":"2016-11-23T05:34:34Z","git_url":"git://github.com/edu-xored/tracker-web.git","ssh_url":"git@github.com:edu-xored/tracker-web.git","clone_url":"https://github.com/edu-xored/tracker-web.git","svn_url":"https://github.com/edu-xored/tracker-web","homepage":null,"size":387,"stargazers_count":6,"watchers_count":6,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":6,"default_branch":"master"}},"base":{"label":"edu-xored:master","ref":"master","sha":"054ac114232458ea7d8182c0d6955cb89789b2c4","user":{"login":"edu-xored","id":21689140,"avatar_url":"https://avatars.githubusercontent.com/u/21689140?v=3","gravatar_id":"","url":"https://api.github.com/users/edu-xored","html_url":"https://github.com/edu-xored","followers_url":"https://api.github.com/users/edu-xored/followers","following_url":"https://api.github.com/users/edu-xored/following{/other_user}","gists_url":"https://api.github.com/users/edu-xored/gists{/gist_id}","starred_url":"https://api.github.com/users/edu-xored/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edu-xored/subscriptions","organizations_url":"https://api.github.com/users/edu-xored/orgs","repos_url":"https://api.github.com/users/edu-xored/repos","events_url":"https://api.github.com/users/edu-xored/events{/privacy}","received_events_url":"https://api.github.com/users/edu-xored/received_events","type":"Organization","site_admin":false},"repo":{"id":71216313,"name":"tracker-web","full_name":"edu-xored/tracker-web","owner":{"login":"edu-xored","id":21689140,"avatar_url":"https://avatars.githubusercontent.com/u/21689140?v=3","gravatar_id":"","url":"https://api.github.com/users/edu-xored","html_url":"https://github.com/edu-xored","followers_url":"https://api.github.com/users/edu-xored/followers","following_url":"https://api.github.com/users/edu-xored/following{/other_user}","gists_url":"https://api.github.com/users/edu-xored/gists{/gist_id}","starred_url":"https://api.github.com/users/edu-xored/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edu-xored/subscriptions","organizations_url":"https://api.github.com/users/edu-xored/orgs","repos_url":"https://api.github.com/users/edu-xored/repos","events_url":"https://api.github.com/users/edu-xored/events{/privacy}","received_events_url":"https://api.github.com/users/edu-xored/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edu-xored/tracker-web","description":"Web UI for Git-based distributed issue tracker","fork":false,"url":"https://api.github.com/repos/edu-xored/tracker-web","forks_url":"https://api.github.com/repos/edu-xored/tracker-web/forks","keys_url":"https://api.github.com/repos/edu-xored/tracker-web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edu-xored/tracker-web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edu-xored/tracker-web/teams","hooks_url":"https://api.github.com/repos/edu-xored/tracker-web/hooks","issue_events_url":"https://api.github.com/repos/edu-xored/tracker-web/issues/events{/number}","events_url":"https://api.github.com/repos/edu-xored/tracker-web/events","assignees_url":"https://api.github.com/repos/edu-xored/tracker-web/assignees{/user}","branches_url":"https://api.github.com/repos/edu-xored/tracker-web/branches{/branch}","tags_url":"https://api.github.com/repos/edu-xored/tracker-web/tags","blobs_url":"https://api.github.com/repos/edu-xored/tracker-web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edu-xored/tracker-web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edu-xored/tracker-web/git/refs{/sha}","trees_url":"https://api.github.com/repos/edu-xored/tracker-web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edu-xored/tracker-web/statuses/{sha}","languages_url":"https://api.github.com/repos/edu-xored/tracker-web/languages","stargazers_url":"https://api.github.com/repos/edu-xored/tracker-web/stargazers","contributors_url":"https://api.github.com/repos/edu-xored/tracker-web/contributors","subscribers_url":"https://api.github.com/repos/edu-xored/tracker-web/subscribers","subscription_url":"https://api.github.com/repos/edu-xored/tracker-web/subscription","commits_url":"https://api.github.com/repos/edu-xored/tracker-web/commits{/sha}","git_commits_url":"https://api.github.com/repos/edu-xored/tracker-web/git/commits{/sha}","comments_url":"https://api.github.com/repos/edu-xored/tracker-web/comments{/number}","issue_comment_url":"https://api.github.com/repos/edu-xored/tracker-web/issues/comments{/number}","contents_url":"https://api.github.com/repos/edu-xored/tracker-web/contents/{+path}","compare_url":"https://api.github.com/repos/edu-xored/tracker-web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edu-xored/tracker-web/merges","archive_url":"https://api.github.com/repos/edu-xored/tracker-web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edu-xored/tracker-web/downloads","issues_url":"https://api.github.com/repos/edu-xored/tracker-web/issues{/number}","pulls_url":"https://api.github.com/repos/edu-xored/tracker-web/pulls{/number}","milestones_url":"https://api.github.com/repos/edu-xored/tracker-web/milestones{/number}","notifications_url":"https://api.github.com/repos/edu-xored/tracker-web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edu-xored/tracker-web/labels{/name}","releases_url":"https://api.github.com/repos/edu-xored/tracker-web/releases{/id}","deployments_url":"https://api.github.com/repos/edu-xored/tracker-web/deployments","created_at":"2016-10-18T06:32:58Z","updated_at":"2016-11-12T15:33:27Z","pushed_at":"2016-11-23T05:34:34Z","git_url":"git://github.com/edu-xored/tracker-web.git","ssh_url":"git@github.com:edu-xored/tracker-web.git","clone_url":"https://github.com/edu-xored/tracker-web.git","svn_url":"https://github.com/edu-xored/tracker-web","homepage":null,"size":387,"stargazers_count":6,"watchers_count":6,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edu-xored/tracker-web/pulls/36"},"html":{"href":"https://github.com/edu-xored/tracker-web/pull/36"},"issue":{"href":"https://api.github.com/repos/edu-xored/tracker-web/issues/36"},"comments":{"href":"https://api.github.com/repos/edu-xored/tracker-web/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/edu-xored/tracker-web/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/edu-xored/tracker-web/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edu-xored/tracker-web/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/edu-xored/tracker-web/statuses/930629d57265d0bb7fa2f5fb9ac626311768d72a"}}}}
{"actor":{"display_login":"kevromster"}}