diff --git a/CHANGELOG.md b/CHANGELOG.md index 6df019fe891..e2db125f7b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -83,6 +83,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - 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 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 when an "Abstract field" was duplicating text, when importing from RIS file (Neurons) [#6065](https://github.com/JabRef/jabref/issues/6065) ### Removed diff --git a/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java index 5c941f75fcb..6393bdc7a8c 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java @@ -199,7 +199,7 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { String oldAb = fields.get(StandardField.ABSTRACT); if (oldAb == null) { fields.put(StandardField.ABSTRACT, value); - } else { + } else if (!oldAb.equals(value) && !value.isEmpty()) { fields.put(StandardField.ABSTRACT, oldAb + OS.NEWLINE + value); } } else if ("UR".equals(tag) || "L2".equals(tag) || "LK".equals(tag)) { diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/RisImporterTest9.bib b/src/test/resources/org/jabref/logic/importer/fileformat/RisImporterTest9.bib new file mode 100644 index 00000000000..7555e5422d1 --- /dev/null +++ b/src/test/resources/org/jabref/logic/importer/fileformat/RisImporterTest9.bib @@ -0,0 +1,18 @@ +% Encoding: UTF-8 + +@Article{, + author = {Kriegeskorte, Nikolaus and Storrs, Katherine R.}, + title = {Grid Cells for Conceptual Spaces?}, + doi = {10.1016/j.neuron.2016.10.006}, + issn = {0896-6273}, + number = {2}, + pages = {280--284}, + url = {https://doi.org/10.1016/j.neuron.2016.10.006}, + volume = {92}, + abstract = {location and direction of movement in 2D physical environments via regularly repeating receptive fields.}, + comment = {doi: 10.1016/j.neuron.2016.10.006}, + journal = {Neuron}, + month = oct, + publisher = {Elsevier}, + year = {2016}, +} diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/RisImporterTest9.ris b/src/test/resources/org/jabref/logic/importer/fileformat/RisImporterTest9.ris new file mode 100644 index 00000000000..496e17caa88 --- /dev/null +++ b/src/test/resources/org/jabref/logic/importer/fileformat/RisImporterTest9.ris @@ -0,0 +1,23 @@ +TY - JOUR +T1 - Grid Cells for Conceptual Spaces? +AU - Kriegeskorte, Nikolaus +AU - Storrs, Katherine R. +Y1 - 2016/10/19 +PY - 2016 +N1 - doi: 10.1016/j.neuron.2016.10.006 +DO - 10.1016/j.neuron.2016.10.006 +T2 - Neuron +JF - Neuron +SP - 280 +EP - 284 +VL - 92 +IS - 2 +PB - Elsevier +N2 - location and direction of movement in 2D physical environments via regularly repeating receptive fields. +AB - location and direction of movement in 2D physical environments via regularly repeating receptive fields. +SN - 0896-6273 +M3 - doi: 10.1016/j.neuron.2016.10.006 +UR - https://doi.org/10.1016/j.neuron.2016.10.006 +Y2 - 2020/03/04 +ER - +