{"action":"created","comment":{"url":"https://api.github.com/repos/debrief/debrief/pulls/comments/34227273","id":34227273,"diff_hunk":"@@ -1505,50 +1505,17 @@ else if (input instanceof FileStoreEditorInput)\n \n \t\t\t\t\t\t\t\tfinal IFile file = ((IFileEditorInput) getEditorInput())\n \t\t\t\t\t\t\t\t\t\t.getFile();\n-\n-\t\t\t\t\t\t\t\t// get the current path (since we're going to be moving the temp\n-\t\t\t\t\t\t\t\t// one to it\n-\t\t\t\t\t\t\t\tfinal IPath thePath = file.getLocation();\n-\n-\t\t\t\t\t\t\t\t// create a backup path\n-\t\t\t\t\t\t\t\tfinal IPath bakPath = file.getFullPath()\n-\t\t\t\t\t\t\t\t\t\t.addFileExtension(\"bak\");\n-\n-\t\t\t\t\t\t\t\t// delete any existing backup file\n-\t\t\t\t\t\t\t\tfinal File existingBackupFile = new File(file.getLocation()\n-\t\t\t\t\t\t\t\t\t\t.addFileExtension(\"bak\").toOSString());\n-\t\t\t\t\t\t\t\tif (existingBackupFile.exists())\n-\t\t\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\t\tCorePlugin.logError(Status.INFO,\n-\t\t\t\t\t\t\t\t\t\t\t\"Existing back file still there, having to delete\"\n-\t\t\t\t\t\t\t\t\t\t\t\t\t+ existingBackupFile.getAbsolutePath(), null);\n-\t\t\t\t\t\t\t\t\texistingBackupFile.delete();\n-\t\t\t\t\t\t\t\t}\n-\n-\t\t\t\t\t\t\t\t// now rename the existing file as the backup\n-\t\t\t\t\t\t\t\tfile.move(bakPath, true, monitor);\n-\n-\t\t\t\t\t\t\t\t// move the temp file to be our real working file\n-\t\t\t\t\t\t\t\tfinal File destFile = thePath.toFile().getAbsoluteFile();\n-\t\t\t\t\t\t\t\tif (!tmpFile.renameTo(destFile))\n-\t\t\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\t\tFileUtils.moveFile(tmpFile, destFile);\n-\t\t\t\t\t\t\t\t}\n-\n-\t\t\t\t\t\t\t\t// finally, delete the backup file\n-\t\t\t\t\t\t\t\tif (existingBackupFile.exists())\n-\t\t\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\t\tCorePlugin.logError(Status.INFO,\n-\t\t\t\t\t\t\t\t\t\t\t\"Save operation completed successfully, deleting backup file\"\n-\t\t\t\t\t\t\t\t\t\t\t\t\t+ existingBackupFile.getAbsolutePath(), null);\n-\t\t\t\t\t\t\t\t\texistingBackupFile.delete();\n+\r\n+\t\t\t\t\t\t\t\tInputStream source = null;\r\n+\t\t\t\t\t\t\t\ttry\r\n+\t\t\t\t\t\t\t\t{\r\n+\t\t\t\t\t\t\t\t\tsource = new FileInputStream(tmpFile);\r\n+\t\t\t\t\t\t\t\t\tfile.setContents(source, true, true, monitor);\r\n+\t\t\t\t\t\t\t\t}\r\n+\t\t\t\t\t\t\t\tfinally\r\n+\t\t\t\t\t\t\t\t{\r\n+\t\t\t\t\t\t\t\t\tFileUtil.safeClose(source);\r","path":"org.mwc.debrief.core/src/org/mwc/debrief/core/editors/PlotEditor.java","position":72,"original_position":72,"commit_id":"cd7982807cb4c39193b263d28bf85bf2f597a946","original_commit_id":"cd7982807cb4c39193b263d28bf85bf2f597a946","user":{"login":"IanMayo","id":1108513,"avatar_url":"https://avatars.githubusercontent.com/u/1108513?v=3","gravatar_id":"","url":"https://api.github.com/users/IanMayo","html_url":"https://github.com/IanMayo","followers_url":"https://api.github.com/users/IanMayo/followers","following_url":"https://api.github.com/users/IanMayo/following{/other_user}","gists_url":"https://api.github.com/users/IanMayo/gists{/gist_id}","starred_url":"https://api.github.com/users/IanMayo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IanMayo/subscriptions","organizations_url":"https://api.github.com/users/IanMayo/orgs","repos_url":"https://api.github.com/users/IanMayo/repos","events_url":"https://api.github.com/users/IanMayo/events{/privacy}","received_events_url":"https://api.github.com/users/IanMayo/received_events","type":"User","site_admin":false},"body":"FileUtil.safeClose has a warning against it:\r\n\r\n````\r\nDiscouraged access: The method safeClose(Closeable) from the type FileUtil is not accessible due to restriction on required library /home/ian/Apps/eclipse-SDK-3.8.2-linux-gtk-x86_64/plugins/org.eclipse.core.resources_3.8.1.v20121114-124432.jar\r\n````\r\n\r\nThe class javadoc comment also states that close() should be called & errors handled before calling safeClose().  See the safeClose() javadoc comment here:\r\nhttp://grepcode.com/file/repo1.maven.org/maven2/com.tqlab.docbook/docbook-highlight/1.0.0/org/eclipse/core/internal/utils/FileUtil.java#254","created_at":"2015-07-09T06:41:58Z","updated_at":"2015-07-09T06:41:58Z","html_url":"https://github.com/debrief/debrief/pull/1297#discussion_r34227273","pull_request_url":"https://api.github.com/repos/debrief/debrief/pulls/1297","_links":{"self":{"href":"https://api.github.com/repos/debrief/debrief/pulls/comments/34227273"},"html":{"href":"https://github.com/debrief/debrief/pull/1297#discussion_r34227273"},"pull_request":{"href":"https://api.github.com/repos/debrief/debrief/pulls/1297"}}},"pull_request":{"url":"https://api.github.com/repos/debrief/debrief/pulls/1297","id":39191073,"html_url":"https://github.com/debrief/debrief/pull/1297","diff_url":"https://github.com/debrief/debrief/pull/1297.diff","patch_url":"https://github.com/debrief/debrief/pull/1297.patch","issue_url":"https://api.github.com/repos/debrief/debrief/issues/1297","number":1297,"state":"open","locked":false,"title":"Issue #1292 - Let Eclipse support Local History for DPF & REP files","user":{"login":"pecko","id":534584,"avatar_url":"https://avatars.githubusercontent.com/u/534584?v=3","gravatar_id":"","url":"https://api.github.com/users/pecko","html_url":"https://github.com/pecko","followers_url":"https://api.github.com/users/pecko/followers","following_url":"https://api.github.com/users/pecko/following{/other_user}","gists_url":"https://api.github.com/users/pecko/gists{/gist_id}","starred_url":"https://api.github.com/users/pecko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pecko/subscriptions","organizations_url":"https://api.github.com/users/pecko/orgs","repos_url":"https://api.github.com/users/pecko/repos","events_url":"https://api.github.com/users/pecko/events{/privacy}","received_events_url":"https://api.github.com/users/pecko/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-03T18:13:45Z","updated_at":"2015-07-09T06:41:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"86acd1c1d50de6e95e56ec307b74bb3db5d4bccf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/debrief/debrief/pulls/1297/commits","review_comments_url":"https://api.github.com/repos/debrief/debrief/pulls/1297/comments","review_comment_url":"https://api.github.com/repos/debrief/debrief/pulls/comments{/number}","comments_url":"https://api.github.com/repos/debrief/debrief/issues/1297/comments","statuses_url":"https://api.github.com/repos/debrief/debrief/statuses/cd7982807cb4c39193b263d28bf85bf2f597a946","head":{"label":"pecko:issue1292","ref":"issue1292","sha":"cd7982807cb4c39193b263d28bf85bf2f597a946","user":{"login":"pecko","id":534584,"avatar_url":"https://avatars.githubusercontent.com/u/534584?v=3","gravatar_id":"","url":"https://api.github.com/users/pecko","html_url":"https://github.com/pecko","followers_url":"https://api.github.com/users/pecko/followers","following_url":"https://api.github.com/users/pecko/following{/other_user}","gists_url":"https://api.github.com/users/pecko/gists{/gist_id}","starred_url":"https://api.github.com/users/pecko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pecko/subscriptions","organizations_url":"https://api.github.com/users/pecko/orgs","repos_url":"https://api.github.com/users/pecko/repos","events_url":"https://api.github.com/users/pecko/events{/privacy}","received_events_url":"https://api.github.com/users/pecko/received_events","type":"User","site_admin":false},"repo":{"id":19978491,"name":"debrief","full_name":"pecko/debrief","owner":{"login":"pecko","id":534584,"avatar_url":"https://avatars.githubusercontent.com/u/534584?v=3","gravatar_id":"","url":"https://api.github.com/users/pecko","html_url":"https://github.com/pecko","followers_url":"https://api.github.com/users/pecko/followers","following_url":"https://api.github.com/users/pecko/following{/other_user}","gists_url":"https://api.github.com/users/pecko/gists{/gist_id}","starred_url":"https://api.github.com/users/pecko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pecko/subscriptions","organizations_url":"https://api.github.com/users/pecko/orgs","repos_url":"https://api.github.com/users/pecko/repos","events_url":"https://api.github.com/users/pecko/events{/privacy}","received_events_url":"https://api.github.com/users/pecko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pecko/debrief","description":"Maritime Analysis Tool","fork":true,"url":"https://api.github.com/repos/pecko/debrief","forks_url":"https://api.github.com/repos/pecko/debrief/forks","keys_url":"https://api.github.com/repos/pecko/debrief/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pecko/debrief/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pecko/debrief/teams","hooks_url":"https://api.github.com/repos/pecko/debrief/hooks","issue_events_url":"https://api.github.com/repos/pecko/debrief/issues/events{/number}","events_url":"https://api.github.com/repos/pecko/debrief/events","assignees_url":"https://api.github.com/repos/pecko/debrief/assignees{/user}","branches_url":"https://api.github.com/repos/pecko/debrief/branches{/branch}","tags_url":"https://api.github.com/repos/pecko/debrief/tags","blobs_url":"https://api.github.com/repos/pecko/debrief/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pecko/debrief/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pecko/debrief/git/refs{/sha}","trees_url":"https://api.github.com/repos/pecko/debrief/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pecko/debrief/statuses/{sha}","languages_url":"https://api.github.com/repos/pecko/debrief/languages","stargazers_url":"https://api.github.com/repos/pecko/debrief/stargazers","contributors_url":"https://api.github.com/repos/pecko/debrief/contributors","subscribers_url":"https://api.github.com/repos/pecko/debrief/subscribers","subscription_url":"https://api.github.com/repos/pecko/debrief/subscription","commits_url":"https://api.github.com/repos/pecko/debrief/commits{/sha}","git_commits_url":"https://api.github.com/repos/pecko/debrief/git/commits{/sha}","comments_url":"https://api.github.com/repos/pecko/debrief/comments{/number}","issue_comment_url":"https://api.github.com/repos/pecko/debrief/issues/comments{/number}","contents_url":"https://api.github.com/repos/pecko/debrief/contents/{+path}","compare_url":"https://api.github.com/repos/pecko/debrief/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pecko/debrief/merges","archive_url":"https://api.github.com/repos/pecko/debrief/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pecko/debrief/downloads","issues_url":"https://api.github.com/repos/pecko/debrief/issues{/number}","pulls_url":"https://api.github.com/repos/pecko/debrief/pulls{/number}","milestones_url":"https://api.github.com/repos/pecko/debrief/milestones{/number}","notifications_url":"https://api.github.com/repos/pecko/debrief/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pecko/debrief/labels{/name}","releases_url":"https://api.github.com/repos/pecko/debrief/releases{/id}","created_at":"2014-05-20T11:33:47Z","updated_at":"2015-05-08T16:03:01Z","pushed_at":"2015-07-03T18:13:06Z","git_url":"git://github.com/pecko/debrief.git","ssh_url":"git@github.com:pecko/debrief.git","clone_url":"https://github.com/pecko/debrief.git","svn_url":"https://github.com/pecko/debrief","homepage":null,"size":292794,"stargazers_count":0,"watchers_count":0,"language":"HTML","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":0,"default_branch":"master"}},"base":{"label":"debrief:master","ref":"master","sha":"0a683fe98b64d230c7d10c155ef8baca1ed0629a","user":{"login":"debrief","id":7665856,"avatar_url":"https://avatars.githubusercontent.com/u/7665856?v=3","gravatar_id":"","url":"https://api.github.com/users/debrief","html_url":"https://github.com/debrief","followers_url":"https://api.github.com/users/debrief/followers","following_url":"https://api.github.com/users/debrief/following{/other_user}","gists_url":"https://api.github.com/users/debrief/gists{/gist_id}","starred_url":"https://api.github.com/users/debrief/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/debrief/subscriptions","organizations_url":"https://api.github.com/users/debrief/orgs","repos_url":"https://api.github.com/users/debrief/repos","events_url":"https://api.github.com/users/debrief/events{/privacy}","received_events_url":"https://api.github.com/users/debrief/received_events","type":"Organization","site_admin":false},"repo":{"id":19954711,"name":"debrief","full_name":"debrief/debrief","owner":{"login":"debrief","id":7665856,"avatar_url":"https://avatars.githubusercontent.com/u/7665856?v=3","gravatar_id":"","url":"https://api.github.com/users/debrief","html_url":"https://github.com/debrief","followers_url":"https://api.github.com/users/debrief/followers","following_url":"https://api.github.com/users/debrief/following{/other_user}","gists_url":"https://api.github.com/users/debrief/gists{/gist_id}","starred_url":"https://api.github.com/users/debrief/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/debrief/subscriptions","organizations_url":"https://api.github.com/users/debrief/orgs","repos_url":"https://api.github.com/users/debrief/repos","events_url":"https://api.github.com/users/debrief/events{/privacy}","received_events_url":"https://api.github.com/users/debrief/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/debrief/debrief","description":"The Open Source workbench for Maritime Analysis","fork":false,"url":"https://api.github.com/repos/debrief/debrief","forks_url":"https://api.github.com/repos/debrief/debrief/forks","keys_url":"https://api.github.com/repos/debrief/debrief/keys{/key_id}","collaborators_url":"https://api.github.com/repos/debrief/debrief/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/debrief/debrief/teams","hooks_url":"https://api.github.com/repos/debrief/debrief/hooks","issue_events_url":"https://api.github.com/repos/debrief/debrief/issues/events{/number}","events_url":"https://api.github.com/repos/debrief/debrief/events","assignees_url":"https://api.github.com/repos/debrief/debrief/assignees{/user}","branches_url":"https://api.github.com/repos/debrief/debrief/branches{/branch}","tags_url":"https://api.github.com/repos/debrief/debrief/tags","blobs_url":"https://api.github.com/repos/debrief/debrief/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/debrief/debrief/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/debrief/debrief/git/refs{/sha}","trees_url":"https://api.github.com/repos/debrief/debrief/git/trees{/sha}","statuses_url":"https://api.github.com/repos/debrief/debrief/statuses/{sha}","languages_url":"https://api.github.com/repos/debrief/debrief/languages","stargazers_url":"https://api.github.com/repos/debrief/debrief/stargazers","contributors_url":"https://api.github.com/repos/debrief/debrief/contributors","subscribers_url":"https://api.github.com/repos/debrief/debrief/subscribers","subscription_url":"https://api.github.com/repos/debrief/debrief/subscription","commits_url":"https://api.github.com/repos/debrief/debrief/commits{/sha}","git_commits_url":"https://api.github.com/repos/debrief/debrief/git/commits{/sha}","comments_url":"https://api.github.com/repos/debrief/debrief/comments{/number}","issue_comment_url":"https://api.github.com/repos/debrief/debrief/issues/comments{/number}","contents_url":"https://api.github.com/repos/debrief/debrief/contents/{+path}","compare_url":"https://api.github.com/repos/debrief/debrief/compare/{base}...{head}","merges_url":"https://api.github.com/repos/debrief/debrief/merges","archive_url":"https://api.github.com/repos/debrief/debrief/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/debrief/debrief/downloads","issues_url":"https://api.github.com/repos/debrief/debrief/issues{/number}","pulls_url":"https://api.github.com/repos/debrief/debrief/pulls{/number}","milestones_url":"https://api.github.com/repos/debrief/debrief/milestones{/number}","notifications_url":"https://api.github.com/repos/debrief/debrief/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/debrief/debrief/labels{/name}","releases_url":"https://api.github.com/repos/debrief/debrief/releases{/id}","created_at":"2014-05-19T19:27:32Z","updated_at":"2015-06-11T10:30:06Z","pushed_at":"2015-07-07T19:58:49Z","git_url":"git://github.com/debrief/debrief.git","ssh_url":"git@github.com:debrief/debrief.git","clone_url":"https://github.com/debrief/debrief.git","svn_url":"https://github.com/debrief/debrief","homepage":"www.debrief.info","size":316996,"stargazers_count":6,"watchers_count":6,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":131,"forks":8,"open_issues":131,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/debrief/debrief/pulls/1297"},"html":{"href":"https://github.com/debrief/debrief/pull/1297"},"issue":{"href":"https://api.github.com/repos/debrief/debrief/issues/1297"},"comments":{"href":"https://api.github.com/repos/debrief/debrief/issues/1297/comments"},"review_comments":{"href":"https://api.github.com/repos/debrief/debrief/pulls/1297/comments"},"review_comment":{"href":"https://api.github.com/repos/debrief/debrief/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/debrief/debrief/pulls/1297/commits"},"statuses":{"href":"https://api.github.com/repos/debrief/debrief/statuses/cd7982807cb4c39193b263d28bf85bf2f597a946"}}}}