{"action":"created","comment":{"url":"https://api.github.com/repos/JabRef/jabref/pulls/comments/137126087","pull_request_review_id":60753584,"id":137126087,"diff_hunk":"@@ -150,28 +137,24 @@ public RenamePdfCleanup(boolean onlyRelativePaths, BibDatabaseContext databaseCo\n             //we put an undo of the field content here\n             //the file is not being renamed back, which leads to inconsistencies\n             //if we put a null undo object here, the change by \"doMakePathsRelative\" would overwrite the field value nevertheless.\n-            if (change.isPresent()) {\n-                return Collections.singletonList(change.get());\n-            } else {\n-                return Collections.emptyList();\n-            }\n+            return change.map(Collections::singletonList).orElseGet(Collections::emptyList);\n         }\n         return Collections.emptyList();\n     }\n \n     public String getTargetFileName(LinkedFile flEntry, BibEntry entry) {\n         String realOldFilename = flEntry.getLink();\n \n-        StringBuilder targetFileName = new StringBuilder(FileUtil\n-                .createFileNameFromPattern(databaseContext.getDatabase(), entry, fileNamePattern, layoutPrefs)\n-                .trim());\n-        //Add extension to newFilename\n-        targetFileName.append('.').append(FileHelper.getFileExtension(realOldFilename).orElse(\"pdf\"));\n-        return targetFileName.toString();\n+        String targetFileName = FileUtil.createFileNameFromPattern(","path":"src/main/java/org/jabref/logic/cleanup/RenamePdfCleanup.java","position":154,"original_position":154,"commit_id":"33cb4390c9e6970614d2b2d580aba5910e998fed","original_commit_id":"33cb4390c9e6970614d2b2d580aba5910e998fed","user":{"login":"lynyus","id":1254003,"avatar_url":"https://avatars3.githubusercontent.com/u/1254003?v=4","gravatar_id":"","url":"https://api.github.com/users/lynyus","html_url":"https://github.com/lynyus","followers_url":"https://api.github.com/users/lynyus/followers","following_url":"https://api.github.com/users/lynyus/following{/other_user}","gists_url":"https://api.github.com/users/lynyus/gists{/gist_id}","starred_url":"https://api.github.com/users/lynyus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lynyus/subscriptions","organizations_url":"https://api.github.com/users/lynyus/orgs","repos_url":"https://api.github.com/users/lynyus/repos","events_url":"https://api.github.com/users/lynyus/events{/privacy}","received_events_url":"https://api.github.com/users/lynyus/received_events","type":"User","site_admin":false},"body":"I don't see the point of using a StringBuilder there either, it feels like it clutters the code. Used String.format() as an alternative before, but I think this is the most readable variant.","created_at":"2017-09-05T21:59:58Z","updated_at":"2017-09-05T21:59:58Z","html_url":"https://github.com/JabRef/jabref/pull/2628#discussion_r137126087","pull_request_url":"https://api.github.com/repos/JabRef/jabref/pulls/2628","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/JabRef/jabref/pulls/comments/137126087"},"html":{"href":"https://github.com/JabRef/jabref/pull/2628#discussion_r137126087"},"pull_request":{"href":"https://api.github.com/repos/JabRef/jabref/pulls/2628"}},"in_reply_to_id":137046347},"pull_request":{"url":"https://api.github.com/repos/JabRef/jabref/pulls/2628","id":109862734,"html_url":"https://github.com/JabRef/jabref/pull/2628","diff_url":"https://github.com/JabRef/jabref/pull/2628.diff","patch_url":"https://github.com/JabRef/jabref/pull/2628.patch","issue_url":"https://api.github.com/repos/JabRef/jabref/issues/2628","number":2628,"state":"open","locked":false,"title":"Filenames","user":{"login":"stefan-kolb","id":2141507,"avatar_url":"https://avatars1.githubusercontent.com/u/2141507?v=4","gravatar_id":"","url":"https://api.github.com/users/stefan-kolb","html_url":"https://github.com/stefan-kolb","followers_url":"https://api.github.com/users/stefan-kolb/followers","following_url":"https://api.github.com/users/stefan-kolb/following{/other_user}","gists_url":"https://api.github.com/users/stefan-kolb/gists{/gist_id}","starred_url":"https://api.github.com/users/stefan-kolb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefan-kolb/subscriptions","organizations_url":"https://api.github.com/users/stefan-kolb/orgs","repos_url":"https://api.github.com/users/stefan-kolb/repos","events_url":"https://api.github.com/users/stefan-kolb/events{/privacy}","received_events_url":"https://api.github.com/users/stefan-kolb/received_events","type":"User","site_admin":false},"body":"<!-- describe the changes you have made here: what, why, ... -->\r\n\r\n- [x] Change in CHANGELOG.md described\r\n- [x] Tests created for changes\r\n- [ ] Screenshots added (for bigger UI changes)\r\n- [ ] Manually tested changed features in running JabRef\r\n- [ ] Check documentation status (Issue created for outdated help page at [help.jabref.org](https://github.com/JabRef/help.jabref.org/issues)?)\r\n- [ ] If you changed the localization: Did you run `gradle localizationUpdate`?\r\n","created_at":"2017-03-09T08:33:27Z","updated_at":"2017-09-05T21:59:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4bee7d970316481c855ab18378b1ca9dd9bf87d3","assignee":{"login":"lynyus","id":1254003,"avatar_url":"https://avatars3.githubusercontent.com/u/1254003?v=4","gravatar_id":"","url":"https://api.github.com/users/lynyus","html_url":"https://github.com/lynyus","followers_url":"https://api.github.com/users/lynyus/followers","following_url":"https://api.github.com/users/lynyus/following{/other_user}","gists_url":"https://api.github.com/users/lynyus/gists{/gist_id}","starred_url":"https://api.github.com/users/lynyus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lynyus/subscriptions","organizations_url":"https://api.github.com/users/lynyus/orgs","repos_url":"https://api.github.com/users/lynyus/repos","events_url":"https://api.github.com/users/lynyus/events{/privacy}","received_events_url":"https://api.github.com/users/lynyus/received_events","type":"User","site_admin":false},"assignees":[{"login":"lynyus","id":1254003,"avatar_url":"https://avatars3.githubusercontent.com/u/1254003?v=4","gravatar_id":"","url":"https://api.github.com/users/lynyus","html_url":"https://github.com/lynyus","followers_url":"https://api.github.com/users/lynyus/followers","following_url":"https://api.github.com/users/lynyus/following{/other_user}","gists_url":"https://api.github.com/users/lynyus/gists{/gist_id}","starred_url":"https://api.github.com/users/lynyus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lynyus/subscriptions","organizations_url":"https://api.github.com/users/lynyus/orgs","repos_url":"https://api.github.com/users/lynyus/repos","events_url":"https://api.github.com/users/lynyus/events{/privacy}","received_events_url":"https://api.github.com/users/lynyus/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":{"url":"https://api.github.com/repos/JabRef/jabref/milestones/8","html_url":"https://github.com/JabRef/jabref/milestone/8","labels_url":"https://api.github.com/repos/JabRef/jabref/milestones/8/labels","id":1776028,"number":8,"title":"v4.0","description":"First release with (partial use of) JavaFX","creator":{"login":"stefan-kolb","id":2141507,"avatar_url":"https://avatars1.githubusercontent.com/u/2141507?v=4","gravatar_id":"","url":"https://api.github.com/users/stefan-kolb","html_url":"https://github.com/stefan-kolb","followers_url":"https://api.github.com/users/stefan-kolb/followers","following_url":"https://api.github.com/users/stefan-kolb/following{/other_user}","gists_url":"https://api.github.com/users/stefan-kolb/gists{/gist_id}","starred_url":"https://api.github.com/users/stefan-kolb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefan-kolb/subscriptions","organizations_url":"https://api.github.com/users/stefan-kolb/orgs","repos_url":"https://api.github.com/users/stefan-kolb/repos","events_url":"https://api.github.com/users/stefan-kolb/events{/privacy}","received_events_url":"https://api.github.com/users/stefan-kolb/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":98,"state":"open","created_at":"2016-05-19T09:32:14Z","updated_at":"2017-09-05T14:16:11Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/JabRef/jabref/pulls/2628/commits","review_comments_url":"https://api.github.com/repos/JabRef/jabref/pulls/2628/comments","review_comment_url":"https://api.github.com/repos/JabRef/jabref/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JabRef/jabref/issues/2628/comments","statuses_url":"https://api.github.com/repos/JabRef/jabref/statuses/33cb4390c9e6970614d2b2d580aba5910e998fed","head":{"label":"JabRef:valid-filenames","ref":"valid-filenames","sha":"33cb4390c9e6970614d2b2d580aba5910e998fed","user":{"login":"JabRef","id":3914421,"avatar_url":"https://avatars1.githubusercontent.com/u/3914421?v=4","gravatar_id":"","url":"https://api.github.com/users/JabRef","html_url":"https://github.com/JabRef","followers_url":"https://api.github.com/users/JabRef/followers","following_url":"https://api.github.com/users/JabRef/following{/other_user}","gists_url":"https://api.github.com/users/JabRef/gists{/gist_id}","starred_url":"https://api.github.com/users/JabRef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JabRef/subscriptions","organizations_url":"https://api.github.com/users/JabRef/orgs","repos_url":"https://api.github.com/users/JabRef/repos","events_url":"https://api.github.com/users/JabRef/events{/privacy}","received_events_url":"https://api.github.com/users/JabRef/received_events","type":"Organization","site_admin":false},"repo":{"id":17634071,"name":"jabref","full_name":"JabRef/jabref","owner":{"login":"JabRef","id":3914421,"avatar_url":"https://avatars1.githubusercontent.com/u/3914421?v=4","gravatar_id":"","url":"https://api.github.com/users/JabRef","html_url":"https://github.com/JabRef","followers_url":"https://api.github.com/users/JabRef/followers","following_url":"https://api.github.com/users/JabRef/following{/other_user}","gists_url":"https://api.github.com/users/JabRef/gists{/gist_id}","starred_url":"https://api.github.com/users/JabRef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JabRef/subscriptions","organizations_url":"https://api.github.com/users/JabRef/orgs","repos_url":"https://api.github.com/users/JabRef/repos","events_url":"https://api.github.com/users/JabRef/events{/privacy}","received_events_url":"https://api.github.com/users/JabRef/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JabRef/jabref","description":"Graphical Java application for managing BibTeX and BibLaTeX (.bib) databases","fork":false,"url":"https://api.github.com/repos/JabRef/jabref","forks_url":"https://api.github.com/repos/JabRef/jabref/forks","keys_url":"https://api.github.com/repos/JabRef/jabref/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JabRef/jabref/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JabRef/jabref/teams","hooks_url":"https://api.github.com/repos/JabRef/jabref/hooks","issue_events_url":"https://api.github.com/repos/JabRef/jabref/issues/events{/number}","events_url":"https://api.github.com/repos/JabRef/jabref/events","assignees_url":"https://api.github.com/repos/JabRef/jabref/assignees{/user}","branches_url":"https://api.github.com/repos/JabRef/jabref/branches{/branch}","tags_url":"https://api.github.com/repos/JabRef/jabref/tags","blobs_url":"https://api.github.com/repos/JabRef/jabref/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JabRef/jabref/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JabRef/jabref/git/refs{/sha}","trees_url":"https://api.github.com/repos/JabRef/jabref/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JabRef/jabref/statuses/{sha}","languages_url":"https://api.github.com/repos/JabRef/jabref/languages","stargazers_url":"https://api.github.com/repos/JabRef/jabref/stargazers","contributors_url":"https://api.github.com/repos/JabRef/jabref/contributors","subscribers_url":"https://api.github.com/repos/JabRef/jabref/subscribers","subscription_url":"https://api.github.com/repos/JabRef/jabref/subscription","commits_url":"https://api.github.com/repos/JabRef/jabref/commits{/sha}","git_commits_url":"https://api.github.com/repos/JabRef/jabref/git/commits{/sha}","comments_url":"https://api.github.com/repos/JabRef/jabref/comments{/number}","issue_comment_url":"https://api.github.com/repos/JabRef/jabref/issues/comments{/number}","contents_url":"https://api.github.com/repos/JabRef/jabref/contents/{+path}","compare_url":"https://api.github.com/repos/JabRef/jabref/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JabRef/jabref/merges","archive_url":"https://api.github.com/repos/JabRef/jabref/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JabRef/jabref/downloads","issues_url":"https://api.github.com/repos/JabRef/jabref/issues{/number}","pulls_url":"https://api.github.com/repos/JabRef/jabref/pulls{/number}","milestones_url":"https://api.github.com/repos/JabRef/jabref/milestones{/number}","notifications_url":"https://api.github.com/repos/JabRef/jabref/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JabRef/jabref/labels{/name}","releases_url":"https://api.github.com/repos/JabRef/jabref/releases{/id}","deployments_url":"https://api.github.com/repos/JabRef/jabref/deployments","created_at":"2014-03-11T14:48:42Z","updated_at":"2017-09-05T15:55:09Z","pushed_at":"2017-09-05T18:42:13Z","git_url":"git://github.com/JabRef/jabref.git","ssh_url":"git@github.com:JabRef/jabref.git","clone_url":"https://github.com/JabRef/jabref.git","svn_url":"https://github.com/JabRef/jabref","homepage":"https://www.jabref.org/","size":102347,"stargazers_count":623,"watchers_count":623,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":425,"mirror_url":null,"open_issues_count":189,"forks":425,"open_issues":189,"watchers":623,"default_branch":"master"}},"base":{"label":"JabRef:master","ref":"master","sha":"c416818deba486605779a375a8f09f605c8dec9c","user":{"login":"JabRef","id":3914421,"avatar_url":"https://avatars1.githubusercontent.com/u/3914421?v=4","gravatar_id":"","url":"https://api.github.com/users/JabRef","html_url":"https://github.com/JabRef","followers_url":"https://api.github.com/users/JabRef/followers","following_url":"https://api.github.com/users/JabRef/following{/other_user}","gists_url":"https://api.github.com/users/JabRef/gists{/gist_id}","starred_url":"https://api.github.com/users/JabRef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JabRef/subscriptions","organizations_url":"https://api.github.com/users/JabRef/orgs","repos_url":"https://api.github.com/users/JabRef/repos","events_url":"https://api.github.com/users/JabRef/events{/privacy}","received_events_url":"https://api.github.com/users/JabRef/received_events","type":"Organization","site_admin":false},"repo":{"id":17634071,"name":"jabref","full_name":"JabRef/jabref","owner":{"login":"JabRef","id":3914421,"avatar_url":"https://avatars1.githubusercontent.com/u/3914421?v=4","gravatar_id":"","url":"https://api.github.com/users/JabRef","html_url":"https://github.com/JabRef","followers_url":"https://api.github.com/users/JabRef/followers","following_url":"https://api.github.com/users/JabRef/following{/other_user}","gists_url":"https://api.github.com/users/JabRef/gists{/gist_id}","starred_url":"https://api.github.com/users/JabRef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JabRef/subscriptions","organizations_url":"https://api.github.com/users/JabRef/orgs","repos_url":"https://api.github.com/users/JabRef/repos","events_url":"https://api.github.com/users/JabRef/events{/privacy}","received_events_url":"https://api.github.com/users/JabRef/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JabRef/jabref","description":"Graphical Java application for managing BibTeX and BibLaTeX (.bib) databases","fork":false,"url":"https://api.github.com/repos/JabRef/jabref","forks_url":"https://api.github.com/repos/JabRef/jabref/forks","keys_url":"https://api.github.com/repos/JabRef/jabref/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JabRef/jabref/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JabRef/jabref/teams","hooks_url":"https://api.github.com/repos/JabRef/jabref/hooks","issue_events_url":"https://api.github.com/repos/JabRef/jabref/issues/events{/number}","events_url":"https://api.github.com/repos/JabRef/jabref/events","assignees_url":"https://api.github.com/repos/JabRef/jabref/assignees{/user}","branches_url":"https://api.github.com/repos/JabRef/jabref/branches{/branch}","tags_url":"https://api.github.com/repos/JabRef/jabref/tags","blobs_url":"https://api.github.com/repos/JabRef/jabref/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JabRef/jabref/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JabRef/jabref/git/refs{/sha}","trees_url":"https://api.github.com/repos/JabRef/jabref/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JabRef/jabref/statuses/{sha}","languages_url":"https://api.github.com/repos/JabRef/jabref/languages","stargazers_url":"https://api.github.com/repos/JabRef/jabref/stargazers","contributors_url":"https://api.github.com/repos/JabRef/jabref/contributors","subscribers_url":"https://api.github.com/repos/JabRef/jabref/subscribers","subscription_url":"https://api.github.com/repos/JabRef/jabref/subscription","commits_url":"https://api.github.com/repos/JabRef/jabref/commits{/sha}","git_commits_url":"https://api.github.com/repos/JabRef/jabref/git/commits{/sha}","comments_url":"https://api.github.com/repos/JabRef/jabref/comments{/number}","issue_comment_url":"https://api.github.com/repos/JabRef/jabref/issues/comments{/number}","contents_url":"https://api.github.com/repos/JabRef/jabref/contents/{+path}","compare_url":"https://api.github.com/repos/JabRef/jabref/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JabRef/jabref/merges","archive_url":"https://api.github.com/repos/JabRef/jabref/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JabRef/jabref/downloads","issues_url":"https://api.github.com/repos/JabRef/jabref/issues{/number}","pulls_url":"https://api.github.com/repos/JabRef/jabref/pulls{/number}","milestones_url":"https://api.github.com/repos/JabRef/jabref/milestones{/number}","notifications_url":"https://api.github.com/repos/JabRef/jabref/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JabRef/jabref/labels{/name}","releases_url":"https://api.github.com/repos/JabRef/jabref/releases{/id}","deployments_url":"https://api.github.com/repos/JabRef/jabref/deployments","created_at":"2014-03-11T14:48:42Z","updated_at":"2017-09-05T15:55:09Z","pushed_at":"2017-09-05T18:42:13Z","git_url":"git://github.com/JabRef/jabref.git","ssh_url":"git@github.com:JabRef/jabref.git","clone_url":"https://github.com/JabRef/jabref.git","svn_url":"https://github.com/JabRef/jabref","homepage":"https://www.jabref.org/","size":102347,"stargazers_count":623,"watchers_count":623,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":425,"mirror_url":null,"open_issues_count":189,"forks":425,"open_issues":189,"watchers":623,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JabRef/jabref/pulls/2628"},"html":{"href":"https://github.com/JabRef/jabref/pull/2628"},"issue":{"href":"https://api.github.com/repos/JabRef/jabref/issues/2628"},"comments":{"href":"https://api.github.com/repos/JabRef/jabref/issues/2628/comments"},"review_comments":{"href":"https://api.github.com/repos/JabRef/jabref/pulls/2628/comments"},"review_comment":{"href":"https://api.github.com/repos/JabRef/jabref/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JabRef/jabref/pulls/2628/commits"},"statuses":{"href":"https://api.github.com/repos/JabRef/jabref/statuses/33cb4390c9e6970614d2b2d580aba5910e998fed"}},"author_association":"OWNER"}}
{"actor":{"display_login":"lynyus"}}