diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c9f52321f1..5e6690bba86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#NUM`. In case, there is no issue present, the pull request implementing the feature is linked. -Note that this project **does not** adhere to [Semantic Versioning](http://semver.org/). +Note that this project **does not** adhere to [Semantic Versioning](https://semver.org/). ## [Unreleased] @@ -20,6 +20,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - It is possible again to use "current table sort order" for the order of entries when saving. [#9869](https://github.com/JabRef/jabref/issues/9869) - Passwords can be stored in GNOME key ring. [#10274](https://github.com/JabRef/jabref/issues/10274) +- We fixed an issue were groups based on an aux file could not be created due to an exception [#10350](https://github.com/JabRef/jabref/issues/10352) ### Removed @@ -246,7 +247,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We fixed an issue where applied save actions on saving the library file would lead to the dialog "The library has been modified by another program" popping up. [#4877](https://github.com/JabRef/jabref/issues/4877) - We fixed issues with save actions not correctly loaded when opening the library. [#9122](https://github.com/JabRef/jabref/pull/9122) - We fixed the behavior of "Discard changes" when reopening a modified library. [#9361](https://github.com/JabRef/jabref/issues/9361) -- We fixed several bugs regarding the manual and the autosave of library files that could lead to exceptions. [#9067](https://github.com/JabRef/jabref/pull/9067), [#8448](https://github.com/JabRef/jabref/issues/8484), [#8746](https://github.com/JabRef/jabref/issues/8746), [#6684](https://github.com/JabRef/jabref/issues/6684), [#6644](https://github.com/JabRef/jabref/issues/6644), [#6102](https://github.com/JabRef/jabref/issues/6102), [#6002](https://github.com/JabRef/jabref/issues/6000) +- We fixed several bugs regarding the manual and the autosave of library files that could lead to exceptions. [#9067](https://github.com/JabRef/jabref/pull/9067), [#8484](https://github.com/JabRef/jabref/issues/8484), [#8746](https://github.com/JabRef/jabref/issues/8746), [#6684](https://github.com/JabRef/jabref/issues/6684), [#6644](https://github.com/JabRef/jabref/issues/6644), [#6102](https://github.com/JabRef/jabref/issues/6102), [#6000](https://github.com/JabRef/jabref/issues/6000) - We fixed an issue where pdfs were re-indexed on each startup. [#9166](https://github.com/JabRef/jabref/pull/9166) - We fixed an issue when using an unsafe character in the citation key, the auto-linking feature fails to link files. [#9267](https://github.com/JabRef/jabref/issues/9267) - We fixed an issue where a message about changed metadata would occur on saving although nothing changed. [#9159](https://github.com/JabRef/jabref/issues/9159) @@ -267,7 +268,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We fixed some visual glitches with the linked files editor field in the entry editor and increased its height. [#8823](https://github.com/JabRef/jabref/issues/8823) - We fixed some visual inconsistencies (round corners of highlighted buttons). [#8806](https://github.com/JabRef/jabref/issues/8806) - We fixed an issue where JabRef would not exit when a connection to a LibreOffice document was established previously and the document is still open. [#9075](https://github.com/JabRef/jabref/issues/9075) -- We fixed an issue about selecting the save order in the preferences. [#9175](https://github.com/JabRef/jabref/issues/9147) +- We fixed an issue about selecting the save order in the preferences. [#9147](https://github.com/JabRef/jabref/issues/9147) - We fixed an issue where an exception when fetching a DOI was not logged correctly. [koppor#627](https://github.com/koppor/jabref/issues/627) - We fixed an issue where a user could not open an attached file in a new unsaved library. [#9386](https://github.com/JabRef/jabref/issues/9386) - We fixed a typo within a connection error message. [koppor#625](https://github.com/koppor/jabref/issues/625) @@ -393,7 +394,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We fixed an issue where custom "Protected terms" files were missing after a restart of JabRef. [#8608](https://github.com/JabRef/jabref/issues/8608) - We fixed an issue where JabRef could not start due to a missing directory for the fulltex index. [#8579](https://github.com/JabRef/jabref/issues/8579) - We fixed an issue where long article numbers in the `pages` field would cause an exception and preventing the citation style to display. [#8381](https://github.com/JabRef/jabref/issues/8381), [citeproc-java](https://github.com/michel-kraemer/citeproc-java/issues/114) -- We fixed an issue where online links in the file field were not detected correctly and could produce an exception. [#8150](https://github.com/JabRef/jabref/issues/8510) +- We fixed an issue where online links in the file field were not detected correctly and could produce an exception. [#8510](https://github.com/JabRef/jabref/issues/8510) - We fixed an issue where an exception could occur when saving the preferences [#7614](https://github.com/JabRef/jabref/issues/7614) - We fixed an issue where "Copy DOI url" in the right-click menu of the Entry List would just copy the DOI and not the DOI url. [#8389](https://github.com/JabRef/jabref/issues/8389) - We fixed an issue where opening the console from the drop-down menu would cause an exception. [#8466](https://github.com/JabRef/jabref/issues/8466) @@ -420,7 +421,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We integrated the external file types dialog directly inside the preferences. [#8341](https://github.com/JabRef/jabref/pull/8341) - We disabled the add group button color change after adding 10 new groups. [#8051](https://github.com/JabRef/jabref/issues/8051) -- We inverted the logic for resolving [BibTeX strings](https://docs.jabref.org/advanced/strings). This helps to keep `#` chars. By default String resolving is only activated for a couple of standard fields. The list of fields can be modified in the preferences. [#7010](https://github.com/JabRef/jabref/issues/7010), [#7102](https://github.com/JabRef/jabref/issues/7012), [#8303](https://github.com/JabRef/jabref/issues/8303) +- We inverted the logic for resolving [BibTeX strings](https://docs.jabref.org/advanced/strings). This helps to keep `#` chars. By default String resolving is only activated for a couple of standard fields. The list of fields can be modified in the preferences. [#7010](https://github.com/JabRef/jabref/issues/7010), [#7012](https://github.com/JabRef/jabref/issues/7012), [#8303](https://github.com/JabRef/jabref/issues/8303) - We moved the search box in preview preferences closer to the available citation styles list. [#8370](https://github.com/JabRef/jabref/pull/8370) - Changing the preference to show the preview panel as a separate tab now has effect without restarting JabRef. [#8370](https://github.com/JabRef/jabref/pull/8370) - We enabled switching themes in JabRef without the need to restart JabRef. [#7335](https://github.com/JabRef/jabref/pull/7335) @@ -429,7 +430,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve ### Fixed - We fixed an issue where the preferences for "Search and store files relative to library file location" where ignored when the "Main file directory" field was not empty [#8385](https://github.com/JabRef/jabref/issues/8385) -- We fixed an issue where `#`chars in certain fields would be interpreted as BibTeX strings [#7010](https://github.com/JabRef/jabref/issues/7010), [#7102](https://github.com/JabRef/jabref/issues/7012), [#8303](https://github.com/JabRef/jabref/issues/8303) +- We fixed an issue where `#`chars in certain fields would be interpreted as BibTeX strings [#7010](https://github.com/JabRef/jabref/issues/7010), [#7012](https://github.com/JabRef/jabref/issues/7012), [#8303](https://github.com/JabRef/jabref/issues/8303) - We fixed an issue where the fulltext search on an empty library with no documents would lead to an exception [koppor#522](https://github.com/koppor/jabref/issues/522) - We fixed an issue where clicking on "Accept changes" in the merge dialog would lead to an exception [forum#2418](https://discourse.jabref.org/t/the-library-has-been-modified-by-another-program/2418/8) - We fixed an issue where clicking on headings in the entry preview could lead to an exception. [#8292](https://github.com/JabRef/jabref/issues/8292) @@ -500,7 +501,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We fixed an issue where it was impossible to add or modify groups. [#7912](https://github.com/JabRef/jabref/pull/793://github.com/JabRef/jabref/pull/7921) - We fixed an issue about the visible side pane components being out of sync with the view menu. [#8115](https://github.com/JabRef/jabref/issues/8115) - We fixed an issue where the side pane would not close when all its components were closed. [#8082](https://github.com/JabRef/jabref/issues/8082) -- We fixed an issue where exported entries from a Citavi bib containing URLs could not be imported [#7892](https://github.com/JabRef/jabref/issues/7882) +- We fixed an issue where exported entries from a Citavi bib containing URLs could not be imported [#7882](https://github.com/JabRef/jabref/issues/7882) - We fixed an issue where the icons in the search bar had the same color, toggled as well as untoggled. [#8014](https://github.com/JabRef/jabref/pull/8014) - We fixed an issue where typing an invalid UNC path into the "Main file directory" text field caused an error. [#8107](https://github.com/JabRef/jabref/issues/8107) - We fixed an issue where "Open Folder" didn't select the file on macOS in Finder [#8130](https://github.com/JabRef/jabref/issues/8130) @@ -547,7 +548,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We added a keybinding preset for new entries. [#7705](https://github.com/JabRef/jabref/issues/7705) - We added a select all button for the library import function. [#7786](https://github.com/JabRef/jabref/issues/7786) - We added a search feature for journal abbreviations. [#7804](https://github.com/JabRef/jabref/pull/7804) -- We added auto-key-generation progress to the background task list. [#7267](https://github.com/JabRef/jabref/issues/72) +- We added auto-key-generation progress to the background task list. [#7267](https://github.com/JabRef/jabref/issues/7267) - We added the option to write XMP metadata to pdfs from the CLI. [7814](https://github.com/JabRef/jabref/pull/7814) ### Changed @@ -577,7 +578,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We fixed an issue where some texts (e.g. descriptions) in dialogs could not be translated [#7854](https://github.com/JabRef/jabref/issues/7854) - We fixed an issue where import hangs for ris files with "ER - " [#7737](https://github.com/JabRef/jabref/issues/7737) -- We fixed an issue where getting bibliograhpic data from DOI or another identifer did not respect the library mode (BibTeX/biblatex)[#1018](https://github.com/JabRef/jabref/issues/6267) +- We fixed an issue where getting bibliograhpic data from DOI or another identifer did not respect the library mode (BibTeX/biblatex)[#6267](https://github.com/JabRef/jabref/issues/6267) - We fixed an issue where importing entries would not respect the library mode (BibTeX/biblatex)[#1018](https://github.com/JabRef/jabref/issues/1018) - We fixed an issue where an exception occurred when importing entries from a web search [#7606](https://github.com/JabRef/jabref/issues/7606) - We fixed an issue where the table column sort order was not properly stored and resulted in unsorted eports [#7524](https://github.com/JabRef/jabref/issues/7524) @@ -731,7 +732,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We added a new fetcher to enable users to search mEDRA DOIs [#6602](https://github.com/JabRef/jabref/issues/6602) - We added a new fetcher to enable users to search "[Collection of Computer Science Bibliographies](https://liinwww.ira.uka.de/bibliography/index.html)". [#6638](https://github.com/JabRef/jabref/issues/6638) - We added default values for delimiters in Add Subgroup window [#6624](https://github.com/JabRef/jabref/issues/6624) -- We improved responsiveness of general fields specification dialog window. [#6643](https://github.com/JabRef/jabref/issues/6604) +- We improved responsiveness of general fields specification dialog window. [#6604](https://github.com/JabRef/jabref/issues/6604) - We added support for importing ris file and load DOI [#6530](https://github.com/JabRef/jabref/issues/6530) - We added the Library properties to a context menu on the library tabs [#6485](https://github.com/JabRef/jabref/issues/6485) - We added a new field in the preferences in 'BibTeX key generator' for unwanted characters that can be user-specified. [#6295](https://github.com/JabRef/jabref/issues/6295) @@ -874,7 +875,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We fixed an issue where changing entry type doesn't always work when biblatex source is shown. [#5905](https://github.com/JabRef/jabref/issues/5905) - We fixed an issue where the group and the link column were not updated after changing the entry in the main table. [#5985](https://github.com/JabRef/jabref/issues/5985) - We fixed an issue where reordering the groups was not possible after inserting an article. [#6008](https://github.com/JabRef/jabref/issues/6008) -- We fixed an issue where citation styles except the default "Preview" could not be used. [#56220](https://github.com/JabRef/jabref/issues/5622) +- We fixed an issue where citation styles except the default "Preview" could not be used. [#5622](https://github.com/JabRef/jabref/issues/5622) - We fixed an issue where a warning was displayed when the title content is made up of two sentences. [#5832](https://github.com/JabRef/jabref/issues/5832) - We fixed an issue where an exception was thrown when adding a save action without a selected formatter in the library properties [#6069](https://github.com/JabRef/jabref/issues/6069) - We fixed an issue where JabRef's icon was missing in the Export to clipboard Dialog. [#6286](https://github.com/JabRef/jabref/issues/6286) @@ -993,7 +994,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - Sorting in the main table now takes information from cross-referenced entries into account. [#2808](https://github.com/JabRef/jabref/issues/2808) - If a group has a color specified, then entries matched by this group have a small colored bar in front of them in the main table. - Change default icon for groups to a circle because a colored version of the old icon was hard to distinguish from its black counterpart. -- In the main table, the context menu appears now when you press the "context menu" button on the keyboard. [feature request in the forum](http://discourse.jabref.org/t/how-to-enable-keyboard-context-key-windows) +- In the main table, the context menu appears now when you press the "context menu" button on the keyboard. [feature request in the forum](https://discourse.jabref.org/t/how-to-enable-keyboard-context-key-windows) - We added icons to the group side panel to quickly switch between `union` and `intersection` group view mode. [#3269](https://github.com/JabRef/jabref/issues/3269). - We use `https` for [fetching from most online bibliographic database](https://docs.jabref.org/import-using-online-bibliographic-database). - We changed the default keyboard shortcuts for moving between entries when the entry editor is active to ̀alt + up/down. @@ -1019,7 +1020,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We added the ability to execute default action in dialog by using with Ctrl + Enter combination [#4496](https://github.com/JabRef/jabref/issues/4496) - We grouped and reordered the Main Menu (File, Edit, Library, Quality, Tools, and View tabs & icons). [#4666](https://github.com/JabRef/jabref/issues/4666) [#4667](https://github.com/JabRef/jabref/issues/4667) [#4668](https://github.com/JabRef/jabref/issues/4668) [#4669](https://github.com/JabRef/jabref/issues/4669) [#4670](https://github.com/JabRef/jabref/issues/4670) [#4671](https://github.com/JabRef/jabref/issues/4671) [#4672](https://github.com/JabRef/jabref/issues/4672) [#4673](https://github.com/JabRef/jabref/issues/4673) - We added additional modifiers (capitalize, titlecase and sentencecase) to the Bibtex key generator. [#1506](https://github.com/JabRef/jabref/issues/1506) -- We have migrated from the mysql jdbc connector to the mariadb one for better authentication scheme support. [#4746](https://github.com/JabRef/jabref/issues/4745) +- We have migrated from the mysql jdbc connector to the mariadb one for better authentication scheme support. [#4745](https://github.com/JabRef/jabref/issues/4745) - We grouped the toolbar icons and changed the Open Library and Copy icons. [#4584](https://github.com/JabRef/jabref/issues/4584) - We added a browse button next to the path text field for aux-based groups. [#4586](https://github.com/JabRef/jabref/issues/4586) - We changed the title of Group Dialog to "Add subgroup" from "Edit group" when we select Add subgroup option. @@ -1043,7 +1044,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve ### Fixed -- We fixed an issue where JabRef died silently for the user without enough inotify instances [#4874](https://github.com/JabRef/jabref/issues/4847) +- We fixed an issue where JabRef died silently for the user without enough inotify instances [#4874](https://github.com/JabRef/jabref/issues/4874) - We fixed an issue where corresponding groups are sometimes not highlighted when clicking on entries [#3112](https://github.com/JabRef/jabref/issues/3112) - We fixed an issue where custom exports could not be selected in the 'Export (selected) entries' dialog [#4013](https://github.com/JabRef/jabref/issues/4013) - Italic text is now rendered correctly. [#3356](https://github.com/JabRef/jabref/issues/3356) @@ -1061,8 +1062,8 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We improved the parsing of author names whose infix is abbreviated without a dot. [#4864](https://github.com/JabRef/jabref/issues/4864) - We fixed an issues where the entry losses focus when a field is edited and at the same time used for sorting. [#3373](https://github.com/JabRef/jabref/issues/3373) - We fixed an issue where the menu on Mac OS was not displayed in the usual Mac-specific way. [#3146](https://github.com/JabRef/jabref/issues/3146) -- We improved the integrity check for page numbers. [#4113](https://github.com/JabRef/jabref/issues/4113) and [feature request in the forum](http://discourse.jabref.org/t/pages-field-allow-use-of-en-dash/1199) -- We fixed an issue where the order of fields in customized entry types was not saved correctly. [#4033](http://github.com/JabRef/jabref/issues/4033) +- We improved the integrity check for page numbers. [#4113](https://github.com/JabRef/jabref/issues/4113) and [feature request in the forum](https://discourse.jabref.org/t/pages-field-allow-use-of-en-dash/1199) +- We fixed an issue where the order of fields in customized entry types was not saved correctly. [#4033](https://github.com/JabRef/jabref/issues/4033) - We fixed an issue where renaming a group did not change the group name in the interface. [#3189](https://github.com/JabRef/jabref/issues/3189) - We fixed an issue where the groups tree of the last database was still shown even after the database was already closed. - We fixed an issue where the "Open file dialog" may disappear behind other windows. [#3410](https://github.com/JabRef/jabref/issues/3410) @@ -1092,7 +1093,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We fixed an issue where an NullPointer exception was thrown when a referenced entry in an Open/Libre Office document was no longer present in the library. Now an error message with the reference marker of the missing entry is shown. [#4932](https://github.com/JabRef/jabref/issues/4932) - We fixed an issue where a database exception related to a missing timezone was too big. [#4827](https://github.com/JabRef/jabref/issues/4827) - We fixed an issue where the IEEE fetcher returned an error if no keywords were present in the result from the IEEE website [#4997](https://github.com/JabRef/jabref/issues/4997) -- We fixed an issue where the command line help text had several errors, and arguments and descriptions have been rewritten to simplify and detail them better. [#4932](https://github.com/JabRef/jabref/issues/2016) +- We fixed an issue where the command line help text had several errors, and arguments and descriptions have been rewritten to simplify and detail them better. [#2016](https://github.com/JabRef/jabref/issues/2016) - We fixed an issue where the same menu for changing entry type had two different sizes and weights. [#4977](https://github.com/JabRef/jabref/issues/4977) - We fixed an issue where the "Attach file" dialog, in the right-click menu for an entry, started on the working directory instead of the user's main directory. [#4995](https://github.com/JabRef/jabref/issues/4995) - We fixed an issue where the JabRef Icon in the macOS launchpad was not displayed correctly [#5003](https://github.com/JabRef/jabref/issues/5003) diff --git a/build.gradle b/build.gradle index 479b29d3f93..b7acdad747e 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ plugins { id 'org.javamodularity.moduleplugin' version '1.8.12' - id 'org.openjfx.javafxplugin' version '0.0.14' + id 'org.openjfx.javafxplugin' version '0.1.0' id 'org.beryx.jlink' version '2.26.0' @@ -27,7 +27,7 @@ plugins { id 'idea' - id 'org.openrewrite.rewrite' version '6.3.2' + id 'org.openrewrite.rewrite' version '6.3.3' } // Enable following for debugging @@ -83,7 +83,6 @@ sourceSets { } repositories { - mavenLocal() mavenCentral() maven { url 'https://oss.sonatype.org/content/groups/public' } maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' } @@ -169,13 +168,12 @@ dependencies { implementation 'jakarta.annotation:jakarta.annotation-api:2.1.1' implementation 'jakarta.inject:jakarta.inject-api:2.0.1' - - implementation 'org.jabref:afterburner.fx:1.1.0-SNAPSHOT' + implementation('org.jabref:afterburner.fx:2.0.0-SNAPSHOT') implementation 'org.kordamp.ikonli:ikonli-javafx:12.3.1' implementation 'org.kordamp.ikonli:ikonli-materialdesign2-pack:12.3.1' implementation 'com.github.sialcasa.mvvmFX:mvvmfx-validation:f195849ca9' //jitpack implementation 'de.saxsys:mvvmfx:1.8.0' - implementation 'com.tobiasdiez:easybind:2.2.1-SNAPSHOT' + implementation('com.tobiasdiez:easybind:2.2.1-SNAPSHOT') implementation 'org.fxmisc.flowless:flowless:0.7.1' implementation 'org.fxmisc.richtext:richtextfx:0.11.1' implementation (group: 'com.dlsc.gemsfx', name: 'gemsfx', version: '1.77.0') { @@ -196,7 +194,9 @@ dependencies { // route all requests to java.util.logging to SLF4J (which in turn routes to tinylog) implementation 'org.slf4j:jul-to-slf4j:2.0.7' - implementation 'de.undercouch:citeproc-java:3.0.0-beta.2' + implementation('de.undercouch:citeproc-java:3.0.0-beta.2') { + exclude group: 'org.antlr' + } // jakarta.activation is already dependency of glassfish implementation group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: '3.0.1' @@ -253,8 +253,10 @@ dependencies { xjc group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '3.0.2' rewrite(platform("org.openrewrite.recipe:rewrite-recipe-bom:2.2.1")) - rewrite("org.openrewrite.recipe:rewrite-logging-frameworks") rewrite("org.openrewrite.recipe:rewrite-static-analysis") + rewrite("org.openrewrite.recipe:rewrite-logging-frameworks") + rewrite("org.openrewrite.recipe:rewrite-testing-frameworks") + rewrite("org.openrewrite.recipe:rewrite-migrate-java") } clean { @@ -712,24 +714,9 @@ if (OperatingSystem.current().isMacOsX()) { } } } + jmh { warmupIterations = 5 iterations = 10 fork = 2 } - -// Source: https://stackoverflow.com/a/44168582/873282 -task downloadDependencies { - description "Pre-downloads *most* dependencies" - doLast { - configurations.getAsMap().each { name, config -> - println "Retrieving dependencies for $name" - try { - config.files - } catch (e) { - // some cannot be resolved, just log them - project.logger.info e.message - } - } - } -} diff --git a/docs/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/pre-03-code.md b/docs/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/pre-03-code.md index eaab5a062de..726e6ead456 100644 --- a/docs/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/pre-03-code.md +++ b/docs/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/pre-03-code.md @@ -25,7 +25,7 @@ In the following, we will use `c:\git-repositories` as base folder: cd \ mkdir git-repositories cd git-repositories -git clone --depth=10 https://github.com/JabRef/jabref.git +git clone --depth=10 https://github.com/JabRef/jabref.git JabRef cd jabref git remote rename origin upstream git remote add origin https://github.com/YOUR_USERNAME/jabref.git @@ -36,6 +36,8 @@ git branch --set-upstream-to=origin/main main > Note that putting the repo JabRef directly on `C:\` or any other drive letter on Windows causes compile errors (**negative example**: `C:\jabref`). > > Further, if you are building on Windows, make sure that the absolute path to the location of the clone does not contain folders starting with '`u`' (**negative example**: `C:\university\jabref`) as this may currently also cause [compile errors](https://github.com/JabRef/jabref/issues/9783). +> +> Please really ensure that you pass `JabRef` as parameter. Otherwise, you will get `java.lang.IllegalStateException: Module entity with name: jabref should be available`. See [IDEA-317606](https://youtrack.jetbrains.com/issue/IDEA-317606/Changing-only-the-case-of-the-Gradle-root-project-name-causes-exception-while-importing-project-java.lang.IllegalStateException) for details. {: .note-title } > Background diff --git a/rewrite.yml b/rewrite.yml index 69508f500c9..22850179494 100644 --- a/rewrite.yml +++ b/rewrite.yml @@ -99,8 +99,18 @@ recipeList: # We voted against it # - org.openrewrite.staticanalysis.ExplicitInitialization + - org.openrewrite.java.migrate.io.ReplaceFileInOrOutputStreamFinalizeWithClose + + - org.openrewrite.java.recipes.UseJavaParserBuilderInJavaTemplate + - org.openrewrite.java.ShortenFullyQualifiedTypeReferences + - org.openrewrite.java.testing.junit5.AssertTrueInstanceofToAssertInstanceOf + - org.openrewrite.java.testing.junit5.RemoveTryCatchFailBlocks + + # needs another openrewrite dependency + # - org.openrewrite.okhttp.ReorderRequestBodyCreateArguments + - org.openrewrite.staticanalysis.AtomicPrimitiveEqualsUsesGet - org.openrewrite.staticanalysis.BigDecimalRoundingConstantsToEnums - org.openrewrite.staticanalysis.BooleanChecksNotInverted @@ -116,6 +126,7 @@ recipeList: # - org.openrewrite.staticanalysis.DefaultComesLast - org.openrewrite.staticanalysis.EmptyBlock - org.openrewrite.staticanalysis.EqualsAvoidsNull + - org.openrewrite.staticanalysis.EqualsToContentEquals # Needs manual intervention # - org.openrewrite.staticanalysis.ExplicitCharsetOnStringGetBytes - org.openrewrite.staticanalysis.ExternalizableHasNoArgsConstructor @@ -150,7 +161,9 @@ recipeList: - org.openrewrite.staticanalysis.RemoveEmptyJavaDocParameters - org.openrewrite.staticanalysis.RemoveExtraSemicolons - org.openrewrite.staticanalysis.RemoveJavaDocAuthorTag + - org.openrewrite.staticanalysis.RemoveHashCodeCallsFromArrayInstances - org.openrewrite.staticanalysis.RemoveRedundantTypeCast + - org.openrewrite.staticanalysis.RemoveToStringCallsFromArrayInstances - org.openrewrite.staticanalysis.RemoveUnneededAssertion - org.openrewrite.staticanalysis.RemoveUnneededBlock # - org.openrewrite.staticanalysis.RemoveUnusedLocalVariables @@ -159,12 +172,14 @@ recipeList: - org.openrewrite.staticanalysis.RenameMethodsNamedHashcodeEqualOrTostring - org.openrewrite.staticanalysis.ReplaceRedundantFormatWithPrintf - org.openrewrite.staticanalysis.ReplaceStringBuilderWithString + - org.openrewrite.staticanalysis.ReplaceWeekYearWithYear # - org.openrewrite.staticanalysis.ShortenFullyQualifiedTypeReferences # - org.openrewrite.staticanalysis.SimplifyConsecutiveAssignments # - org.openrewrite.staticanalysis.SimplifyCompoundStatement - org.openrewrite.staticanalysis.SimplifyBooleanExpression - org.openrewrite.staticanalysis.SimplifyBooleanReturn - org.openrewrite.staticanalysis.SimplifyDurationCreationUnits + - org.openrewrite.staticanalysis.SortedSetStreamToLinkedHashSet - org.openrewrite.staticanalysis.StaticMethodNotFinal - org.openrewrite.staticanalysis.StringLiteralEquality - org.openrewrite.staticanalysis.TypecastParenPad diff --git a/src/main/java/org/jabref/cli/JournalListMvGenerator.java b/src/main/java/org/jabref/cli/JournalListMvGenerator.java index 154696b3a22..35f25a6edbe 100644 --- a/src/main/java/org/jabref/cli/JournalListMvGenerator.java +++ b/src/main/java/org/jabref/cli/JournalListMvGenerator.java @@ -19,6 +19,8 @@ public class JournalListMvGenerator { public static void main(String[] args) throws IOException { + boolean verbose = (args.length == 1) && ("--verbose".equals(args[0])); + Path abbreviationsDirectory = Path.of("buildres", "abbrv.jabref.org", "journals"); if (!Files.exists(abbreviationsDirectory)) { System.out.println("Path " + abbreviationsDirectory.toAbsolutePath() + " does not exist"); @@ -66,7 +68,9 @@ public static void main(String[] args) throws IOException { Abbreviation::getName, abbreviation -> abbreviation, (abbreviation1, abbreviation2) -> { - System.out.println("Double entry " + abbreviation1.getName()); + if (verbose) { + System.out.println("Double entry " + abbreviation1.getName()); + } return abbreviation2; })); fullToAbbreviation.putAll(abbreviationMap); diff --git a/src/main/java/org/jabref/gui/exporter/WriteMetadataToLinkedPdfsAction.java b/src/main/java/org/jabref/gui/exporter/WriteMetadataToLinkedPdfsAction.java index fb6945d2b85..95f8eb2c7d0 100644 --- a/src/main/java/org/jabref/gui/exporter/WriteMetadataToLinkedPdfsAction.java +++ b/src/main/java/org/jabref/gui/exporter/WriteMetadataToLinkedPdfsAction.java @@ -164,7 +164,7 @@ protected Void call() throws Exception { skipped++; } else { for (Path file : files) { - updateMessage(Localization.lang("Writing metadata to {}", file.getFileName())); + updateMessage(Localization.lang("Writing metadata to %0", file.getFileName())); if (Files.exists(file)) { try { diff --git a/src/main/java/org/jabref/gui/groups/GroupDialogView.java b/src/main/java/org/jabref/gui/groups/GroupDialogView.java index b7b4b020f62..0a7c76d0fe4 100644 --- a/src/main/java/org/jabref/gui/groups/GroupDialogView.java +++ b/src/main/java/org/jabref/gui/groups/GroupDialogView.java @@ -88,20 +88,23 @@ public class GroupDialogView extends BaseDialog { @FXML private TextField texGroupFilePath; - @Inject private FileUpdateMonitor fileUpdateMonitor; - private final EnumMap hierarchyText = new EnumMap<>(GroupHierarchyType.class); private final EnumMap hierarchyToolTip = new EnumMap<>(GroupHierarchyType.class); private final ControlsFxVisualizer validationVisualizer = new ControlsFxVisualizer(); - private final GroupDialogViewModel viewModel; - public GroupDialogView(DialogService dialogService, - BibDatabaseContext currentDatabase, - PreferencesService preferencesService, + private final BibDatabaseContext currentDatabase; + private final AbstractGroup editedGroup; + private GroupDialogViewModel viewModel; + @Inject private FileUpdateMonitor fileUpdateMonitor; + @Inject private DialogService dialogService; + @Inject private PreferencesService preferencesService; + + public GroupDialogView(BibDatabaseContext currentDatabase, AbstractGroup editedGroup, GroupDialogHeader groupDialogHeader) { - viewModel = new GroupDialogViewModel(dialogService, currentDatabase, preferencesService, editedGroup, fileUpdateMonitor); + this.currentDatabase = currentDatabase; + this.editedGroup = editedGroup; ViewLoader.view(this) .load() @@ -117,7 +120,6 @@ public GroupDialogView(DialogService dialogService, this.setTitle(Localization.lang("Edit group") + " " + editedGroup.getName()); } - setResultConverter(viewModel::resultConverter); getDialogPane().getButtonTypes().setAll(ButtonType.OK, ButtonType.CANCEL); final Button confirmDialogButton = (Button) getDialogPane().lookupButton(ButtonType.OK); @@ -128,6 +130,10 @@ public GroupDialogView(DialogService dialogService, @FXML public void initialize() { + viewModel = new GroupDialogViewModel(dialogService, currentDatabase, preferencesService, editedGroup, fileUpdateMonitor); + + setResultConverter(viewModel::resultConverter); + hierarchyText.put(GroupHierarchyType.INCLUDING, Localization.lang("Union")); hierarchyToolTip.put(GroupHierarchyType.INCLUDING, Localization.lang("Include subgroups: When selected, view entries contained in this group or its subgroups")); hierarchyText.put(GroupHierarchyType.REFINING, Localization.lang("Intersection")); diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java b/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java index 8f50bdab229..8877939df48 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java @@ -57,7 +57,7 @@ public class GroupTreeViewModel extends AbstractViewModel { private final Comparator compAlphabetIgnoreCase = (GroupTreeNode v1, GroupTreeNode v2) -> v1 .getName() .compareToIgnoreCase(v2.getName()); - private Optional currentDatabase; + private Optional currentDatabase = Optional.empty(); public GroupTreeViewModel(StateManager stateManager, DialogService dialogService, PreferencesService preferencesService, TaskExecutor taskExecutor, CustomLocalDragboard localDragboard) { this.stateManager = Objects.requireNonNull(stateManager); @@ -159,9 +159,7 @@ private void onActiveDatabaseChanged(Optional newDatabase) { public void addNewSubgroup(GroupNodeViewModel parent, GroupDialogHeader groupDialogHeader) { currentDatabase.ifPresent(database -> { Optional newGroup = dialogService.showCustomDialogAndWait(new GroupDialogView( - dialogService, database, - preferences, null, groupDialogHeader)); @@ -245,9 +243,7 @@ boolean onlyMinorChanges(AbstractGroup oldGroup, AbstractGroup newGroup) { public void editGroup(GroupNodeViewModel oldGroup) { currentDatabase.ifPresent(database -> { Optional newGroup = dialogService.showCustomDialogAndWait(new GroupDialogView( - dialogService, database, - preferences, oldGroup.getGroupNode().getGroup(), GroupDialogHeader.SUBGROUP)); newGroup.ifPresent(group -> { diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/EscapeAmpersandsFormatter.java b/src/main/java/org/jabref/logic/formatter/bibtexfields/EscapeAmpersandsFormatter.java index e7854336d7a..bc9423ea08a 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/EscapeAmpersandsFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/EscapeAmpersandsFormatter.java @@ -59,10 +59,10 @@ public String format(String value) { } // If we are in a command body, see if it has ended: if (inCommand && (c == '}')) { - if ("begin".equals(commandName.toString())) { + if ("begin".contentEquals(commandName)) { nestedEnvironments++; } - if ((nestedEnvironments > 0) && "end".equals(commandName.toString())) { + if ((nestedEnvironments > 0) && "end".contentEquals(commandName)) { nestedEnvironments--; } @@ -72,7 +72,7 @@ public String format(String value) { // We add a backslash before any ampersand characters, with one exception: if // we are inside an \\url{...} command, we should write it as it is. Maybe. - if ((c == '&') && !escape && !(inCommand && "url".equals(commandName.toString())) + if ((c == '&') && !escape && !(inCommand && "url".contentEquals(commandName)) && (nestedEnvironments == 0)) { result.append("\\&"); } else { diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index 54fb6d7fdfb..2c9d4162851 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -2579,4 +2579,4 @@ Failed\ to\ download\ from\ URL=Failed to download from URL Finished=Finished Finished\ writing\ metadata\ for\ library\ %0\ (%1\ succeeded,\ %2\ skipped,\ %3\ errors).=Finished writing metadata for library %0 (%1 succeeded, %2 skipped, %3 errors). Processing...=Processing... -Writing\ metadata\ to\ {}=Writing metadata to {} +Writing\ metadata\ to\ %0=Writing metadata to %0 diff --git a/src/main/resources/l10n/JabRef_fr.properties b/src/main/resources/l10n/JabRef_fr.properties index 1a74754a808..7ce22b394b7 100644 --- a/src/main/resources/l10n/JabRef_fr.properties +++ b/src/main/resources/l10n/JabRef_fr.properties @@ -1145,8 +1145,11 @@ Search\ and\ store\ files\ relative\ to\ library\ file\ location=Rechercher et s File\ directory=Répertoire de fichiers Error\ pushing\ entries=Erreur lors de l'envoi des entrées +Could\ not\ push\ to\ a\ running\ Vim\ server.=Impossible d'envoyer vers un serveur Vim en cours d'exécution. Vim\ server\ name=Nom du serveur Vim Could\ not\ run\ the\ 'vim'\ program.=Le programme 'vim' n'a pas pu être lancé. +Could\ not\ push\ to\ a\ running\ emacs\ daemon.=Impossible d'envoyer vers un démon emacs en cours d'exécution. +Could\ not\ run\ the\ emacs\ client.=Impossible d'exécuter le client emacs. You\ must\ select\ either\ a\ valid\ style\ file,\ or\ use\ one\ of\ the\ default\ styles.=Vous devez sélectionner soit un style de fichier valide, soit utiliser un des styles par défaut. @@ -1657,12 +1660,13 @@ Note\:\ Use\ the\ placeholder\ %DIR%\ for\ the\ location\ of\ the\ opened\ libra Error\ occurred\ while\ executing\ the\ command\ "%0".=Une erreur est survenue lors de l'exécution de la commande "%0". Reformat\ ISSN=Reformater l'ISSN -Countries\ and\ territories\ in\ English=Pays et territoires en anglais +Computer\ science=Informatique (en anglais) +Countries\ and\ territories\ in\ English=Pays et territoires (en anglais) Electrical\ engineering\ terms=Termes du génie électrique Enabled=Activé Internal\ list=Liste interne Protected\ terms\ files=Fichiers de termes protégés -Months\ and\ weekdays\ in\ English=Mois et jours de la semaine en anglais +Months\ and\ weekdays\ in\ English=Mois et jours de la semaine (en anglais) The\ text\ after\ the\ last\ line\ starting\ with\ \#\ will\ be\ used=Le texte après la dernière ligne commençant par \# sera utilisé Add\ protected\ terms\ file=Ajouter le fichier des termes protégés Are\ you\ sure\ you\ want\ to\ remove\ the\ protected\ terms\ file?=Êtes-vous sûr de vouloir supprimer le fichier des termes protégés ? @@ -1851,6 +1855,7 @@ Collect\ and\ share\ telemetry\ data\ to\ help\ improve\ JabRef=Collecter et par Don't\ share=Ne pas partager Share\ anonymous\ statistics=Partager anonymement les statistiques Telemetry\:\ Help\ make\ JabRef\ better=Télémétrie \: contribue à l'amélioration de JabRef +To\ improve\ the\ user\ experience,\ we\ would\ like\ to\ collect\ anonymous\ statistics\ on\ the\ features\ you\ use.\ We\ will\ only\ record\ what\ features\ you\ access\ and\ how\ often\ you\ do\ it.\ We\ will\ neither\ collect\ any\ personal\ data\ nor\ the\ content\ of\ bibliographic\ items.\ If\ you\ choose\ to\ allow\ data\ collection,\ you\ can\ later\ disable\ it\ via\ File\ ->\ Preferences\ ->\ General.=Pour améliorer l'ergonomie du logiciel, nous aimerions recueillir des statistiques anonymes sur les fonctionnalités que vous utilisez. Nous enregistrerons uniquement les fonctionnalités auxquelles vous accédez et la fréquence à laquelle vous le faites. Nous ne collecterons aucune données personnelles ni contenu des éléments bibliographiques. Si vous choisissez d'autoriser la collecte de données, vous pourrez ensuite la désactiver via Fichier -> Préférences -> Général. This\ file\ was\ found\ automatically.\ Do\ you\ want\ to\ link\ it\ to\ this\ entry?=Ce fichier a été trouvé automatiquement. Voulez-vous le lier à cette entrée ? Names\ are\ not\ in\ the\ standard\ %0\ format.=Des noms ne sont pas au standard du format %0. @@ -2564,4 +2569,14 @@ File\ "%0"\ cannot\ be\ added\!=Le fichier "%" ne peut pas être ajouté \! Illegal\ characters\ in\ the\ file\ name\ detected.\nFile\ will\ be\ renamed\ to\ "%0"\ and\ added.=Caractères illégaux détectés dans le nom du fichier.\nLe fichier sera renommé en "%0" et ajouté. Rename\ and\ add=Renommer et ajouter - +401\ Unauthorized\:\ Access\ Denied.\ You\ are\ not\ authorized\ to\ access\ this\ resource.\ Please\ check\ your\ credentials\ and\ try\ again.\ If\ you\ believe\ you\ should\ have\ access,\ please\ contact\ the\ administrator\ for\ assistance.\nURL\:\ %0\ \n\ %1=401 Non autorisé \: Accès refusé. Vous n'êtes pas autorisé à accéder à cette ressource. Veuillez vérifier vos identifiants et réessayez. Si vous pensez que vous devriez avoir accès, veuillez contacter l'administrateur pour obtenir de l'aide.\nURL \: %0 \n %1 +403\ Forbidden\:\ Access\ Denied.\ You\ do\ not\ have\ permission\ to\ access\ this\ resource.\ Please\ contact\ the\ administrator\ for\ assistance\ or\ try\ a\ different\ action.\nURL\:\ %0\ \n\ %1=403 Interdit \: Accès refusé. Vous n'avez pas la permission d'accéder à cette ressource. Veuillez contacter l'administrateur pour obtenir de l'aide ou essayez une action différente.\nURL \: %0 \n %1 +404\ Not\ Found\ Error\:\ The\ requested\ resource\ could\ not\ be\ found.\ It\ seems\ that\ the\ file\ you\ are\ trying\ to\ download\ is\ not\ available\ or\ has\ been\ moved.\ Please\ verify\ the\ URL\ and\ try\ again.\ If\ you\ believe\ this\ is\ an\ error,\ please\ contact\ the\ administrator\ for\ further\ assistance.\nURL\:\ %0\ \n\ %1=404 Non trouvé \: la ressource demandée n'a pas été trouvée. Il semble que le fichier que vous essayez de télécharger ne soit pas disponible ou a été supprimé. Veuillez vérifier l'URL et réessayer. Si vous pensez qu'il s'agit d'une erreur, veuillez contacter l'administrateur pour obtenir de l'aide.\nURL \: %0\n%1 +Error\ downloading\ from\ URL.\ Cause\ is\ likely\ the\ server\ side.\ HTTP\ Error\ %0\ \n\ %1\ \nURL\:\ %2\ \nPlease\ try\ again\ later\ or\ contact\ the\ server\ administrator.=Erreur de téléchargement depuis l'URL. La cause est probablement du côté serveur. Erreur HTTP %0 \n %1 \nURL \: %2 \nVeuillez réessayer ultérieurement ou contacter l'administrateur du serveur. +Error\ message\:\ %0\ \nURL\:\ %1\ \nPlease\ check\ the\ URL\ and\ try\ again.=Message d'erreur \: %0 \nURL \: %1 \nVeuillez vérifier l'URL et réessayer. +Failed\ to\ download\ from\ URL=Échec du téléchargement depuis l'URL + +Finished=Terminé +Finished\ writing\ metadata\ for\ library\ %0\ (%1\ succeeded,\ %2\ skipped,\ %3\ errors).=Écriture des métadonnées pour le fichier %0 terminée (%1 réussi, %2 ignoré, %3 erreurs). +Processing...=Traitement en cours... +Writing\ metadata\ to\ {}=Écriture des métadonnées sur {} diff --git a/src/main/resources/l10n/JabRef_it.properties b/src/main/resources/l10n/JabRef_it.properties index 783ea585fde..4a65bc1bb84 100644 --- a/src/main/resources/l10n/JabRef_it.properties +++ b/src/main/resources/l10n/JabRef_it.properties @@ -1145,8 +1145,11 @@ Search\ and\ store\ files\ relative\ to\ library\ file\ location=Cerca e memoriz File\ directory=Directory del file Error\ pushing\ entries=Errore nell'invio delle voci +Could\ not\ push\ to\ a\ running\ Vim\ server.=Impossibile inviare su un server Vim in esecuzione. Vim\ server\ name=Nome del server Vim Could\ not\ run\ the\ 'vim'\ program.=Impossibile eseguire il programma 'vim'. +Could\ not\ push\ to\ a\ running\ emacs\ daemon.=Impossibile inviare a un demone emacs in esecuzione. +Could\ not\ run\ the\ emacs\ client.=Impossibile eseguire il client emacs. You\ must\ select\ either\ a\ valid\ style\ file,\ or\ use\ one\ of\ the\ default\ styles.=Selezionare un file di stile valido oppure utilizzare uno degli stili predefiniti. @@ -1657,6 +1660,7 @@ Note\:\ Use\ the\ placeholder\ %DIR%\ for\ the\ location\ of\ the\ opened\ libra Error\ occurred\ while\ executing\ the\ command\ "%0".=Si è verificato un errore durante l'esecuzione del comando "%0". Reformat\ ISSN=Riformatta ISSN +Computer\ science=Informatica Countries\ and\ territories\ in\ English=Paesi e territori in inglese Electrical\ engineering\ terms=Termini di ingegneria elettrica Enabled=Abilitato @@ -1851,6 +1855,7 @@ Collect\ and\ share\ telemetry\ data\ to\ help\ improve\ JabRef=Registra e condi Don't\ share=Non condividere Share\ anonymous\ statistics=Condividi statistiche anonime Telemetry\:\ Help\ make\ JabRef\ better=Telemetria\: Aiuta a migliorare JabRef +To\ improve\ the\ user\ experience,\ we\ would\ like\ to\ collect\ anonymous\ statistics\ on\ the\ features\ you\ use.\ We\ will\ only\ record\ what\ features\ you\ access\ and\ how\ often\ you\ do\ it.\ We\ will\ neither\ collect\ any\ personal\ data\ nor\ the\ content\ of\ bibliographic\ items.\ If\ you\ choose\ to\ allow\ data\ collection,\ you\ can\ later\ disable\ it\ via\ File\ ->\ Preferences\ ->\ General.=Per migliorare l'esperienza utente, vorremmo raccogliere delle statistiche anonime sulle funzioni che usi. Registreremo solo quali funzioni accedi e quanto spesso. Non registreremo dati personali né il contenuto delle voci bibliografiche. Se scegli di permettere la raccolta dei dati, potrai disabilitarla successivamente da Opzioni -> Preferenze -> Generale. This\ file\ was\ found\ automatically.\ Do\ you\ want\ to\ link\ it\ to\ this\ entry?=Questo file è stato trovato automaticamente. Vuoi collegarlo a questa voce? Names\ are\ not\ in\ the\ standard\ %0\ format.=I nomi non sono nel formato standard %0. @@ -2564,4 +2569,14 @@ File\ "%0"\ cannot\ be\ added\!=File "%0" non può essere aggiunto\! Illegal\ characters\ in\ the\ file\ name\ detected.\nFile\ will\ be\ renamed\ to\ "%0"\ and\ added.=Caratteri illegali nel nome del file rilevato. Il file\nsarà rinominato in "%0" e aggiunto. Rename\ and\ add=Rinomina e aggiungi - +401\ Unauthorized\:\ Access\ Denied.\ You\ are\ not\ authorized\ to\ access\ this\ resource.\ Please\ check\ your\ credentials\ and\ try\ again.\ If\ you\ believe\ you\ should\ have\ access,\ please\ contact\ the\ administrator\ for\ assistance.\nURL\:\ %0\ \n\ %1=401 Non autorizzato\: Accesso negato. Non sei autorizzato ad accedere a questa risorsa. Controlla le tue credenziali e riprova. Se credi di avere accesso, contatta l'amministratore per assistenza.\nURL\: %0 \n %1 +403\ Forbidden\:\ Access\ Denied.\ You\ do\ not\ have\ permission\ to\ access\ this\ resource.\ Please\ contact\ the\ administrator\ for\ assistance\ or\ try\ a\ different\ action.\nURL\:\ %0\ \n\ %1=403 Vietato\: Accesso negato. Non hai il permesso di accedere a questa risorsa. Contatta l'amministratore per assistenza o prova un'altra azione.\nURL\: %0 \n %1 +404\ Not\ Found\ Error\:\ The\ requested\ resource\ could\ not\ be\ found.\ It\ seems\ that\ the\ file\ you\ are\ trying\ to\ download\ is\ not\ available\ or\ has\ been\ moved.\ Please\ verify\ the\ URL\ and\ try\ again.\ If\ you\ believe\ this\ is\ an\ error,\ please\ contact\ the\ administrator\ for\ further\ assistance.\nURL\:\ %0\ \n\ %1=404 Errore non trovato\: la risorsa richiesta non è stata trovata. Sembra che il file che stai cercando di scaricare non sia disponibile o sia stato spostato. Si prega di verificare l'URL e riprovare. Se si ritiene che questo sia un errore, si prega di contattare l'amministratore per ulteriore assistenza.\nURL\: %0 \n %1 +Error\ downloading\ from\ URL.\ Cause\ is\ likely\ the\ server\ side.\ HTTP\ Error\ %0\ \n\ %1\ \nURL\:\ %2\ \nPlease\ try\ again\ later\ or\ contact\ the\ server\ administrator.=Errore nel download dall'URL. È probabile che la causa sia il lato server. Errore HTTP %0 \n %1 \nURL\: %2 \nRiprova più tardi o contatta l'amministratore del server. +Error\ message\:\ %0\ \nURL\:\ %1\ \nPlease\ check\ the\ URL\ and\ try\ again.=Messaggio di errore\: %0 \nURL\: %1 \nControllare l'URL e riprovare. +Failed\ to\ download\ from\ URL=Impossibile scaricare dall'URL + +Finished=Terminato +Finished\ writing\ metadata\ for\ library\ %0\ (%1\ succeeded,\ %2\ skipped,\ %3\ errors).=Scrittura dei metadati per la libreria %0 (%1 riuscita, %2 saltato, %3 errori). +Processing...=Elaborazione... +Writing\ metadata\ to\ {}=Scrittura dei metadati su {} diff --git a/src/main/resources/l10n/JabRef_nl.properties b/src/main/resources/l10n/JabRef_nl.properties index 5951d7a1768..e43913e338e 100644 --- a/src/main/resources/l10n/JabRef_nl.properties +++ b/src/main/resources/l10n/JabRef_nl.properties @@ -1145,8 +1145,11 @@ Search\ and\ store\ files\ relative\ to\ library\ file\ location=Zoeken en opsla File\ directory=Bestandsmap Error\ pushing\ entries=Foutieve invoergegevens ingevoerd +Could\ not\ push\ to\ a\ running\ Vim\ server.=Kon niet sturen naar een actieve Vim server. Vim\ server\ name=Vim servernaam Could\ not\ run\ the\ 'vim'\ program.=Het programma 'vim' kon niet worden uitgevoerd. +Could\ not\ push\ to\ a\ running\ emacs\ daemon.=Kon niet sturen naar een actieve emacs daemon. +Could\ not\ run\ the\ emacs\ client.=Kan de emacs-client niet uitvoeren. You\ must\ select\ either\ a\ valid\ style\ file,\ or\ use\ one\ of\ the\ default\ styles.=U moet een geldige bestandsstijl selecteren, of gebruikmaken van een van de standaardstijlen. @@ -1657,6 +1660,7 @@ Note\:\ Use\ the\ placeholder\ %DIR%\ for\ the\ location\ of\ the\ opened\ libra Error\ occurred\ while\ executing\ the\ command\ "%0".=Fout opgetreden tijdens het uitvoeren van de opdracht "%0". Reformat\ ISSN=ISSN formatteren +Computer\ science=Informatica Countries\ and\ territories\ in\ English=Landen en gebieden in het Engels Electrical\ engineering\ terms=Elektrotechnische termen Enabled=Ingeschakeld @@ -1851,6 +1855,7 @@ Collect\ and\ share\ telemetry\ data\ to\ help\ improve\ JabRef=Telemetrie gegev Don't\ share=Niet delen Share\ anonymous\ statistics=Statistieken anoniem delen Telemetry\:\ Help\ make\ JabRef\ better=Telemetrie\: help JabRef te verbeteren +To\ improve\ the\ user\ experience,\ we\ would\ like\ to\ collect\ anonymous\ statistics\ on\ the\ features\ you\ use.\ We\ will\ only\ record\ what\ features\ you\ access\ and\ how\ often\ you\ do\ it.\ We\ will\ neither\ collect\ any\ personal\ data\ nor\ the\ content\ of\ bibliographic\ items.\ If\ you\ choose\ to\ allow\ data\ collection,\ you\ can\ later\ disable\ it\ via\ File\ ->\ Preferences\ ->\ General.=Om de gebruikerservaring te verbeteren, willen we graag anonieme statistieken verzamelen over de functies die u gebruikt. We slaan alleen op welke functies u opent en hoe vaak u dit doet. We zullen geen persoonlijke gegevens verzamelen of de inhoud van bibliografische gegevens. Als u ervoor kiest toe te staan om gegevens te verzamelen, kunt u dit later nog uitschakelen via Bestand -> Instellingen -> Algemeen. This\ file\ was\ found\ automatically.\ Do\ you\ want\ to\ link\ it\ to\ this\ entry?=Dit bestand werd automatisch gevonden. Wilt u het koppelen aan deze invoer? Names\ are\ not\ in\ the\ standard\ %0\ format.=Namen zijn niet in de standaard %0 indeling. @@ -2564,4 +2569,14 @@ File\ "%0"\ cannot\ be\ added\!=Bestand "%0" kan niet worden toegevoegd\! Illegal\ characters\ in\ the\ file\ name\ detected.\nFile\ will\ be\ renamed\ to\ "%0"\ and\ added.=Ongeldige tekens in de bestandsnaam gedetecteerd.\nBestand wordt hernoemd naar "%0" en toegevoegd. Rename\ and\ add=Hernoemen en toevoegen - +401\ Unauthorized\:\ Access\ Denied.\ You\ are\ not\ authorized\ to\ access\ this\ resource.\ Please\ check\ your\ credentials\ and\ try\ again.\ If\ you\ believe\ you\ should\ have\ access,\ please\ contact\ the\ administrator\ for\ assistance.\nURL\:\ %0\ \n\ %1=401 Onbevoegd\: Toegang geweigerd. U heeft geen toestemming om toegang te krijgen tot deze bron. Controleer uw inloggegevens en probeer het opnieuw. Als u denkt dat u toegang moet hebben, neem dan contact op met de beheerder voor ondersteuning.\nURL\: %0 \n %1 +403\ Forbidden\:\ Access\ Denied.\ You\ do\ not\ have\ permission\ to\ access\ this\ resource.\ Please\ contact\ the\ administrator\ for\ assistance\ or\ try\ a\ different\ action.\nURL\:\ %0\ \n\ %1=403 Verboden\: Toegang geweigerd. U heeft geen toestemming om toegang te krijgen tot deze bron. Neem contact op met de beheerder voor hulp of probeer een andere actie.\nURL\: %0 \n %1 +404\ Not\ Found\ Error\:\ The\ requested\ resource\ could\ not\ be\ found.\ It\ seems\ that\ the\ file\ you\ are\ trying\ to\ download\ is\ not\ available\ or\ has\ been\ moved.\ Please\ verify\ the\ URL\ and\ try\ again.\ If\ you\ believe\ this\ is\ an\ error,\ please\ contact\ the\ administrator\ for\ further\ assistance.\nURL\:\ %0\ \n\ %1=404 Niet Gevonden Fout\: De gevraagde bron kon niet worden gevonden. Het lijkt erop dat het bestand dat je probeert te downloaden niet beschikbaar is of verplaatst is. Controleer de URL en probeer het opnieuw. Als u denkt dat dit een fout is, neem dan contact op met de beheerder voor verdere hulp.\nURL\: %0 \n %1 +Error\ downloading\ from\ URL.\ Cause\ is\ likely\ the\ server\ side.\ HTTP\ Error\ %0\ \n\ %1\ \nURL\:\ %2\ \nPlease\ try\ again\ later\ or\ contact\ the\ server\ administrator.=Fout bij downloaden van URL. Oorzaak is waarschijnlijk de server-kant. HTTP-fout %0 \n %1 \nURL\: %2 \nProbeer het later opnieuw of neem contact op met de serverbeheerder. +Error\ message\:\ %0\ \nURL\:\ %1\ \nPlease\ check\ the\ URL\ and\ try\ again.=Foutmelding\: %0 \nURL\: %1 \nControleer de URL en probeer het opnieuw. +Failed\ to\ download\ from\ URL=Downloaden van URL mislukt + +Finished=Voltooid +Finished\ writing\ metadata\ for\ library\ %0\ (%1\ succeeded,\ %2\ skipped,\ %3\ errors).=Metadata schrijven voor bibliotheek %0 voltooid (%1 geslaagd, %2 overgeslagen, %3 fouten). +Processing...=Verwerken... +Writing\ metadata\ to\ {}=Metadata schrijven naar {} diff --git a/src/main/resources/l10n/JabRef_pl.properties b/src/main/resources/l10n/JabRef_pl.properties index 77ea33169a1..639d0354790 100644 --- a/src/main/resources/l10n/JabRef_pl.properties +++ b/src/main/resources/l10n/JabRef_pl.properties @@ -1045,8 +1045,11 @@ No\ valid\ style\ file\ defined=Nie zdefiniowano poprawnego pliku stylu Choose\ pattern=Wybierz wzór File\ directory=Katalog plików +Could\ not\ push\ to\ a\ running\ Vim\ server.=Nie można wysłać do działającego serwera Vim. Vim\ server\ name=Nazwa serwera Vim Could\ not\ run\ the\ 'vim'\ program.=Nie można uruchomić programu 'vim'. +Could\ not\ push\ to\ a\ running\ emacs\ daemon.=Nie można wysłać do działającego demona emacs. +Could\ not\ run\ the\ emacs\ client.=Nie można uruchomić klienta emacs. @@ -1320,6 +1323,7 @@ No\ database=Brak bazy danych +Computer\ science=Informatyka Enabled=Włączone Add\ {}\ around\ selected\ text=Dodaj {} wokół zaznaczonego tekstu Remove\ all\ {}\ in\ selected\ text=Usuń wszystkie w zaznaczonym tekście @@ -1410,6 +1414,7 @@ Locked=Zablokowane Don't\ share=Nie udostępniaj Share\ anonymous\ statistics=Udostępnij anonimowe statystyki +To\ improve\ the\ user\ experience,\ we\ would\ like\ to\ collect\ anonymous\ statistics\ on\ the\ features\ you\ use.\ We\ will\ only\ record\ what\ features\ you\ access\ and\ how\ often\ you\ do\ it.\ We\ will\ neither\ collect\ any\ personal\ data\ nor\ the\ content\ of\ bibliographic\ items.\ If\ you\ choose\ to\ allow\ data\ collection,\ you\ can\ later\ disable\ it\ via\ File\ ->\ Preferences\ ->\ General.=Aby poprawić jakość programu, chcielibyśmy zbierać anonimowe statystyki dotyczące funkcji, które używasz. Będziemy rejestrować, których funkcji używasz i jak często to robisz. Nie będziemy zbierali żadnych danych osobowych ani zawartości wpisów bibliograficznych. Jeśli wyrazisz zgodę się na zbieranie danych, możesz ją później cofnąć za pomocą opcji z menu Plik -> Ustawienia -> Ogólne. Delete\ '%0'=Usuń '%0' Delete\ from\ disk=Usuń z dysku @@ -1622,4 +1627,14 @@ File\ "%0"\ cannot\ be\ added\!=Plik "%0" nie może zostać dodany\! Illegal\ characters\ in\ the\ file\ name\ detected.\nFile\ will\ be\ renamed\ to\ "%0"\ and\ added.=Wykryto nieprawidłowe znaki w nazwie pliku.\nPlik zostanie dodany pod nazwę "%0". Rename\ and\ add=Zmień nazwę i dodaj - +401\ Unauthorized\:\ Access\ Denied.\ You\ are\ not\ authorized\ to\ access\ this\ resource.\ Please\ check\ your\ credentials\ and\ try\ again.\ If\ you\ believe\ you\ should\ have\ access,\ please\ contact\ the\ administrator\ for\ assistance.\nURL\:\ %0\ \n\ %1=401 Nieautoryzowane\: Odmowa dostępu. Nie masz uprawnień do dostępu do tego zasobu. Sprawdź swoje uprawnienia i spróbuj ponownie. Jeśli uważasz, że powinieneś mieć dostęp, skontaktuj się z administratorem w celu uzyskania pomocy.\nURL\: %0 \n %1 +403\ Forbidden\:\ Access\ Denied.\ You\ do\ not\ have\ permission\ to\ access\ this\ resource.\ Please\ contact\ the\ administrator\ for\ assistance\ or\ try\ a\ different\ action.\nURL\:\ %0\ \n\ %1=403 Zabronione\: Odmowa dostępu. Nie masz uprawnień dostępu do tego zasobu. Skontaktuj się z administratorem, aby uzyskać pomoc lub spróbuj innej czynności.\nURL\: %0 \n %1 +404\ Not\ Found\ Error\:\ The\ requested\ resource\ could\ not\ be\ found.\ It\ seems\ that\ the\ file\ you\ are\ trying\ to\ download\ is\ not\ available\ or\ has\ been\ moved.\ Please\ verify\ the\ URL\ and\ try\ again.\ If\ you\ believe\ this\ is\ an\ error,\ please\ contact\ the\ administrator\ for\ further\ assistance.\nURL\:\ %0\ \n\ %1=404 Nie znaleziono\: Żądany zasób nie został znaleziony. Wygląda na to, że plik, który próbujesz pobrać nie jest dostępny lub został przeniesiony. Proszę zweryfikować adres URL i spróbować ponownie. Jeśli uważasz, że jest to błąd, skontaktuj się z administratorem, aby uzyskać dalszą pomoc.\nURL\: %0 \n %1 +Error\ downloading\ from\ URL.\ Cause\ is\ likely\ the\ server\ side.\ HTTP\ Error\ %0\ \n\ %1\ \nURL\:\ %2\ \nPlease\ try\ again\ later\ or\ contact\ the\ server\ administrator.=Błąd podczas pobierania z adresu URL. Prawdopodobnie błąd jest po stronie serwera. Błąd HTTP %0 \n %1 \nURL\: %2 \nSpróbuj ponownie później lub skontaktuj się z administratorem serwera. +Error\ message\:\ %0\ \nURL\:\ %1\ \nPlease\ check\ the\ URL\ and\ try\ again.=Komunikat błędu\: %0 \nURL\: %1 \nSprawdź adres URL i spróbuj ponownie. +Failed\ to\ download\ from\ URL=Nie udało się pobrać z adresu URL + +Finished=Zakończone +Finished\ writing\ metadata\ for\ library\ %0\ (%1\ succeeded,\ %2\ skipped,\ %3\ errors).=Zakończono zapisywanie metadanych biblioteki %0 (wykonano %1, pominięto %2, błędy %3). +Processing...=Przetwarzanie... +Writing\ metadata\ to\ {}=Zapisywanie metadanych do {} diff --git a/src/main/resources/l10n/JabRef_pt_BR.properties b/src/main/resources/l10n/JabRef_pt_BR.properties index ba7436a9ead..38170c71369 100644 --- a/src/main/resources/l10n/JabRef_pt_BR.properties +++ b/src/main/resources/l10n/JabRef_pt_BR.properties @@ -1145,8 +1145,11 @@ Search\ and\ store\ files\ relative\ to\ library\ file\ location=Procurar e arma File\ directory=Diretório de arquivos Error\ pushing\ entries=Erro ao fazer push das referências +Could\ not\ push\ to\ a\ running\ Vim\ server.=Não foi possível fazer push para um servidor Vim em execução. Vim\ server\ name=Nome do servidor Vim Could\ not\ run\ the\ 'vim'\ program.=Não foi possível executar o programa 'vim'. +Could\ not\ push\ to\ a\ running\ emacs\ daemon.=Não foi possível enviar para um emacs daemon em execução. +Could\ not\ run\ the\ emacs\ client.=Não foi possível executar o cliente de emacs. You\ must\ select\ either\ a\ valid\ style\ file,\ or\ use\ one\ of\ the\ default\ styles.=Você deve selecionar um arquivo de estilo válido ou utilizar um dos estilos padrão. @@ -1657,6 +1660,7 @@ Note\:\ Use\ the\ placeholder\ %DIR%\ for\ the\ location\ of\ the\ opened\ libra Error\ occurred\ while\ executing\ the\ command\ "%0".=Ocorreu um erro ao executar o comando "%0". Reformat\ ISSN=Reformatar ISSN +Computer\ science=Ciência da computação Countries\ and\ territories\ in\ English=Países e territórios em inglês Electrical\ engineering\ terms=Termos da engenharia elétrica Enabled=Ativado @@ -1851,6 +1855,7 @@ Collect\ and\ share\ telemetry\ data\ to\ help\ improve\ JabRef=Colete e compart Don't\ share=Não compartilhar Share\ anonymous\ statistics=Compartilhar estatísticas anônimas Telemetry\:\ Help\ make\ JabRef\ better=Telemetria\: Ajude a melhorar o JabRef +To\ improve\ the\ user\ experience,\ we\ would\ like\ to\ collect\ anonymous\ statistics\ on\ the\ features\ you\ use.\ We\ will\ only\ record\ what\ features\ you\ access\ and\ how\ often\ you\ do\ it.\ We\ will\ neither\ collect\ any\ personal\ data\ nor\ the\ content\ of\ bibliographic\ items.\ If\ you\ choose\ to\ allow\ data\ collection,\ you\ can\ later\ disable\ it\ via\ File\ ->\ Preferences\ ->\ General.=Para melhorar a experiência do usuário, gostaríamos de coletar estatísticas anônimas sobre os recursos que você usa. Nós só registraremos quais recursos você acessa e com que frequência você o faz. Não coletaremos quaisquer dados pessoais nem o conteúdo dos itens bibliográficos. Se você optar por permitir a coleta de dados, poderá mais tarde desativá-la através do Arquivo-> Preferências -> Geral. This\ file\ was\ found\ automatically.\ Do\ you\ want\ to\ link\ it\ to\ this\ entry?=Este arquivo foi encontrado automaticamente. Deseja vinculá-lo à referência? Names\ are\ not\ in\ the\ standard\ %0\ format.=Nomes não estão no formato padrão %0. @@ -2564,4 +2569,14 @@ File\ "%0"\ cannot\ be\ added\!=O arquivo "%0" não pode ser adicionado\! Illegal\ characters\ in\ the\ file\ name\ detected.\nFile\ will\ be\ renamed\ to\ "%0"\ and\ added.=Caracteres ilegais no nome de arquivo detectado.\nArquivo será renomeado para "%0" e adicionado. Rename\ and\ add=Renomear e adicionar - +401\ Unauthorized\:\ Access\ Denied.\ You\ are\ not\ authorized\ to\ access\ this\ resource.\ Please\ check\ your\ credentials\ and\ try\ again.\ If\ you\ believe\ you\ should\ have\ access,\ please\ contact\ the\ administrator\ for\ assistance.\nURL\:\ %0\ \n\ %1=401 Não Autorizado\: Acesso Negado. Você não está autorizado a acessar este recurso. Por favor, verifique suas credenciais e tente novamente. Se você acredita que deveria ter acesso, favor entrar em contato com o administrador para obter assistência.\nURL\: %0\n%1 +403\ Forbidden\:\ Access\ Denied.\ You\ do\ not\ have\ permission\ to\ access\ this\ resource.\ Please\ contact\ the\ administrator\ for\ assistance\ or\ try\ a\ different\ action.\nURL\:\ %0\ \n\ %1=403 Proibido\: Acesso Negado. Você não tem permissão para acessar este recurso. Por favor, entre em contato com o administrador para obter assistência ou tente uma ação diferente.\nURL\: %0\n%1 +404\ Not\ Found\ Error\:\ The\ requested\ resource\ could\ not\ be\ found.\ It\ seems\ that\ the\ file\ you\ are\ trying\ to\ download\ is\ not\ available\ or\ has\ been\ moved.\ Please\ verify\ the\ URL\ and\ try\ again.\ If\ you\ believe\ this\ is\ an\ error,\ please\ contact\ the\ administrator\ for\ further\ assistance.\nURL\:\ %0\ \n\ %1=Erro 404 - Recurso Não Encontrado\: O recurso solicitado não pôde ser encontrado. Parece que o arquivo do qual você está tentando fazer o download não está disponível ou foi movido. Por favor, verifique a URL e tente novamente. Se você acredita que isso é um erro, favor entrar em contato com o administrador para obter mais assistência.\nURL\: %0\n%1 +Error\ downloading\ from\ URL.\ Cause\ is\ likely\ the\ server\ side.\ HTTP\ Error\ %0\ \n\ %1\ \nURL\:\ %2\ \nPlease\ try\ again\ later\ or\ contact\ the\ server\ administrator.=Erro ao fazer download a partir da URL. \nA causa provável é no servidor. Erro HTTP %0 %1 \nURL\: %2 \nPor favor, tente novamente mais tarde ou entre em contato com o administrador do servidor. +Error\ message\:\ %0\ \nURL\:\ %1\ \nPlease\ check\ the\ URL\ and\ try\ again.=Mensagem de erro\: %0 \nURL\: %1 \nPor favor, verifique a URL e tente novamente. +Failed\ to\ download\ from\ URL=Falha ao fazer download da URL + +Finished=Concluído +Finished\ writing\ metadata\ for\ library\ %0\ (%1\ succeeded,\ %2\ skipped,\ %3\ errors).=Concluída a escrita de metadados para a biblioteca %0 (%1 bem sucedidos, %2 ignorados, erros %3). +Processing...=Processando... +Writing\ metadata\ to\ {}=Escrevendo metadados para {} diff --git a/src/test/java/org/jabref/gui/theme/ThemeManagerTest.java b/src/test/java/org/jabref/gui/theme/ThemeManagerTest.java index 4f53fadc9be..f96308c18b8 100644 --- a/src/test/java/org/jabref/gui/theme/ThemeManagerTest.java +++ b/src/test/java/org/jabref/gui/theme/ThemeManagerTest.java @@ -6,7 +6,6 @@ import java.nio.file.StandardOpenOption; import java.util.Optional; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; import javafx.application.Platform; import javafx.collections.FXCollections; @@ -18,6 +17,7 @@ import org.jabref.model.util.DummyFileUpdateMonitor; import org.jabref.preferences.WorkspacePreferences; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -28,7 +28,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assertions.fail; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -194,11 +193,9 @@ public void installThemeOnWebEngine() throws IOException { webEngineStyleSheetLocation.complete(webEngine.getUserStyleSheetLocation()); }); - try { + Assertions.assertDoesNotThrow(() -> { assertEquals(webEngineStyleSheetLocation.get(), TEST_CSS_DATA); - } catch (InterruptedException | ExecutionException e) { - fail(e); - } + }); } /** diff --git a/src/test/java/org/jabref/logic/bst/BstVMVisitorTest.java b/src/test/java/org/jabref/logic/bst/BstVMVisitorTest.java index 366ba0a9d55..abbfd8aaf3f 100644 --- a/src/test/java/org/jabref/logic/bst/BstVMVisitorTest.java +++ b/src/test/java/org/jabref/logic/bst/BstVMVisitorTest.java @@ -13,6 +13,7 @@ import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -238,7 +239,7 @@ void testVisitStackitem() { vm.render(Collections.emptyList()); assertEquals(3, vm.getStack().pop()); - assertTrue(vm.getStack().pop() instanceof ParseTree); + assertInstanceOf(ParseTree.class, vm.getStack().pop()); assertEquals(new BstVMVisitor.Identifier("t"), vm.getStack().pop()); assertEquals(1, vm.getStack().pop()); assertEquals("HELLO", vm.getStack().pop()); diff --git a/src/test/java/org/jabref/logic/database/DuplicateCheckTest.java b/src/test/java/org/jabref/logic/database/DuplicateCheckTest.java index 4e81e1b85dc..8c644ab40f2 100644 --- a/src/test/java/org/jabref/logic/database/DuplicateCheckTest.java +++ b/src/test/java/org/jabref/logic/database/DuplicateCheckTest.java @@ -1,5 +1,7 @@ package org.jabref.logic.database; +import java.util.stream.Stream; + import org.jabref.model.database.BibDatabaseMode; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.BibEntryTypesManager; @@ -10,6 +12,9 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -23,88 +28,283 @@ public class DuplicateCheckTest { private BibEntry simpleIncollection; private DuplicateCheck duplicateChecker; - @BeforeEach - public void setUp() { - simpleArticle = new BibEntry(StandardEntryType.Article) + private static BibEntry getSimpleArticle() { + return new BibEntry(StandardEntryType.Article) .withField(StandardField.AUTHOR, "Single Author") .withField(StandardField.TITLE, "A serious paper about something") .withField(StandardField.YEAR, "2017"); - unrelatedArticle = new BibEntry(StandardEntryType.Article) - .withField(StandardField.AUTHOR, "Completely Different") - .withField(StandardField.TITLE, "Holy Moly Uffdada und Trallalla") - .withField(StandardField.YEAR, "1992"); - simpleInbook = new BibEntry(StandardEntryType.InBook) + } + + private static BibEntry getSimpleIncollection() { + return new BibEntry(StandardEntryType.InCollection) + .withField(StandardField.TITLE, "Innovation and Intellectual Property Rights") + .withField(StandardField.AUTHOR, "Ove Grandstrand") + .withField(StandardField.BOOKTITLE, "The Oxford Handbook of Innovation") + .withField(StandardField.PUBLISHER, "Oxford University Press") + .withField(StandardField.YEAR, "2004"); + } + + private static BibEntry getSimpleInbook() { + return new BibEntry(StandardEntryType.InBook) .withField(StandardField.TITLE, "Alice in Wonderland") .withField(StandardField.AUTHOR, "Charles Lutwidge Dodgson") .withField(StandardField.CHAPTER, "Chapter One – Down the Rabbit Hole") .withField(StandardField.LANGUAGE, "English") .withField(StandardField.PUBLISHER, "Macmillan") .withField(StandardField.YEAR, "1865"); - simpleIncollection = new BibEntry(StandardEntryType.InCollection) - .withField(StandardField.TITLE, "Innovation and Intellectual Property Rights") - .withField(StandardField.AUTHOR, "Ove Grandstrand") - .withField(StandardField.BOOKTITLE, "The Oxford Handbook of Innovation") - .withField(StandardField.PUBLISHER, "Oxford University Press") - .withField(StandardField.YEAR, "2004"); + } + + private static BibEntry getUnrelatedArticle() { + return new BibEntry(StandardEntryType.Article) + .withField(StandardField.AUTHOR, "Completely Different") + .withField(StandardField.TITLE, "Holy Moly Uffdada und Trallalla") + .withField(StandardField.YEAR, "1992"); + } + + @BeforeEach + public void setUp() { + simpleArticle = getSimpleArticle(); + unrelatedArticle = getUnrelatedArticle(); + simpleInbook = getSimpleInbook(); + simpleIncollection = getSimpleIncollection(); duplicateChecker = new DuplicateCheck(new BibEntryTypesManager()); } @Test - public void testDuplicateDetection() { - BibEntry one = new BibEntry(StandardEntryType.Article); - - BibEntry two = new BibEntry(StandardEntryType.Article); + public void testDuplicateDetectionWithSameAuthor() { + BibEntry one = new BibEntry(StandardEntryType.Article).withField(StandardField.AUTHOR, "Billy Bob"); + BibEntry two = new BibEntry(StandardEntryType.Article).withField(StandardField.AUTHOR, "Billy Bob"); - one.setField(StandardField.AUTHOR, "Billy Bob"); - two.setField(StandardField.AUTHOR, "Billy Bob"); assertTrue(duplicateChecker.isDuplicate(one, two, BibDatabaseMode.BIBTEX)); + } + + @Test + public void testDuplicateDetectionWithDifferentAuthors() { + BibEntry one = new BibEntry(StandardEntryType.Article).withField(StandardField.AUTHOR, "Billy Bob"); + BibEntry two = new BibEntry(StandardEntryType.Article).withField(StandardField.AUTHOR, "James Joyce"); - two.setField(StandardField.AUTHOR, "James Joyce"); assertFalse(duplicateChecker.isDuplicate(one, two, BibDatabaseMode.BIBTEX)); + } + + @Test + public void testDuplicateDetectionWithDifferentTypes() { + BibEntry one = new BibEntry(StandardEntryType.Article).withField(StandardField.AUTHOR, "Billy Bob"); + BibEntry two = new BibEntry(StandardEntryType.Book).withField(StandardField.AUTHOR, "Billy Bob"); - two.setField(StandardField.AUTHOR, "Billy Bob"); - two.setType(StandardEntryType.Book); assertFalse(duplicateChecker.isDuplicate(one, two, BibDatabaseMode.BIBTEX)); + } + + @Test + public void testDuplicateDetectionWithSameYearTitleJournal() { + BibEntry one = new BibEntry(StandardEntryType.Article) + .withField(StandardField.AUTHOR, "Billy Bob") + .withField(StandardField.YEAR, "2005") + .withField(StandardField.TITLE, "A title") + .withField(StandardField.JOURNAL, "A"); + + BibEntry two = new BibEntry(StandardEntryType.Article) + .withField(StandardField.AUTHOR, "Billy Bob") + .withField(StandardField.YEAR, "2005") + .withField(StandardField.TITLE, "A title") + .withField(StandardField.JOURNAL, "A"); - two.setType(StandardEntryType.Article); - one.setField(StandardField.YEAR, "2005"); - two.setField(StandardField.YEAR, "2005"); - one.setField(StandardField.TITLE, "A title"); - two.setField(StandardField.TITLE, "A title"); - one.setField(StandardField.JOURNAL, "A"); - two.setField(StandardField.JOURNAL, "A"); assertTrue(duplicateChecker.isDuplicate(one, two, BibDatabaseMode.BIBTEX)); assertEquals(1.01, DuplicateCheck.compareEntriesStrictly(one, two), 0.01); + } + + @Test + public void testDuplicateDetectionWithDifferentJournal() { + BibEntry one = new BibEntry(StandardEntryType.Article) + .withField(StandardField.AUTHOR, "Billy Bob") + .withField(StandardField.YEAR, "2005") + .withField(StandardField.TITLE, "A title") + .withField(StandardField.JOURNAL, "A"); + + BibEntry two = new BibEntry(StandardEntryType.Article) + .withField(StandardField.AUTHOR, "Billy Bob") + .withField(StandardField.YEAR, "2005") + .withField(StandardField.TITLE, "A title") + .withField(StandardField.JOURNAL, "B"); - two.setField(StandardField.JOURNAL, "B"); assertTrue(duplicateChecker.isDuplicate(one, two, BibDatabaseMode.BIBTEX)); assertEquals(0.75, DuplicateCheck.compareEntriesStrictly(one, two), 0.01); + } - two.setField(StandardField.JOURNAL, "A"); - one.setField(StandardField.NUMBER, "1"); - two.setField(StandardField.VOLUME, "21"); - one.setField(StandardField.PAGES, "334--337"); - two.setField(StandardField.PAGES, "334--337"); - assertTrue(duplicateChecker.isDuplicate(one, two, BibDatabaseMode.BIBTEX)); + @Test + public void testDuplicateDetectionWithDifferentVolume() { + BibEntry one = new BibEntry(StandardEntryType.Article) + .withField(StandardField.AUTHOR, "Billy Bob") + .withField(StandardField.YEAR, "2005") + .withField(StandardField.TITLE, "A title") + .withField(StandardField.JOURNAL, "A") + .withField(StandardField.NUMBER, "1") + .withField(StandardField.VOLUME, "21"); + + BibEntry two = new BibEntry(StandardEntryType.Article) + .withField(StandardField.AUTHOR, "Billy Bob") + .withField(StandardField.YEAR, "2005") + .withField(StandardField.TITLE, "A title") + .withField(StandardField.JOURNAL, "A") + .withField(StandardField.NUMBER, "1") + .withField(StandardField.VOLUME, "22"); - two.setField(StandardField.NUMBER, "1"); - one.setField(StandardField.VOLUME, "21"); assertTrue(duplicateChecker.isDuplicate(one, two, BibDatabaseMode.BIBTEX)); + } + + @Test + public void testDuplicateDetectionWithDifferentTitleSameVolume() { + BibEntry one = new BibEntry(StandardEntryType.Article) + .withField(StandardField.AUTHOR, "Billy Bob") + .withField(StandardField.YEAR, "2005") + .withField(StandardField.TITLE, "A title") + .withField(StandardField.JOURNAL, "") + .withField(StandardField.NUMBER, "1") + .withField(StandardField.VOLUME, "21"); + + BibEntry two = new BibEntry(StandardEntryType.Article) + .withField(StandardField.AUTHOR, "Billy Bob") + .withField(StandardField.YEAR, "2005") + .withField(StandardField.TITLE, "Another title") + .withField(StandardField.JOURNAL, "") + .withField(StandardField.NUMBER, "1") + .withField(StandardField.VOLUME, "21"); + + assertFalse(duplicateChecker.isDuplicate(one, two, BibDatabaseMode.BIBTEX)); + } + + @Test + public void testDuplicateDetectionWithSamePages() { + BibEntry one = new BibEntry(StandardEntryType.Article) + .withField(StandardField.AUTHOR, "Billy Bob") + .withField(StandardField.YEAR, "2005") + .withField(StandardField.TITLE, "A title") + .withField(StandardField.JOURNAL, "A") + .withField(StandardField.VOLUME, "21") + .withField(StandardField.NUMBER, "1") + .withField(StandardField.PAGES, "334--337"); + + BibEntry two = new BibEntry(StandardEntryType.Article) + .withField(StandardField.AUTHOR, "Billy Bob") + .withField(StandardField.YEAR, "2005") + .withField(StandardField.TITLE, "A title") + .withField(StandardField.JOURNAL, "A") + .withField(StandardField.VOLUME, "21") + .withField(StandardField.NUMBER, "1") + .withField(StandardField.PAGES, "334--337"); - two.setField(StandardField.VOLUME, "22"); assertTrue(duplicateChecker.isDuplicate(one, two, BibDatabaseMode.BIBTEX)); + } + + @Test + public void testDuplicateDetectionWithSamePagesOneEntryNoVolume() { + BibEntry one = new BibEntry(StandardEntryType.Article) + .withField(StandardField.AUTHOR, "Billy Bob") + .withField(StandardField.YEAR, "2005") + .withField(StandardField.TITLE, "A title") + .withField(StandardField.JOURNAL, "A") + .withField(StandardField.NUMBER, "1") + .withField(StandardField.PAGES, "334--337"); + + BibEntry two = new BibEntry(StandardEntryType.Article) + .withField(StandardField.AUTHOR, "Billy Bob") + .withField(StandardField.YEAR, "2005") + .withField(StandardField.TITLE, "A title") + .withField(StandardField.JOURNAL, "A") + .withField(StandardField.VOLUME, "21") + .withField(StandardField.NUMBER, "1") + .withField(StandardField.PAGES, "334--337"); - two.setField(StandardField.JOURNAL, "B"); assertTrue(duplicateChecker.isDuplicate(one, two, BibDatabaseMode.BIBTEX)); + } + + @Test + public void testDuplicateDetectionDifferentVolumeNoJournal() { + BibEntry one = new BibEntry(StandardEntryType.Article) + .withField(StandardField.AUTHOR, "Billy Bob") + .withField(StandardField.YEAR, "2005") + .withField(StandardField.TITLE, "A title") + .withField(StandardField.VOLUME, "21") + .withField(StandardField.NUMBER, "1") + .withField(StandardField.PAGES, "334--337"); + + BibEntry two = new BibEntry(StandardEntryType.Article) + .withField(StandardField.AUTHOR, "Billy Bob") + .withField(StandardField.YEAR, "2005") + .withField(StandardField.TITLE, "A title") + .withField(StandardField.VOLUME, "22") + .withField(StandardField.NUMBER, "1") + .withField(StandardField.PAGES, "334--337"); - one.setField(StandardField.JOURNAL, ""); - two.setField(StandardField.JOURNAL, ""); assertTrue(duplicateChecker.isDuplicate(one, two, BibDatabaseMode.BIBTEX)); + } + + @Test + public void testDuplicateDetectionDifferentTitleNoJournal() { + BibEntry one = new BibEntry(StandardEntryType.Article) + .withField(StandardField.AUTHOR, "Billy Bob") + .withField(StandardField.YEAR, "2005") + .withField(StandardField.TITLE, "A title") + .withField(StandardField.VOLUME, "21") + .withField(StandardField.NUMBER, "1") + .withField(StandardField.PAGES, "334--337"); + + BibEntry two = new BibEntry(StandardEntryType.Article) + .withField(StandardField.AUTHOR, "Billy Bob") + .withField(StandardField.YEAR, "2005") + .withField(StandardField.TITLE, "Another title") + .withField(StandardField.VOLUME, "22") + .withField(StandardField.NUMBER, "1") + .withField(StandardField.PAGES, "334--337"); - two.setField(StandardField.TITLE, "Another title"); assertFalse(duplicateChecker.isDuplicate(one, two, BibDatabaseMode.BIBTEX)); } + @Test + public void testDuplicateDetectionDifferentVolumeAllOthersEqual() { + BibEntry one = new BibEntry(StandardEntryType.Article) + .withField(StandardField.AUTHOR, "Billy Bob") + .withField(StandardField.YEAR, "2005") + .withField(StandardField.TITLE, "A title") + .withField(StandardField.JOURNAL, "A") + .withField(StandardField.VOLUME, "21") + .withField(StandardField.NUMBER, "1") + .withField(StandardField.PAGES, "334--337"); + + BibEntry two = new BibEntry(StandardEntryType.Article) + .withField(StandardField.AUTHOR, "Billy Bob") + .withField(StandardField.YEAR, "2005") + .withField(StandardField.TITLE, "A title") + .withField(StandardField.JOURNAL, "A") + .withField(StandardField.VOLUME, "22") + .withField(StandardField.NUMBER, "1") + .withField(StandardField.PAGES, "334--337"); + + assertTrue(duplicateChecker.isDuplicate(one, two, BibDatabaseMode.BIBTEX)); + } + + @Test + public void testDuplicateDetectionDifferentVolumeDifferentJournalAllOthersEqual() { + BibEntry one = new BibEntry(StandardEntryType.Article) + .withField(StandardField.AUTHOR, "Billy Bob") + .withField(StandardField.YEAR, "2005") + .withField(StandardField.TITLE, "A title") + .withField(StandardField.JOURNAL, "A") + .withField(StandardField.VOLUME, "21") + .withField(StandardField.NUMBER, "1") + .withField(StandardField.PAGES, "334--337"); + + BibEntry two = new BibEntry(StandardEntryType.Article) + .withField(StandardField.AUTHOR, "Billy Bob") + .withField(StandardField.YEAR, "2005") + .withField(StandardField.TITLE, "A title") + .withField(StandardField.JOURNAL, "B") + .withField(StandardField.VOLUME, "22") + .withField(StandardField.NUMBER, "1") + .withField(StandardField.PAGES, "334--337"); + + assertTrue(duplicateChecker.isDuplicate(one, two, BibDatabaseMode.BIBTEX)); + } + @Test public void testWordCorrelation() { String d1 = "Characterization of Calanus finmarchicus habitat in the North Sea"; @@ -183,127 +383,115 @@ public void twoEntriesWithSameISBNButDifferentTypesAreDuplicates() { assertTrue(duplicateChecker.isDuplicate(simpleArticle, duplicateWithDifferentType, BibDatabaseMode.BIBTEX)); } - @Test - public void twoInbooksWithDifferentChaptersAreNotDuplicates() { - twoEntriesWithDifferentSpecificFieldsAreNotDuplicates(simpleInbook, StandardField.CHAPTER, - "Chapter One – Down the Rabbit Hole", - "Chapter Two – The Pool of Tears"); - } - - @Test - public void twoInbooksWithDifferentPagesAreNotDuplicates() { - twoEntriesWithDifferentSpecificFieldsAreNotDuplicates(simpleInbook, StandardField.PAGES, "1-20", "21-40"); - } - - @Test - public void twoIncollectionsWithDifferentChaptersAreNotDuplicates() { - twoEntriesWithDifferentSpecificFieldsAreNotDuplicates(simpleIncollection, StandardField.CHAPTER, "10", "9"); - } - - @Test - public void twoIncollectionsWithDifferentPagesAreNotDuplicates() { - twoEntriesWithDifferentSpecificFieldsAreNotDuplicates(simpleIncollection, StandardField.PAGES, "1-20", "21-40"); + public static Stream twoEntriesWithDifferentSpecificFieldsAreNotDuplicates() { + return Stream.of( + // twoInbooksWithDifferentChaptersAreNotDuplicates + Arguments.of(getSimpleInbook(), StandardField.CHAPTER, + "Chapter One – Down the Rabbit Hole", + "Chapter Two – The Pool of Tears"), + // twoInbooksWithDifferentPagesAreNotDuplicates + Arguments.of(getSimpleInbook(), StandardField.PAGES, "1-20", "21-40"), + // twoIncollectionsWithDifferentChaptersAreNotDuplicates + Arguments.of(getSimpleIncollection(), StandardField.CHAPTER, "10", "9"), + // twoEntriesWithDifferentSpecificFieldsAreNotDuplicates + Arguments.of(getSimpleIncollection(), StandardField.PAGES, "1-20", "21-40") + ); } + @ParameterizedTest + @MethodSource private void twoEntriesWithDifferentSpecificFieldsAreNotDuplicates(final BibEntry cloneable, final Field field, final String firstValue, final String secondValue) { - final BibEntry entry1 = (BibEntry) cloneable.clone(); - entry1.setField(field, firstValue); - - final BibEntry entry2 = (BibEntry) cloneable.clone(); - entry2.setField(field, secondValue); - + final BibEntry entry1 = ((BibEntry) cloneable.clone()).withField(field, firstValue); + final BibEntry entry2 = ((BibEntry) cloneable.clone()).withField(field, secondValue); assertFalse(duplicateChecker.isDuplicate(entry1, entry2, BibDatabaseMode.BIBTEX)); } @Test public void inbookWithoutChapterCouldBeDuplicateOfInbookWithChapter() { - final BibEntry inbook1 = (BibEntry) simpleInbook.clone(); - final BibEntry inbook2 = (BibEntry) simpleInbook.clone(); - inbook2.setField(StandardField.CHAPTER, ""); + final BibEntry inbook2 = ((BibEntry) simpleInbook.clone()).withField(StandardField.CHAPTER, ""); - assertTrue(duplicateChecker.isDuplicate(inbook1, inbook2, BibDatabaseMode.BIBTEX)); - assertTrue(duplicateChecker.isDuplicate(inbook2, inbook1, BibDatabaseMode.BIBTEX)); + assertTrue(duplicateChecker.isDuplicate(simpleInbook, inbook2, BibDatabaseMode.BIBTEX)); } @Test public void twoBooksWithDifferentEditionsAreNotDuplicates() { - BibEntry editionOne = new BibEntry(StandardEntryType.Book); - editionOne.setField(StandardField.TITLE, "Effective Java"); - editionOne.setField(StandardField.AUTHOR, "Bloch, Joshua"); - editionOne.setField(StandardField.PUBLISHER, "Prentice Hall"); - editionOne.setField(StandardField.DATE, "2001"); - editionOne.setField(StandardField.EDITION, "1"); - - BibEntry editionTwo = new BibEntry(StandardEntryType.Book); - editionTwo.setField(StandardField.TITLE, "Effective Java"); - editionTwo.setField(StandardField.AUTHOR, "Bloch, Joshua"); - editionTwo.setField(StandardField.PUBLISHER, "Prentice Hall"); - editionTwo.setField(StandardField.DATE, "2008"); - editionTwo.setField(StandardField.EDITION, "2"); + BibEntry editionOne = new BibEntry(StandardEntryType.Book) + .withField(StandardField.TITLE, "Effective Java") + .withField(StandardField.AUTHOR, "Bloch, Joshua") + .withField(StandardField.PUBLISHER, "Prentice Hall") + .withField(StandardField.DATE, "2001") + .withField(StandardField.EDITION, "1"); + + BibEntry editionTwo = new BibEntry(StandardEntryType.Book) + .withField(StandardField.TITLE, "Effective Java") + .withField(StandardField.AUTHOR, "Bloch, Joshua") + .withField(StandardField.PUBLISHER, "Prentice Hall") + .withField(StandardField.DATE, "2008") + .withField(StandardField.EDITION, "2"); assertFalse(duplicateChecker.isDuplicate(editionOne, editionTwo, BibDatabaseMode.BIBTEX)); } @Test public void sameBooksWithMissingEditionAreDuplicates() { - BibEntry editionOne = new BibEntry(StandardEntryType.Book); - editionOne.setField(StandardField.TITLE, "Effective Java"); - editionOne.setField(StandardField.AUTHOR, "Bloch, Joshua"); - editionOne.setField(StandardField.PUBLISHER, "Prentice Hall"); - editionOne.setField(StandardField.DATE, "2001"); - - BibEntry editionTwo = new BibEntry(StandardEntryType.Book); - editionTwo.setField(StandardField.TITLE, "Effective Java"); - editionTwo.setField(StandardField.AUTHOR, "Bloch, Joshua"); - editionTwo.setField(StandardField.PUBLISHER, "Prentice Hall"); - editionTwo.setField(StandardField.DATE, "2008"); + BibEntry editionOne = new BibEntry(StandardEntryType.Book) + .withField(StandardField.TITLE, "Effective Java") + .withField(StandardField.AUTHOR, "Bloch, Joshua") + .withField(StandardField.PUBLISHER, "Prentice Hall") + .withField(StandardField.DATE, "2001"); + + BibEntry editionTwo = new BibEntry(StandardEntryType.Book) + .withField(StandardField.TITLE, "Effective Java") + .withField(StandardField.AUTHOR, "Bloch, Joshua") + .withField(StandardField.PUBLISHER, "Prentice Hall") + .withField(StandardField.DATE, "2008"); assertTrue(duplicateChecker.isDuplicate(editionOne, editionTwo, BibDatabaseMode.BIBTEX)); } @Test public void sameBooksWithPartiallyMissingEditionAreDuplicates() { - BibEntry editionOne = new BibEntry(StandardEntryType.Book); - editionOne.setField(StandardField.TITLE, "Effective Java"); - editionOne.setField(StandardField.AUTHOR, "Bloch, Joshua"); - editionOne.setField(StandardField.PUBLISHER, "Prentice Hall"); - editionOne.setField(StandardField.DATE, "2001"); - - BibEntry editionTwo = new BibEntry(StandardEntryType.Book); - editionTwo.setField(StandardField.TITLE, "Effective Java"); - editionTwo.setField(StandardField.AUTHOR, "Bloch, Joshua"); - editionTwo.setField(StandardField.PUBLISHER, "Prentice Hall"); - editionTwo.setField(StandardField.DATE, "2008"); - editionTwo.setField(StandardField.EDITION, "2"); + BibEntry editionOne = new BibEntry(StandardEntryType.Book) + .withField(StandardField.TITLE, "Effective Java") + .withField(StandardField.AUTHOR, "Bloch, Joshua") + .withField(StandardField.PUBLISHER, "Prentice Hall") + .withField(StandardField.DATE, "2001"); + + BibEntry editionTwo = new BibEntry(StandardEntryType.Book) + .withField(StandardField.TITLE, "Effective Java") + .withField(StandardField.AUTHOR, "Bloch, Joshua") + .withField(StandardField.PUBLISHER, "Prentice Hall") + .withField(StandardField.DATE, "2008") + .withField(StandardField.EDITION, "2"); assertTrue(duplicateChecker.isDuplicate(editionOne, editionTwo, BibDatabaseMode.BIBTEX)); } @Test public void sameBooksWithDifferentEditionsAreNotDuplicates() { - BibEntry editionTwo = new BibEntry(StandardEntryType.Book); - editionTwo.setCitationKey("Sutton17reinfLrnIntroBook"); - editionTwo.setField(StandardField.TITLE, "Reinforcement learning:An introduction"); - editionTwo.setField(StandardField.PUBLISHER, "MIT Press"); - editionTwo.setField(StandardField.YEAR, "2017"); - editionTwo.setField(StandardField.AUTHOR, "Sutton, Richard S and Barto, Andrew G"); - editionTwo.setField(StandardField.ADDRESS, "Cambridge, MA.USA"); - editionTwo.setField(StandardField.EDITION, "Second"); - editionTwo.setField(StandardField.JOURNAL, "MIT Press"); - editionTwo.setField(StandardField.URL, "https://webdocs.cs.ualberta.ca/~sutton/book/the-book-2nd.html"); - - BibEntry editionOne = new BibEntry(StandardEntryType.Book); - editionOne.setCitationKey("Sutton98reinfLrnIntroBook"); - editionOne.setField(StandardField.TITLE, "Reinforcement learning: An introduction"); - editionOne.setField(StandardField.PUBLISHER, "MIT press Cambridge"); - editionOne.setField(StandardField.YEAR, "1998"); - editionOne.setField(StandardField.AUTHOR, "Sutton, Richard S and Barto, Andrew G"); - editionOne.setField(StandardField.VOLUME, "1"); - editionOne.setField(StandardField.NUMBER, "1"); - editionOne.setField(StandardField.EDITION, "First"); + BibEntry editionTwo = new BibEntry(StandardEntryType.Book) + .withCitationKey("Sutton17reinfLrnIntroBook") + .withField(StandardField.TITLE, "Reinforcement learning:An introduction") + .withField(StandardField.PUBLISHER, "MIT Press") + .withField(StandardField.YEAR, "2017") + .withField(StandardField.AUTHOR, "Sutton, Richard S and Barto, Andrew G") + .withField(StandardField.ADDRESS, "Cambridge, MA.USA") + .withField(StandardField.EDITION, "Second") + .withField(StandardField.JOURNAL, "MIT Press") + .withField(StandardField.URL, "https://webdocs.cs.ualberta.ca/~sutton/book/the-book-2nd.html"); + + BibEntry editionOne = new BibEntry(StandardEntryType.Book) + .withCitationKey("Sutton98reinfLrnIntroBook") + .withField(StandardField.TITLE, "Reinforcement learning: An introduction") + .withField(StandardField.PUBLISHER, "MIT press Cambridge") + .withField(StandardField.YEAR, "1998") + .withField(StandardField.AUTHOR, "Sutton, Richard S and Barto, Andrew G") + .withField(StandardField.VOLUME, "1") + .withField(StandardField.NUMBER, "1") + .withField(StandardField.EDITION, "First"); assertFalse(duplicateChecker.isDuplicate(editionOne, editionTwo, BibDatabaseMode.BIBTEX)); } diff --git a/src/test/java/org/jabref/logic/net/URLDownloadTest.java b/src/test/java/org/jabref/logic/net/URLDownloadTest.java index c94eb0dd69a..48eb2d20824 100644 --- a/src/test/java/org/jabref/logic/net/URLDownloadTest.java +++ b/src/test/java/org/jabref/logic/net/URLDownloadTest.java @@ -17,6 +17,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -131,7 +132,7 @@ public void test503ErrorThrowsNestedIOExceptionWithFetcherServerException() thro URLDownload urlDownload = new URLDownload(new URL("http://httpstat.us/503")); Exception exception = assertThrows(IOException.class, urlDownload::asString); - assertTrue(exception.getCause() instanceof FetcherServerException); + assertInstanceOf(FetcherServerException.class, exception.getCause()); } @Test @@ -139,6 +140,6 @@ public void test429ErrorThrowsNestedIOExceptionWithFetcherServerException() thro URLDownload urlDownload = new URLDownload(new URL("http://httpstat.us/429")); Exception exception = assertThrows(IOException.class, urlDownload::asString); - assertTrue(exception.getCause() instanceof FetcherClientException); + assertInstanceOf(FetcherClientException.class, exception.getCause()); } } diff --git a/src/test/java/org/jabref/logic/shared/DBMSProcessorTest.java b/src/test/java/org/jabref/logic/shared/DBMSProcessorTest.java index 313b5f907dd..e429134839c 100644 --- a/src/test/java/org/jabref/logic/shared/DBMSProcessorTest.java +++ b/src/test/java/org/jabref/logic/shared/DBMSProcessorTest.java @@ -20,6 +20,7 @@ import org.jabref.testutils.category.DatabaseTest; import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; @@ -435,13 +436,11 @@ private ResultSet selectFrom(String table, DBMSConnection dbmsConnection, DBMSPr // Oracle does not support multiple tuple insertion in one INSERT INTO command. // Therefore this function was defined to improve the readability and to keep the code short. private void insertMetaData(String key, String value, DBMSConnection dbmsConnection, DBMSProcessor dbmsProcessor) { - try { + Assertions.assertDoesNotThrow(() -> { dbmsConnection.getConnection().createStatement().executeUpdate("INSERT INTO " + escape_Table("METADATA", dbmsProcessor) + "(" + escape("KEY", dbmsProcessor) + ", " + escape("VALUE", dbmsProcessor) + ") VALUES(" + escapeValue(key) + ", " + escapeValue(value) + ")"); - } catch (SQLException e) { - fail(e.getMessage()); - } + }); } private static String escape(String expression, DBMSProcessor dbmsProcessor) {