GitHub PullRequestReviewCommentEvent at 2014-10-11 16:43:32
Repository: fizteh-java-2014
Actor: vpavlenko
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/comments/18742538","id":18742538,"diff_hunk":"@@ -0,0 +1,166 @@\n+package ru.fizteh.fivt.students.oscar_nasibullin.FileMap;\n+\n+import java.io.ByteArrayOutputStream;\n+import java.io.FileNotFoundException;\n+import java.io.IOException;\n+import java.io.RandomAccessFile;\n+import java.nio.file.Path;\n+import java.nio.file.Paths;\n+import java.util.Iterator;\n+import java.util.LinkedList;\n+import java.util.List;\n+import java.util.TreeMap;\n+import java.util.Map;\n+\n+\n+\n+public class DataBaseEditor {\n+\n+    private static Map<String, String> data;\n+    private static RandomAccessFile dataBase;\n+\n+    public DataBaseEditor()  throws Exception {\n+        data = new TreeMap<>();\n+        Path dataBasePath;\n+        try  {\n+            dataBasePath = Paths.get(System.getProperty(\"db.file\"));\n+            try (RandomAccessFile dBase\n+                    = new RandomAccessFile(dataBasePath.toString(), \"r\")) {\n+                dataBase = dBase;\n+                if (dataBase.length() > 0) {\n+                    importData();\n+                }\n+            } catch (FileNotFoundException e) {\n+                dataBasePath.toFile().createNewFile();\n+                }\n+        } catch (Exception e) {\n+            throw new Exception(\"cannot open file \");\n+            }\n+    }\n+\n+    public final void closeDataBase() throws Exception {\n+        try (RandomAccessFile dBase\n+                = new RandomAccessFile(Paths.get(\n+                        System.getProperty(\"db.file\")).toString(), \"rw\")) {\n+            dataBase = dBase;\n+            exportData();\n+            dataBase.close();\n+            } catch (Exception e) {","path":"src/ru/fizteh/fivt/students/oscar_nasibullin/FileMap/DataBaseEditor.java","position":48,"original_position":48,"commit_id":"de22d50d8500952d670ca2652571ad412862e9b9","original_commit_id":"de22d50d8500952d670ca2652571ad412862e9b9","user":{"login":"vpavlenko","id":1491908,"avatar_url":"https://avatars.githubusercontent.com/u/1491908?v=2","gravatar_id":"","url":"https://api.github.com/users/vpavlenko","html_url":"https://github.com/vpavlenko","followers_url":"https://api.github.com/users/vpavlenko/followers","following_url":"https://api.github.com/users/vpavlenko/following{/other_user}","gists_url":"https://api.github.com/users/vpavlenko/gists{/gist_id}","starred_url":"https://api.github.com/users/vpavlenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vpavlenko/subscriptions","organizations_url":"https://api.github.com/users/vpavlenko/orgs","repos_url":"https://api.github.com/users/vpavlenko/repos","events_url":"https://api.github.com/users/vpavlenko/events{/privacy}","received_events_url":"https://api.github.com/users/vpavlenko/received_events","type":"User","site_admin":false},"body":"Прошу прощения, может кинуться три разных исключения. \r\nhttp://docs.oracle.com/javase/7/docs/api/java/io/RandomAccessFile.html\r\n\r\nПредлагаю либо не ловить, либо выводить разные и понятные сообщения об ошибках. В противном случае, мутное сообщение об ошибке резко затруднит отладку.","created_at":"2014-10-11T16:43:32Z","updated_at":"2014-10-11T16:43:32Z","html_url":"https://github.com/dkomanov/fizteh-java-2014/pull/163#discussion_r18742538","pull_request_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/163","_links":{"self":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/comments/18742538"},"html":{"href":"https://github.com/dkomanov/fizteh-java-2014/pull/163#discussion_r18742538"},"pull_request":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/163"}}},"pull_request":{"url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/163","id":22384040,"html_url":"https://github.com/dkomanov/fizteh-java-2014/pull/163","diff_url":"https://github.com/dkomanov/fizteh-java-2014/pull/163.diff","patch_url":"https://github.com/dkomanov/fizteh-java-2014/pull/163.patch","issue_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues/163","number":163,"state":"open","locked":false,"title":"Насибуллин Оскар, 397, FileMap","user":{"login":"HYXYH","id":8844031,"avatar_url":"https://avatars.githubusercontent.com/u/8844031?v=2","gravatar_id":"","url":"https://api.github.com/users/HYXYH","html_url":"https://github.com/HYXYH","followers_url":"https://api.github.com/users/HYXYH/followers","following_url":"https://api.github.com/users/HYXYH/following{/other_user}","gists_url":"https://api.github.com/users/HYXYH/gists{/gist_id}","starred_url":"https://api.github.com/users/HYXYH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HYXYH/subscriptions","organizations_url":"https://api.github.com/users/HYXYH/orgs","repos_url":"https://api.github.com/users/HYXYH/repos","events_url":"https://api.github.com/users/HYXYH/events{/privacy}","received_events_url":"https://api.github.com/users/HYXYH/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-10-07T21:10:32Z","updated_at":"2014-10-11T16:43:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"74d93255355a621c30ccccdbcc41cef649b69c09","assignee":{"login":"vpavlenko","id":1491908,"avatar_url":"https://avatars.githubusercontent.com/u/1491908?v=2","gravatar_id":"","url":"https://api.github.com/users/vpavlenko","html_url":"https://github.com/vpavlenko","followers_url":"https://api.github.com/users/vpavlenko/followers","following_url":"https://api.github.com/users/vpavlenko/following{/other_user}","gists_url":"https://api.github.com/users/vpavlenko/gists{/gist_id}","starred_url":"https://api.github.com/users/vpavlenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vpavlenko/subscriptions","organizations_url":"https://api.github.com/users/vpavlenko/orgs","repos_url":"https://api.github.com/users/vpavlenko/repos","events_url":"https://api.github.com/users/vpavlenko/events{/privacy}","received_events_url":"https://api.github.com/users/vpavlenko/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/163/commits","review_comments_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/163/comments","review_comment_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/comments/{number}","comments_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues/163/comments","statuses_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/statuses/de22d50d8500952d670ca2652571ad412862e9b9","head":{"label":"HYXYH:master","ref":"master","sha":"de22d50d8500952d670ca2652571ad412862e9b9","user":{"login":"HYXYH","id":8844031,"avatar_url":"https://avatars.githubusercontent.com/u/8844031?v=2","gravatar_id":"","url":"https://api.github.com/users/HYXYH","html_url":"https://github.com/HYXYH","followers_url":"https://api.github.com/users/HYXYH/followers","following_url":"https://api.github.com/users/HYXYH/following{/other_user}","gists_url":"https://api.github.com/users/HYXYH/gists{/gist_id}","starred_url":"https://api.github.com/users/HYXYH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HYXYH/subscriptions","organizations_url":"https://api.github.com/users/HYXYH/orgs","repos_url":"https://api.github.com/users/HYXYH/repos","events_url":"https://api.github.com/users/HYXYH/events{/privacy}","received_events_url":"https://api.github.com/users/HYXYH/received_events","type":"User","site_admin":false},"repo":{"id":24267812,"name":"fizteh-java-2014","full_name":"HYXYH/fizteh-java-2014","owner":{"login":"HYXYH","id":8844031,"avatar_url":"https://avatars.githubusercontent.com/u/8844031?v=2","gravatar_id":"","url":"https://api.github.com/users/HYXYH","html_url":"https://github.com/HYXYH","followers_url":"https://api.github.com/users/HYXYH/followers","following_url":"https://api.github.com/users/HYXYH/following{/other_user}","gists_url":"https://api.github.com/users/HYXYH/gists{/gist_id}","starred_url":"https://api.github.com/users/HYXYH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HYXYH/subscriptions","organizations_url":"https://api.github.com/users/HYXYH/orgs","repos_url":"https://api.github.com/users/HYXYH/repos","events_url":"https://api.github.com/users/HYXYH/events{/privacy}","received_events_url":"https://api.github.com/users/HYXYH/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/HYXYH/fizteh-java-2014","description":"","fork":true,"url":"https://api.github.com/repos/HYXYH/fizteh-java-2014","forks_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/forks","keys_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/teams","hooks_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/hooks","issue_events_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/issues/events{/number}","events_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/events","assignees_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/assignees{/user}","branches_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/branches{/branch}","tags_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/tags","blobs_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/git/refs{/sha}","trees_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/statuses/{sha}","languages_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/languages","stargazers_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/stargazers","contributors_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/contributors","subscribers_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/subscribers","subscription_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/subscription","commits_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/commits{/sha}","git_commits_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/git/commits{/sha}","comments_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/comments{/number}","issue_comment_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/issues/comments/{number}","contents_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/contents/{+path}","compare_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/merges","archive_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/downloads","issues_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/issues{/number}","pulls_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/pulls{/number}","milestones_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/milestones{/number}","notifications_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/labels{/name}","releases_url":"https://api.github.com/repos/HYXYH/fizteh-java-2014/releases{/id}","created_at":"2014-09-20T16:25:56Z","updated_at":"2014-09-29T17:46:55Z","pushed_at":"2014-10-08T12:51:08Z","git_url":"git://github.com/HYXYH/fizteh-java-2014.git","ssh_url":"git@github.com:HYXYH/fizteh-java-2014.git","clone_url":"https://github.com/HYXYH/fizteh-java-2014.git","svn_url":"https://github.com/HYXYH/fizteh-java-2014","homepage":null,"size":170,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"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":"dkomanov:master","ref":"master","sha":"6513486a7ea7ef87dc471eda6fa53a179fcfc7eb","user":{"login":"dkomanov","id":1158662,"avatar_url":"https://avatars.githubusercontent.com/u/1158662?v=2","gravatar_id":"","url":"https://api.github.com/users/dkomanov","html_url":"https://github.com/dkomanov","followers_url":"https://api.github.com/users/dkomanov/followers","following_url":"https://api.github.com/users/dkomanov/following{/other_user}","gists_url":"https://api.github.com/users/dkomanov/gists{/gist_id}","starred_url":"https://api.github.com/users/dkomanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkomanov/subscriptions","organizations_url":"https://api.github.com/users/dkomanov/orgs","repos_url":"https://api.github.com/users/dkomanov/repos","events_url":"https://api.github.com/users/dkomanov/events{/privacy}","received_events_url":"https://api.github.com/users/dkomanov/received_events","type":"User","site_admin":false},"repo":{"id":23866876,"name":"fizteh-java-2014","full_name":"dkomanov/fizteh-java-2014","owner":{"login":"dkomanov","id":1158662,"avatar_url":"https://avatars.githubusercontent.com/u/1158662?v=2","gravatar_id":"","url":"https://api.github.com/users/dkomanov","html_url":"https://github.com/dkomanov","followers_url":"https://api.github.com/users/dkomanov/followers","following_url":"https://api.github.com/users/dkomanov/following{/other_user}","gists_url":"https://api.github.com/users/dkomanov/gists{/gist_id}","starred_url":"https://api.github.com/users/dkomanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkomanov/subscriptions","organizations_url":"https://api.github.com/users/dkomanov/orgs","repos_url":"https://api.github.com/users/dkomanov/repos","events_url":"https://api.github.com/users/dkomanov/events{/privacy}","received_events_url":"https://api.github.com/users/dkomanov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dkomanov/fizteh-java-2014","description":"","fork":false,"url":"https://api.github.com/repos/dkomanov/fizteh-java-2014","forks_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/forks","keys_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/teams","hooks_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/hooks","issue_events_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues/events{/number}","events_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/events","assignees_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/assignees{/user}","branches_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/branches{/branch}","tags_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/tags","blobs_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/git/refs{/sha}","trees_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/statuses/{sha}","languages_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/languages","stargazers_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/stargazers","contributors_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/contributors","subscribers_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/subscribers","subscription_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/subscription","commits_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/commits{/sha}","git_commits_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/git/commits{/sha}","comments_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/comments{/number}","issue_comment_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues/comments/{number}","contents_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/contents/{+path}","compare_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/merges","archive_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/downloads","issues_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues{/number}","pulls_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls{/number}","milestones_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/milestones{/number}","notifications_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/labels{/name}","releases_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/releases{/id}","created_at":"2014-09-10T08:32:49Z","updated_at":"2014-10-10T15:24:33Z","pushed_at":"2014-10-10T13:38:10Z","git_url":"git://github.com/dkomanov/fizteh-java-2014.git","ssh_url":"git@github.com:dkomanov/fizteh-java-2014.git","clone_url":"https://github.com/dkomanov/fizteh-java-2014.git","svn_url":"https://github.com/dkomanov/fizteh-java-2014","homepage":null,"size":7531,"stargazers_count":6,"watchers_count":6,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":85,"mirror_url":null,"open_issues_count":56,"forks":85,"open_issues":56,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/163"},"html":{"href":"https://github.com/dkomanov/fizteh-java-2014/pull/163"},"issue":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues/163"},"comments":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues/163/comments"},"review_comments":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/163/comments"},"review_comment":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/163/commits"},"statuses":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/statuses/de22d50d8500952d670ca2652571ad412862e9b9"}}}}