{"action":"created","comment":{"url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/pulls/comments/40996694","id":40996694,"diff_hunk":"@@ -0,0 +1,48 @@\n+package ru.mail.track.messenger;\r\n+\r\n+import ru.mail.track.messenger.authorization.userauthorization.AuthorizationService;\r\n+import ru.mail.track.messenger.authorization.userstorage.UserStorage;\r\n+import ru.mail.track.messenger.authorization.userstorage.UserStorageDidNotRead;\r\n+import ru.mail.track.messenger.authorization.userstorage.usersteward.ReadUsersException;\r\n+import ru.mail.track.messenger.authorization.userstorage.usersteward.SaveUsersException;\r\n+import ru.mail.track.messenger.authorization.userstorage.usersteward.UserFileSteward;\r\n+\r\n+import java.util.Scanner;\r\n+\r\n+/**\r\n+ * Created by Ivan Shafran on 28.09.2015.\r\n+ * Mail: vanobox07@mail.ru\r\n+ */\r\n+public class Main {\r\n+    public static void main(String[] args) {\r\n+        UserStorage userStorage = new UserStorage(new UserFileSteward(\"C:\\\\1\\\\base.txt\"));\r\n+\r\n+        try {\r\n+            userStorage.readUsers();\r\n+        } catch (ReadUsersException e) {\r\n+            //\r\n+        }\r\n+\r\n+        Scanner scanner = new Scanner(System.in);\r\n+        AuthorizationService authorization = new AuthorizationService(scanner, userStorage);\r\n+        try {\r","path":"src/ru/mail/track/messenger/Main.java","position":28,"original_position":28,"commit_id":"9efa10fa44dc2aea625b306c3992d56f162931ae","original_commit_id":"9efa10fa44dc2aea625b306c3992d56f162931ae","user":{"login":"arhangeldim","id":1112038,"avatar_url":"https://avatars.githubusercontent.com/u/1112038?v=3","gravatar_id":"","url":"https://api.github.com/users/arhangeldim","html_url":"https://github.com/arhangeldim","followers_url":"https://api.github.com/users/arhangeldim/followers","following_url":"https://api.github.com/users/arhangeldim/following{/other_user}","gists_url":"https://api.github.com/users/arhangeldim/gists{/gist_id}","starred_url":"https://api.github.com/users/arhangeldim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arhangeldim/subscriptions","organizations_url":"https://api.github.com/users/arhangeldim/orgs","repos_url":"https://api.github.com/users/arhangeldim/repos","events_url":"https://api.github.com/users/arhangeldim/events{/privacy}","received_events_url":"https://api.github.com/users/arhangeldim/received_events","type":"User","site_admin":false},"body":"Да вобзем-то это все логика авторизации, ее надо туда и поместить, в main() ей не место","created_at":"2015-10-02T07:26:05Z","updated_at":"2015-10-02T07:26:05Z","html_url":"https://github.com/IvanShafran/technotrack-mail-java-1sem/pull/1#discussion_r40996694","pull_request_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/pulls/comments/40996694"},"html":{"href":"https://github.com/IvanShafran/technotrack-mail-java-1sem/pull/1#discussion_r40996694"},"pull_request":{"href":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/pulls/1","id":46559615,"html_url":"https://github.com/IvanShafran/technotrack-mail-java-1sem/pull/1","diff_url":"https://github.com/IvanShafran/technotrack-mail-java-1sem/pull/1.diff","patch_url":"https://github.com/IvanShafran/technotrack-mail-java-1sem/pull/1.patch","issue_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/issues/1","number":1,"state":"open","locked":false,"title":"Authorization","user":{"login":"IvanShafran","id":5469241,"avatar_url":"https://avatars.githubusercontent.com/u/5469241?v=3","gravatar_id":"","url":"https://api.github.com/users/IvanShafran","html_url":"https://github.com/IvanShafran","followers_url":"https://api.github.com/users/IvanShafran/followers","following_url":"https://api.github.com/users/IvanShafran/following{/other_user}","gists_url":"https://api.github.com/users/IvanShafran/gists{/gist_id}","starred_url":"https://api.github.com/users/IvanShafran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IvanShafran/subscriptions","organizations_url":"https://api.github.com/users/IvanShafran/orgs","repos_url":"https://api.github.com/users/IvanShafran/repos","events_url":"https://api.github.com/users/IvanShafran/events{/privacy}","received_events_url":"https://api.github.com/users/IvanShafran/received_events","type":"User","site_admin":false},"body":"Реализовал всю логику с 1 по 4-ый пункт.\r\n\r\nМне не нравится:\r\n1) Хеширование -- использую .hashCode(). Ненадежно.\r\n2) Много exceptions\r\n3) Привязка к System.out для вывода информации\r\n4) Данные в файле сохраняются в прямом виде -- строки. Лучше сериализовать.\r\n\r\nНравится:\r\n1) Это работает\r\n2) Обработка ошибок\r\n3) Конкретный вывод ошибки в логине или пароле: длина, символы.\r\n4) UserStorage не привязан к чтению из файла.(Паттерн стратегия) Можно реализовать с помощью интерфейса UserSteward чтение из любого места, которого вы хотите.","created_at":"2015-10-01T18:32:54Z","updated_at":"2015-10-02T07:26:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cbb2ba08880424f6a7e3705451f3bae221ddcf80","assignee":{"login":"arhangeldim","id":1112038,"avatar_url":"https://avatars.githubusercontent.com/u/1112038?v=3","gravatar_id":"","url":"https://api.github.com/users/arhangeldim","html_url":"https://github.com/arhangeldim","followers_url":"https://api.github.com/users/arhangeldim/followers","following_url":"https://api.github.com/users/arhangeldim/following{/other_user}","gists_url":"https://api.github.com/users/arhangeldim/gists{/gist_id}","starred_url":"https://api.github.com/users/arhangeldim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arhangeldim/subscriptions","organizations_url":"https://api.github.com/users/arhangeldim/orgs","repos_url":"https://api.github.com/users/arhangeldim/repos","events_url":"https://api.github.com/users/arhangeldim/events{/privacy}","received_events_url":"https://api.github.com/users/arhangeldim/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/pulls/1/commits","review_comments_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/pulls/1/comments","review_comment_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/pulls/comments{/number}","comments_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/issues/1/comments","statuses_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/statuses/9efa10fa44dc2aea625b306c3992d56f162931ae","head":{"label":"IvanShafran:authorization","ref":"authorization","sha":"9efa10fa44dc2aea625b306c3992d56f162931ae","user":{"login":"IvanShafran","id":5469241,"avatar_url":"https://avatars.githubusercontent.com/u/5469241?v=3","gravatar_id":"","url":"https://api.github.com/users/IvanShafran","html_url":"https://github.com/IvanShafran","followers_url":"https://api.github.com/users/IvanShafran/followers","following_url":"https://api.github.com/users/IvanShafran/following{/other_user}","gists_url":"https://api.github.com/users/IvanShafran/gists{/gist_id}","starred_url":"https://api.github.com/users/IvanShafran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IvanShafran/subscriptions","organizations_url":"https://api.github.com/users/IvanShafran/orgs","repos_url":"https://api.github.com/users/IvanShafran/repos","events_url":"https://api.github.com/users/IvanShafran/events{/privacy}","received_events_url":"https://api.github.com/users/IvanShafran/received_events","type":"User","site_admin":false},"repo":{"id":43267250,"name":"technotrack-mail-java-1sem","full_name":"IvanShafran/technotrack-mail-java-1sem","owner":{"login":"IvanShafran","id":5469241,"avatar_url":"https://avatars.githubusercontent.com/u/5469241?v=3","gravatar_id":"","url":"https://api.github.com/users/IvanShafran","html_url":"https://github.com/IvanShafran","followers_url":"https://api.github.com/users/IvanShafran/followers","following_url":"https://api.github.com/users/IvanShafran/following{/other_user}","gists_url":"https://api.github.com/users/IvanShafran/gists{/gist_id}","starred_url":"https://api.github.com/users/IvanShafran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IvanShafran/subscriptions","organizations_url":"https://api.github.com/users/IvanShafran/orgs","repos_url":"https://api.github.com/users/IvanShafran/repos","events_url":"https://api.github.com/users/IvanShafran/events{/privacy}","received_events_url":"https://api.github.com/users/IvanShafran/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/IvanShafran/technotrack-mail-java-1sem","description":"","fork":false,"url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem","forks_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/forks","keys_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/teams","hooks_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/hooks","issue_events_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/issues/events{/number}","events_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/events","assignees_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/assignees{/user}","branches_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/branches{/branch}","tags_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/tags","blobs_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/git/refs{/sha}","trees_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/statuses/{sha}","languages_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/languages","stargazers_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/stargazers","contributors_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/contributors","subscribers_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/subscribers","subscription_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/subscription","commits_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/commits{/sha}","git_commits_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/git/commits{/sha}","comments_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/comments{/number}","issue_comment_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/issues/comments{/number}","contents_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/contents/{+path}","compare_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/merges","archive_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/downloads","issues_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/issues{/number}","pulls_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/pulls{/number}","milestones_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/milestones{/number}","notifications_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/labels{/name}","releases_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/releases{/id}","created_at":"2015-09-27T22:09:52Z","updated_at":"2015-09-28T20:50:28Z","pushed_at":"2015-10-01T18:32:55Z","git_url":"git://github.com/IvanShafran/technotrack-mail-java-1sem.git","ssh_url":"git@github.com:IvanShafran/technotrack-mail-java-1sem.git","clone_url":"https://github.com/IvanShafran/technotrack-mail-java-1sem.git","svn_url":"https://github.com/IvanShafran/technotrack-mail-java-1sem","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"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":0,"default_branch":"master"}},"base":{"label":"IvanShafran:master","ref":"master","sha":"f990e07b5f9a4012efb92c0dbc7522cc33e3b4de","user":{"login":"IvanShafran","id":5469241,"avatar_url":"https://avatars.githubusercontent.com/u/5469241?v=3","gravatar_id":"","url":"https://api.github.com/users/IvanShafran","html_url":"https://github.com/IvanShafran","followers_url":"https://api.github.com/users/IvanShafran/followers","following_url":"https://api.github.com/users/IvanShafran/following{/other_user}","gists_url":"https://api.github.com/users/IvanShafran/gists{/gist_id}","starred_url":"https://api.github.com/users/IvanShafran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IvanShafran/subscriptions","organizations_url":"https://api.github.com/users/IvanShafran/orgs","repos_url":"https://api.github.com/users/IvanShafran/repos","events_url":"https://api.github.com/users/IvanShafran/events{/privacy}","received_events_url":"https://api.github.com/users/IvanShafran/received_events","type":"User","site_admin":false},"repo":{"id":43267250,"name":"technotrack-mail-java-1sem","full_name":"IvanShafran/technotrack-mail-java-1sem","owner":{"login":"IvanShafran","id":5469241,"avatar_url":"https://avatars.githubusercontent.com/u/5469241?v=3","gravatar_id":"","url":"https://api.github.com/users/IvanShafran","html_url":"https://github.com/IvanShafran","followers_url":"https://api.github.com/users/IvanShafran/followers","following_url":"https://api.github.com/users/IvanShafran/following{/other_user}","gists_url":"https://api.github.com/users/IvanShafran/gists{/gist_id}","starred_url":"https://api.github.com/users/IvanShafran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IvanShafran/subscriptions","organizations_url":"https://api.github.com/users/IvanShafran/orgs","repos_url":"https://api.github.com/users/IvanShafran/repos","events_url":"https://api.github.com/users/IvanShafran/events{/privacy}","received_events_url":"https://api.github.com/users/IvanShafran/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/IvanShafran/technotrack-mail-java-1sem","description":"","fork":false,"url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem","forks_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/forks","keys_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/teams","hooks_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/hooks","issue_events_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/issues/events{/number}","events_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/events","assignees_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/assignees{/user}","branches_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/branches{/branch}","tags_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/tags","blobs_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/git/refs{/sha}","trees_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/statuses/{sha}","languages_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/languages","stargazers_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/stargazers","contributors_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/contributors","subscribers_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/subscribers","subscription_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/subscription","commits_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/commits{/sha}","git_commits_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/git/commits{/sha}","comments_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/comments{/number}","issue_comment_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/issues/comments{/number}","contents_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/contents/{+path}","compare_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/merges","archive_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/downloads","issues_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/issues{/number}","pulls_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/pulls{/number}","milestones_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/milestones{/number}","notifications_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/labels{/name}","releases_url":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/releases{/id}","created_at":"2015-09-27T22:09:52Z","updated_at":"2015-09-28T20:50:28Z","pushed_at":"2015-10-01T18:32:55Z","git_url":"git://github.com/IvanShafran/technotrack-mail-java-1sem.git","ssh_url":"git@github.com:IvanShafran/technotrack-mail-java-1sem.git","clone_url":"https://github.com/IvanShafran/technotrack-mail-java-1sem.git","svn_url":"https://github.com/IvanShafran/technotrack-mail-java-1sem","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"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":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/pulls/1"},"html":{"href":"https://github.com/IvanShafran/technotrack-mail-java-1sem/pull/1"},"issue":{"href":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/issues/1"},"comments":{"href":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/IvanShafran/technotrack-mail-java-1sem/statuses/9efa10fa44dc2aea625b306c3992d56f162931ae"}}}}