{"action":"created","comment":{"url":"https://api.github.com/repos/JabRef/jabref/pulls/comments/111447577","pull_request_review_id":32696102,"id":111447577,"diff_hunk":"@@ -0,0 +1,46 @@\n+package org.jabref.logic.bibtexkeypattern;\n+\n+import org.jabref.model.entry.BibEntry;\n+\n+import org.junit.Before;\n+import org.junit.Test;\n+\n+import static org.junit.Assert.assertEquals;\n+\n+public class MakeLabelWithoutDatabaseTest {\n+\n+    // private GlobalBibtexKeyPattern pattern;\n+    private BibEntry entry;\n+\n+    @Before\n+    public void setUp() {\n+        entry = new BibEntry();\n+        entry.setField(\"author\", \"John Doe\");\n+        entry.setField(\"year\", \"2016\");\n+        entry.setField(\"title\", \"An awesome paper on JabRef\");\n+    }\n+\n+    @Test\n+    public void makeLabelForFileSearch() {\n+        String label = BibtexKeyPatternUtil.makeLabel(entry,\n+                /*value=*/ \"auth\",","path":"src/test/java/org/jabref/logic/bibtexkeypattern/MakeLabelWithoutDatabaseTest.java","position":null,"original_position":26,"commit_id":"ed5e96d7f88db992f2e1f7e79da3b0cb7245784a","original_commit_id":"7897e513c5d00cbc778465ec32f600473fdfa6da","user":{"login":"sauliusg","id":10668420,"avatar_url":"https://avatars0.githubusercontent.com/u/10668420?v=3","gravatar_id":"","url":"https://api.github.com/users/sauliusg","html_url":"https://github.com/sauliusg","followers_url":"https://api.github.com/users/sauliusg/followers","following_url":"https://api.github.com/users/sauliusg/following{/other_user}","gists_url":"https://api.github.com/users/sauliusg/gists{/gist_id}","starred_url":"https://api.github.com/users/sauliusg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sauliusg/subscriptions","organizations_url":"https://api.github.com/users/sauliusg/orgs","repos_url":"https://api.github.com/users/sauliusg/repos","events_url":"https://api.github.com/users/sauliusg/events{/privacy}","received_events_url":"https://api.github.com/users/sauliusg/received_events","type":"User","site_admin":false},"body":"Both issues fixed, please find a new push.","created_at":"2017-04-13T17:49:45Z","updated_at":"2017-04-13T17:49:45Z","html_url":"https://github.com/JabRef/jabref/pull/2732#discussion_r111447577","pull_request_url":"https://api.github.com/repos/JabRef/jabref/pulls/2732","_links":{"self":{"href":"https://api.github.com/repos/JabRef/jabref/pulls/comments/111447577"},"html":{"href":"https://github.com/JabRef/jabref/pull/2732#discussion_r111447577"},"pull_request":{"href":"https://api.github.com/repos/JabRef/jabref/pulls/2732"}}},"pull_request":{"url":"https://api.github.com/repos/JabRef/jabref/pulls/2732","id":115609542,"html_url":"https://github.com/JabRef/jabref/pull/2732","diff_url":"https://github.com/JabRef/jabref/pull/2732.diff","patch_url":"https://github.com/JabRef/jabref/pull/2732.patch","issue_url":"https://api.github.com/repos/JabRef/jabref/issues/2732","number":2732,"state":"open","locked":false,"title":"Fix 2701 too may files found","user":{"login":"sauliusg","id":10668420,"avatar_url":"https://avatars0.githubusercontent.com/u/10668420?v=3","gravatar_id":"","url":"https://api.github.com/users/sauliusg","html_url":"https://github.com/sauliusg","followers_url":"https://api.github.com/users/sauliusg/followers","following_url":"https://api.github.com/users/sauliusg/following{/other_user}","gists_url":"https://api.github.com/users/sauliusg/gists{/gist_id}","starred_url":"https://api.github.com/users/sauliusg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sauliusg/subscriptions","organizations_url":"https://api.github.com/users/sauliusg/orgs","repos_url":"https://api.github.com/users/sauliusg/repos","events_url":"https://api.github.com/users/sauliusg/events{/privacy}","received_events_url":"https://api.github.com/users/sauliusg/received_events","type":"User","site_admin":false},"body":"<!-- describe the changes you have made here: what, why, ... -->\r\n\r\nI would like to offer my fix for the issue  2701: JabRef would find too many files when they are search with the [year]_[auth].* pattern. The reason seems to be a 'null' database passed to the BibtexKeyPatternUtil.makeLabel(BibEntry, String, Character, BibDatabase) method, and a null pointer exception is triggered. As a result, the '[auth]' part of the pattern was erased and ignored. With the suggested fix, JabRef uses the '[auth]' part of the pattern and finds just the files with the matching author, as expected. A relevant unit test was added; no other tests were broken.\r\n\r\n- [ ] Change in CHANGELOG.md described -- no functionality changes, restored the previous state\r\n- [x ] Tests created for changes -- 1 unit test added;\r\n- [ ] Screenshots added (for bigger UI changes) -- no GUI changes;\r\n- [ ] Manually tested changed features in running JabRef -- none\r\n- [x ] Check documentation status (Issue created for outdated help page at [help.jabref.org](https://github.com/JabRef/help.jabref.org/issues)?) -- the issue #2701 still open.\r\n- [ ] If you changed the localization: Did you run `gradle localizationUpdate`? -- no localisation changes.\r\n","created_at":"2017-04-12T18:45:47Z","updated_at":"2017-04-13T17:49:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0ee2e37887a80389877aa26a42a183f47ffee42c","assignee":{"login":"lynyus","id":1254003,"avatar_url":"https://avatars0.githubusercontent.com/u/1254003?v=3","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://avatars0.githubusercontent.com/u/1254003?v=3","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}],"milestone":null,"commits_url":"https://api.github.com/repos/JabRef/jabref/pulls/2732/commits","review_comments_url":"https://api.github.com/repos/JabRef/jabref/pulls/2732/comments","review_comment_url":"https://api.github.com/repos/JabRef/jabref/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JabRef/jabref/issues/2732/comments","statuses_url":"https://api.github.com/repos/JabRef/jabref/statuses/ed5e96d7f88db992f2e1f7e79da3b0cb7245784a","head":{"label":"sauliusg:fix-2701-too-may-files-found","ref":"fix-2701-too-may-files-found","sha":"ed5e96d7f88db992f2e1f7e79da3b0cb7245784a","user":{"login":"sauliusg","id":10668420,"avatar_url":"https://avatars0.githubusercontent.com/u/10668420?v=3","gravatar_id":"","url":"https://api.github.com/users/sauliusg","html_url":"https://github.com/sauliusg","followers_url":"https://api.github.com/users/sauliusg/followers","following_url":"https://api.github.com/users/sauliusg/following{/other_user}","gists_url":"https://api.github.com/users/sauliusg/gists{/gist_id}","starred_url":"https://api.github.com/users/sauliusg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sauliusg/subscriptions","organizations_url":"https://api.github.com/users/sauliusg/orgs","repos_url":"https://api.github.com/users/sauliusg/repos","events_url":"https://api.github.com/users/sauliusg/events{/privacy}","received_events_url":"https://api.github.com/users/sauliusg/received_events","type":"User","site_admin":false},"repo":{"id":76672587,"name":"jabref","full_name":"sauliusg/jabref","owner":{"login":"sauliusg","id":10668420,"avatar_url":"https://avatars0.githubusercontent.com/u/10668420?v=3","gravatar_id":"","url":"https://api.github.com/users/sauliusg","html_url":"https://github.com/sauliusg","followers_url":"https://api.github.com/users/sauliusg/followers","following_url":"https://api.github.com/users/sauliusg/following{/other_user}","gists_url":"https://api.github.com/users/sauliusg/gists{/gist_id}","starred_url":"https://api.github.com/users/sauliusg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sauliusg/subscriptions","organizations_url":"https://api.github.com/users/sauliusg/orgs","repos_url":"https://api.github.com/users/sauliusg/repos","events_url":"https://api.github.com/users/sauliusg/events{/privacy}","received_events_url":"https://api.github.com/users/sauliusg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sauliusg/jabref","description":"Graphical Java application for managing BibTeX and BibLaTeX (.bib) databases","fork":true,"url":"https://api.github.com/repos/sauliusg/jabref","forks_url":"https://api.github.com/repos/sauliusg/jabref/forks","keys_url":"https://api.github.com/repos/sauliusg/jabref/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sauliusg/jabref/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sauliusg/jabref/teams","hooks_url":"https://api.github.com/repos/sauliusg/jabref/hooks","issue_events_url":"https://api.github.com/repos/sauliusg/jabref/issues/events{/number}","events_url":"https://api.github.com/repos/sauliusg/jabref/events","assignees_url":"https://api.github.com/repos/sauliusg/jabref/assignees{/user}","branches_url":"https://api.github.com/repos/sauliusg/jabref/branches{/branch}","tags_url":"https://api.github.com/repos/sauliusg/jabref/tags","blobs_url":"https://api.github.com/repos/sauliusg/jabref/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sauliusg/jabref/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sauliusg/jabref/git/refs{/sha}","trees_url":"https://api.github.com/repos/sauliusg/jabref/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sauliusg/jabref/statuses/{sha}","languages_url":"https://api.github.com/repos/sauliusg/jabref/languages","stargazers_url":"https://api.github.com/repos/sauliusg/jabref/stargazers","contributors_url":"https://api.github.com/repos/sauliusg/jabref/contributors","subscribers_url":"https://api.github.com/repos/sauliusg/jabref/subscribers","subscription_url":"https://api.github.com/repos/sauliusg/jabref/subscription","commits_url":"https://api.github.com/repos/sauliusg/jabref/commits{/sha}","git_commits_url":"https://api.github.com/repos/sauliusg/jabref/git/commits{/sha}","comments_url":"https://api.github.com/repos/sauliusg/jabref/comments{/number}","issue_comment_url":"https://api.github.com/repos/sauliusg/jabref/issues/comments{/number}","contents_url":"https://api.github.com/repos/sauliusg/jabref/contents/{+path}","compare_url":"https://api.github.com/repos/sauliusg/jabref/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sauliusg/jabref/merges","archive_url":"https://api.github.com/repos/sauliusg/jabref/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sauliusg/jabref/downloads","issues_url":"https://api.github.com/repos/sauliusg/jabref/issues{/number}","pulls_url":"https://api.github.com/repos/sauliusg/jabref/pulls{/number}","milestones_url":"https://api.github.com/repos/sauliusg/jabref/milestones{/number}","notifications_url":"https://api.github.com/repos/sauliusg/jabref/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sauliusg/jabref/labels{/name}","releases_url":"https://api.github.com/repos/sauliusg/jabref/releases{/id}","deployments_url":"https://api.github.com/repos/sauliusg/jabref/deployments","created_at":"2016-12-16T17:29:30Z","updated_at":"2016-12-16T17:29:36Z","pushed_at":"2017-04-13T17:47:25Z","git_url":"git://github.com/sauliusg/jabref.git","ssh_url":"git@github.com:sauliusg/jabref.git","clone_url":"https://github.com/sauliusg/jabref.git","svn_url":"https://github.com/sauliusg/jabref","homepage":"https://www.jabref.org/","size":95505,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"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":"JabRef:master","ref":"master","sha":"b05e5024e2af0315c43a22c2cf7b26b23e68fad3","user":{"login":"JabRef","id":3914421,"avatar_url":"https://avatars2.githubusercontent.com/u/3914421?v=3","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://avatars2.githubusercontent.com/u/3914421?v=3","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-04-12T17:14:15Z","pushed_at":"2017-04-13T17:47:27Z","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":96860,"stargazers_count":485,"watchers_count":485,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":305,"mirror_url":null,"open_issues_count":140,"forks":305,"open_issues":140,"watchers":485,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JabRef/jabref/pulls/2732"},"html":{"href":"https://github.com/JabRef/jabref/pull/2732"},"issue":{"href":"https://api.github.com/repos/JabRef/jabref/issues/2732"},"comments":{"href":"https://api.github.com/repos/JabRef/jabref/issues/2732/comments"},"review_comments":{"href":"https://api.github.com/repos/JabRef/jabref/pulls/2732/comments"},"review_comment":{"href":"https://api.github.com/repos/JabRef/jabref/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JabRef/jabref/pulls/2732/commits"},"statuses":{"href":"https://api.github.com/repos/JabRef/jabref/statuses/ed5e96d7f88db992f2e1f7e79da3b0cb7245784a"}}}}
{"actor":{"display_login":"sauliusg"}}