From 54d51998265d9f19edd301270a05f9c138d16ff3 Mon Sep 17 00:00:00 2001 From: Stanley F Date: Thu, 5 Sep 2019 14:02:05 +0200 Subject: [PATCH 1/8] Unify month field formatting in test bib files (fixes JabRef/jabref#5116) --- .../logic/exporter/BibTeXMLExporterTestArticle.bib | 2 +- .../BibTeXMLExporterTestArticleWithoutID.bib | 2 +- .../logic/exporter/BibTeXMLExporterTestBook.bib | 2 +- .../logic/exporter/BibTeXMLExporterTestBooklet.bib | 2 +- .../exporter/BibTeXMLExporterTestConference.bib | 2 +- .../logic/exporter/BibTeXMLExporterTestInBook.bib | 2 +- .../exporter/BibTeXMLExporterTestInCollection.bib | 2 +- .../exporter/BibTeXMLExporterTestInProceedings.bib | 2 +- .../BibTeXMLExporterTestInbookLessFields.bib | 2 +- .../logic/exporter/BibTeXMLExporterTestManual.bib | 2 +- .../exporter/BibTeXMLExporterTestMasterThesis.bib | 2 +- .../logic/exporter/BibTeXMLExporterTestMisc.bib | 2 +- .../exporter/BibTeXMLExporterTestPhdThesis.bib | 2 +- .../exporter/BibTeXMLExporterTestProceedings.bib | 2 +- .../exporter/BibTeXMLExporterTestTechReport.bib | 2 +- .../exporter/BibTeXMLExporterTestUnpublished.bib | 2 +- .../fileformat/BibTeXMLImporterTestArticle.bib | 2 +- .../fileformat/BibTeXMLImporterTestArticle2.bib | 2 +- .../BibTeXMLImporterTestArticleWithoutID.bib | 2 +- .../fileformat/BibTeXMLImporterTestBook.bib | 2 +- .../fileformat/BibTeXMLImporterTestBooklet.bib | 2 +- .../fileformat/BibTeXMLImporterTestConference.bib | 2 +- .../fileformat/BibTeXMLImporterTestInBook.bib | 2 +- .../BibTeXMLImporterTestInCollection.bib | 2 +- .../BibTeXMLImporterTestInProceedings.bib | 2 +- .../BibTeXMLImporterTestInbookLessFields.bib | 2 +- ...TeXMLImporterTestIncollectionWithoutChapter.bib | 2 +- .../fileformat/BibTeXMLImporterTestManual.bib | 2 +- .../BibTeXMLImporterTestMasterThesis.bib | 2 +- .../fileformat/BibTeXMLImporterTestMisc.bib | 2 +- .../fileformat/BibTeXMLImporterTestPhdThesis.bib | 2 +- .../fileformat/BibTeXMLImporterTestProceedings.bib | 2 +- .../fileformat/BibTeXMLImporterTestTechReport.bib | 2 +- .../fileformat/BibTeXMLImporterTestUnpublished.bib | 2 +- .../fileformat/MedlineImporterTestArticleID.bib | 2 +- .../MedlineImporterTestArticleNoISSN.bib | 2 +- .../MedlineImporterTestBookArticleSet.bib | 2 +- .../fileformat/MedlineImporterTestNbib.bib | 2 +- .../fileformat/MedlineImporterTestPubmedBook.bib | 2 +- .../org/jabref/logic/xmp/article_dublinCore.bib | 2 +- src/test/resources/org/jabref/util/twente.bib | 2 +- src/test/resources/testbib/jabref-authors.bib | 14 +++++++------- src/test/resources/testbib/saveactions2.bib | 4 ++-- src/test/resources/testbib/testjabref_210as292.bib | 10 +++++----- src/test/resources/testbib/testjabref_292.bib | 10 +++++----- 45 files changed, 60 insertions(+), 60 deletions(-) diff --git a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestArticle.bib b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestArticle.bib index f170c7f5e10..8bae7ec117a 100644 --- a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestArticle.bib +++ b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestArticle.bib @@ -6,6 +6,6 @@ @Article{Mustermann2016 journal = {Java Journal}, year = {2016}, pages = {2}, - month = {February}, + month = feb, keywords = {java} } diff --git a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestArticleWithoutID.bib b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestArticleWithoutID.bib index b759fbeebf0..8e05175af26 100644 --- a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestArticleWithoutID.bib +++ b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestArticleWithoutID.bib @@ -6,6 +6,6 @@ @Article{ journal = {Java Journal}, year = {2016}, pages = {2}, - month = {February}, + month = feb, keywords = {java} } diff --git a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestBook.bib b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestBook.bib index d4b21de4684..fa5079267a5 100644 --- a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestBook.bib +++ b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestBook.bib @@ -6,6 +6,6 @@ @Book{Mustermann2016 year = {2016}, author = {Max Mustermann}, volume = {1}, - month = {February}, + month = feb, keywords = {java} } diff --git a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestBooklet.bib b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestBooklet.bib index 3dad334bf5f..ae3762ef13b 100644 --- a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestBooklet.bib +++ b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestBooklet.bib @@ -4,7 +4,7 @@ @Booklet{Mustermann2016 title = {Java Booklet}, author = {Max Mustermann}, address = {Stuttgart}, - month = {February}, + month = feb, year = {2016}, keywords = {java} } diff --git a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestConference.bib b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestConference.bib index e7709cedf11..55e24a662f7 100644 --- a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestConference.bib +++ b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestConference.bib @@ -11,7 +11,7 @@ @Conference{Mustermann2016 series = {1}, pages = {3-9}, address = {Stuttgart}, - month = {February}, + month = feb, organization = {Java Org}, publisher = {Java Publisher}, keywords = {java} diff --git a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestInBook.bib b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestInBook.bib index d0e1c4d6686..a3d080037ca 100644 --- a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestInBook.bib +++ b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestInBook.bib @@ -8,6 +8,6 @@ @InBook{Mustermann2016 year = {2016}, author = {Max Mustermann}, volume = {1}, - month = {February}, + month = feb, keywords = {java} } diff --git a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestInCollection.bib b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestInCollection.bib index 9fa735acd67..f9e6451fd56 100644 --- a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestInCollection.bib +++ b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestInCollection.bib @@ -11,6 +11,6 @@ @InCollection{Mustermann2016 number = {1}, chapter = {3}, pages = {18-26}, - month = {February}, + month = feb, keywords = {java} } diff --git a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestInProceedings.bib b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestInProceedings.bib index 0a9546563d9..a2f650259c1 100644 --- a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestInProceedings.bib +++ b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestInProceedings.bib @@ -5,7 +5,7 @@ @InProceedings{Mustermann2016 title = {Java InProceedings}, booktitle = {Java Book}, year = {2016}, - month = {February}, + month = feb, organization = {Java Org}, publisher = {Java Publisher}, keywords = {java} diff --git a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestInbookLessFields.bib b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestInbookLessFields.bib index 4014194c1b0..1c7c0aa3c7b 100644 --- a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestInbookLessFields.bib +++ b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestInbookLessFields.bib @@ -9,7 +9,7 @@ @InBook{Mustermann2016 series = {1}, address = {Stuttgart}, edition = {10}, - month = {February}, + month = feb, note = {some note}, keywords = {java}, } diff --git a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestManual.bib b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestManual.bib index 21a7961789e..8a4f5228bc8 100644 --- a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestManual.bib +++ b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestManual.bib @@ -5,7 +5,7 @@ @Manual{Mustermann2016 author = {Max Mustermann}, organization = {Java Users}, address = {Stuttgart}, - month = {February}, + month = feb, year = {2016}, keywords = {java} } diff --git a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestMasterThesis.bib b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestMasterThesis.bib index 003c2879c6c..54d02f07c16 100644 --- a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestMasterThesis.bib +++ b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestMasterThesis.bib @@ -7,6 +7,6 @@ @MastersThesis{Mustermann2016 year = {2016}, type = {Thesis}, address = {Stuttgart}, - month = {February}, + month = feb, keywords = {java} } diff --git a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestMisc.bib b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestMisc.bib index 9101bba68e2..1d67e193341 100644 --- a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestMisc.bib +++ b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestMisc.bib @@ -4,7 +4,7 @@ @Misc{Mustermann2016 author = {Max Mustermann}, title = {Java Misc}, howpublished = {Internet}, - month = {February}, + month = feb, year = {2016}, keywords = {java} } diff --git a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestPhdThesis.bib b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestPhdThesis.bib index 6121bc38d24..66707a4015e 100644 --- a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestPhdThesis.bib +++ b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestPhdThesis.bib @@ -7,6 +7,6 @@ @PhdThesis{Mustermann2016 year = {2016}, type = {Thesis}, address = {Stuttgart}, - month = {February}, + month = feb, keywords = {java} } diff --git a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestProceedings.bib b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestProceedings.bib index 8d6cbe4c661..c20654b07b9 100644 --- a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestProceedings.bib +++ b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestProceedings.bib @@ -6,6 +6,6 @@ @Proceedings{Musterfrau2016 editor = {Maxima Musterfrau}, address = {Stuttgart}, publisher = {Java Pub}, - month = {February}, + month = feb, organization = {Java Org} } diff --git a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestTechReport.bib b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestTechReport.bib index 1ab28ba275c..d88e3c1335a 100644 --- a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestTechReport.bib +++ b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestTechReport.bib @@ -6,6 +6,6 @@ @TechReport{Mustermann2016 type = {Report}, number = {1}, address = {Stuttgart}, - month = {February}, + month = feb, keywords = {java}, } diff --git a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestUnpublished.bib b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestUnpublished.bib index f1720ddef2b..a3dceb11d4b 100644 --- a/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestUnpublished.bib +++ b/src/test/resources/org/jabref/logic/exporter/BibTeXMLExporterTestUnpublished.bib @@ -3,7 +3,7 @@ @Unpublished{Mustermann2016, author = {Max Mustermann}, title = {Java Unpublished}, - month = {February}, + month = feb, year = {2016}, keywords = {java} } diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestArticle.bib b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestArticle.bib index f170c7f5e10..8bae7ec117a 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestArticle.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestArticle.bib @@ -6,6 +6,6 @@ @Article{Mustermann2016 journal = {Java Journal}, year = {2016}, pages = {2}, - month = {February}, + month = feb, keywords = {java} } diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestArticle2.bib b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestArticle2.bib index 515e1a1367b..580a364c6a3 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestArticle2.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestArticle2.bib @@ -2,7 +2,7 @@ @article{Mustermann2016 author = {Max Mustermann}, journal = {Java Journal}, keywords = {java}, - month = {February}, + month = feb, pages = {2}, title = {Java tricks}, year = {2016} diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestArticleWithoutID.bib b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestArticleWithoutID.bib index b759fbeebf0..8e05175af26 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestArticleWithoutID.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestArticleWithoutID.bib @@ -6,6 +6,6 @@ @Article{ journal = {Java Journal}, year = {2016}, pages = {2}, - month = {February}, + month = feb, keywords = {java} } diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestBook.bib b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestBook.bib index d4b21de4684..fa5079267a5 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestBook.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestBook.bib @@ -6,6 +6,6 @@ @Book{Mustermann2016 year = {2016}, author = {Max Mustermann}, volume = {1}, - month = {February}, + month = feb, keywords = {java} } diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestBooklet.bib b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestBooklet.bib index 3dad334bf5f..ae3762ef13b 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestBooklet.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestBooklet.bib @@ -4,7 +4,7 @@ @Booklet{Mustermann2016 title = {Java Booklet}, author = {Max Mustermann}, address = {Stuttgart}, - month = {February}, + month = feb, year = {2016}, keywords = {java} } diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestConference.bib b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestConference.bib index e7709cedf11..55e24a662f7 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestConference.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestConference.bib @@ -11,7 +11,7 @@ @Conference{Mustermann2016 series = {1}, pages = {3-9}, address = {Stuttgart}, - month = {February}, + month = feb, organization = {Java Org}, publisher = {Java Publisher}, keywords = {java} diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestInBook.bib b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestInBook.bib index d0e1c4d6686..a3d080037ca 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestInBook.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestInBook.bib @@ -8,6 +8,6 @@ @InBook{Mustermann2016 year = {2016}, author = {Max Mustermann}, volume = {1}, - month = {February}, + month = feb, keywords = {java} } diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestInCollection.bib b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestInCollection.bib index 9fa735acd67..f9e6451fd56 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestInCollection.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestInCollection.bib @@ -11,6 +11,6 @@ @InCollection{Mustermann2016 number = {1}, chapter = {3}, pages = {18-26}, - month = {February}, + month = feb, keywords = {java} } diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestInProceedings.bib b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestInProceedings.bib index 0a9546563d9..a2f650259c1 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestInProceedings.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestInProceedings.bib @@ -5,7 +5,7 @@ @InProceedings{Mustermann2016 title = {Java InProceedings}, booktitle = {Java Book}, year = {2016}, - month = {February}, + month = feb, organization = {Java Org}, publisher = {Java Publisher}, keywords = {java} diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestInbookLessFields.bib b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestInbookLessFields.bib index 4014194c1b0..1c7c0aa3c7b 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestInbookLessFields.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestInbookLessFields.bib @@ -9,7 +9,7 @@ @InBook{Mustermann2016 series = {1}, address = {Stuttgart}, edition = {10}, - month = {February}, + month = feb, note = {some note}, keywords = {java}, } diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestIncollectionWithoutChapter.bib b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestIncollectionWithoutChapter.bib index b716c95368d..9b8b1626563 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestIncollectionWithoutChapter.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestIncollectionWithoutChapter.bib @@ -9,6 +9,6 @@ @InCollection{Mustermann2016 volume = {1}, number = {1}, pages = {18-26}, - month = {February}, + month = feb, keywords = {java} } diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestManual.bib b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestManual.bib index 21a7961789e..8a4f5228bc8 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestManual.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestManual.bib @@ -5,7 +5,7 @@ @Manual{Mustermann2016 author = {Max Mustermann}, organization = {Java Users}, address = {Stuttgart}, - month = {February}, + month = feb, year = {2016}, keywords = {java} } diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestMasterThesis.bib b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestMasterThesis.bib index 003c2879c6c..54d02f07c16 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestMasterThesis.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestMasterThesis.bib @@ -7,6 +7,6 @@ @MastersThesis{Mustermann2016 year = {2016}, type = {Thesis}, address = {Stuttgart}, - month = {February}, + month = feb, keywords = {java} } diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestMisc.bib b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestMisc.bib index 9101bba68e2..1d67e193341 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestMisc.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestMisc.bib @@ -4,7 +4,7 @@ @Misc{Mustermann2016 author = {Max Mustermann}, title = {Java Misc}, howpublished = {Internet}, - month = {February}, + month = feb, year = {2016}, keywords = {java} } diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestPhdThesis.bib b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestPhdThesis.bib index 6121bc38d24..66707a4015e 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestPhdThesis.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestPhdThesis.bib @@ -7,6 +7,6 @@ @PhdThesis{Mustermann2016 year = {2016}, type = {Thesis}, address = {Stuttgart}, - month = {February}, + month = feb, keywords = {java} } diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestProceedings.bib b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestProceedings.bib index 8d6cbe4c661..c20654b07b9 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestProceedings.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestProceedings.bib @@ -6,6 +6,6 @@ @Proceedings{Musterfrau2016 editor = {Maxima Musterfrau}, address = {Stuttgart}, publisher = {Java Pub}, - month = {February}, + month = feb, organization = {Java Org} } diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestTechReport.bib b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestTechReport.bib index 1ab28ba275c..d88e3c1335a 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestTechReport.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestTechReport.bib @@ -6,6 +6,6 @@ @TechReport{Mustermann2016 type = {Report}, number = {1}, address = {Stuttgart}, - month = {February}, + month = feb, keywords = {java}, } diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestUnpublished.bib b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestUnpublished.bib index f1720ddef2b..a3dceb11d4b 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestUnpublished.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestUnpublished.bib @@ -3,7 +3,7 @@ @Unpublished{Mustermann2016, author = {Max Mustermann}, title = {Java Unpublished}, - month = {February}, + month = feb, year = {2016}, keywords = {java} } diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/MedlineImporterTestArticleID.bib b/src/test/resources/org/jabref/logic/importer/fileformat/MedlineImporterTestArticleID.bib index 720a0cdd464..e0ab059dc0e 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/MedlineImporterTestArticleID.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/MedlineImporterTestArticleID.bib @@ -8,7 +8,7 @@ @article{ journal = {Diagnostic microbiology and infectious disease}, journal-abbreviation = {Diagn Microbiol Infect Dis}, keywords = {Cryptococcal meningitis; Diagnostics; HIV; Immunocompromised; Meningitis; PCR}, - month = {Dec}, + month = dec, nlm-id = {8305899}, owner = {NLM}, pages = {1234}, diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/MedlineImporterTestArticleNoISSN.bib b/src/test/resources/org/jabref/logic/importer/fileformat/MedlineImporterTestArticleNoISSN.bib index f7b2362fbcc..b381cdc6486 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/MedlineImporterTestArticleNoISSN.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/MedlineImporterTestArticleNoISSN.bib @@ -8,7 +8,7 @@ @Article{ issue = {3}, pages = {228--242}, doi = {10.1080/1357650X.2015.1125914}, - month = {May}, + month = may, citation-subset = {IM}, country = {England}, created = {2016-03-10}, diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/MedlineImporterTestBookArticleSet.bib b/src/test/resources/org/jabref/logic/importer/fileformat/MedlineImporterTestBookArticleSet.bib index 4befa1c8704..cf6ed424c9b 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/MedlineImporterTestBookArticleSet.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/MedlineImporterTestBookArticleSet.bib @@ -4,7 +4,7 @@ @article{ contribution = {2012-03-27}, doi = {10.3275/8949}, isbn = {9781860163593}, - month = {02}, + month = feb, pii = {1223321}, pmid = {21413195}, publisher = {Royal College of Physicians (UK)}, diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/MedlineImporterTestNbib.bib b/src/test/resources/org/jabref/logic/importer/fileformat/MedlineImporterTestNbib.bib index 45a1448438a..6d897517d74 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/MedlineImporterTestNbib.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/MedlineImporterTestNbib.bib @@ -41,7 +41,7 @@ @article{ author = {National Collaborating Centre for Chronic Conditions (UK)}, copyright = {Copyright from somwhere}, isbn = {9781860163593}, - month = {02}, + month = feb, pmid = {21413195}, publisher = {Royal College of Physicians (UK)}, publocation = {London}, diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/MedlineImporterTestPubmedBook.bib b/src/test/resources/org/jabref/logic/importer/fileformat/MedlineImporterTestPubmedBook.bib index ea185bb5717..6b838e30345 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/MedlineImporterTestPubmedBook.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/MedlineImporterTestPubmedBook.bib @@ -1,7 +1,7 @@ @Article{, title = {Rheumatoid Arthritis: National Clinical Guideline for Management and Treatment in Adults}, year = {2009}, - month = {02}, + month = feb, abstract = {just a dummy.}, author = {National Collaborating Centre for Chronic Conditions (UK) and Williams, Darlisha A}, copyright = {Copyright from somwhere}, diff --git a/src/test/resources/org/jabref/logic/xmp/article_dublinCore.bib b/src/test/resources/org/jabref/logic/xmp/article_dublinCore.bib index 42645b694f6..7a0af0f2d01 100644 --- a/src/test/resources/org/jabref/logic/xmp/article_dublinCore.bib +++ b/src/test/resources/org/jabref/logic/xmp/article_dublinCore.bib @@ -6,7 +6,7 @@ @Article{Olly2018 volume = {1}, number = {1}, pages = {1-2}, - month = {mar}, + month = mar, issn = {978-123-123}, note = {That's a note}, abstract = {That's an abstract}, diff --git a/src/test/resources/org/jabref/util/twente.bib b/src/test/resources/org/jabref/util/twente.bib index f8d4d51f0da..a02f1c17499 100644 --- a/src/test/resources/org/jabref/util/twente.bib +++ b/src/test/resources/org/jabref/util/twente.bib @@ -144,7 +144,7 @@ @TECHREPORT{Patterson06 year = {2006}, type = {Presentation}, address = {Palo Alto, CA}, - month = {August}, + month = aug, pdf = {Patterson06.pdf}, url = {http://www.hotchips.org/hc18/program/conference_day_one.htm} } diff --git a/src/test/resources/testbib/jabref-authors.bib b/src/test/resources/testbib/jabref-authors.bib index 3ff9ce751e5..d79207bb5fd 100644 --- a/src/test/resources/testbib/jabref-authors.bib +++ b/src/test/resources/testbib/jabref-authors.bib @@ -1136,7 +1136,7 @@ @InProceedings{GeigerHarrerLenhardEtAl2016 year = {2016}, pages = {120--128}, address = {Oxford, UK}, - month = {March/April}, + month = mar, doi = {10.1109/sose.2016.39}, file = {:geiger2016evolution.pdf:PDF}, keywords = {rank4}, @@ -1148,7 +1148,7 @@ @InProceedings{GeigerHarrerLenhard2016 booktitle = {Proceedings of the 8th Central-European Workshop on Services and their Composition (ZEUS), January 27-28, Vienna, Austria}, year = {2016}, pages = {37--44}, - month = {jan}, + month = jan, file = {:Geiger2016ProcessEngineBenchmarking.pdf:PDF}, } @@ -1315,7 +1315,7 @@ @TechReport{Geiger2013 year = {2013}, type = {Bamberger Beitr\"age zur Wirtschaftsinformatik und Angewandten Informatik,}, number = {no. 92}, - month = {May}, + month = may, file = {:Geiger2013BPMN20Process.pdf:PDF}, } @@ -1451,7 +1451,7 @@ @InProceedings{GeigerSchoenbergerWirtz2011 year = {2011}, series = {CEUR Workshop Proceedings}, pages = {24--25}, - month = {Feb}, + month = feb, publisher = {CEUR-WS.org}, file = {:Geiger2011ProposalCheckingConformance.pdf:PDF}, } @@ -1480,9 +1480,9 @@ @InProceedings{SchoenbergerSchwalbWirtz2011 @InProceedings{GeigerSchoenbergerWirtz2011a, author = {Matthias Geiger and Andreas Sch\"onberger and Guido Wirtz}, title = {{Towards Automated Conformance Checking of {ebBP-ST} Choreographies and Corresponding {WS-BPEL} Based Orchestrations}}, - booktitle = {Conference on Software Engineering and Knowledge Engineering (SEKE), Miami, Florida, USA}, + booktitle = {Conference on Software Engineering and Knowledge Engineering (SEKE), Miami, Florida, USA, July 7-9, 2011}, year = {2011}, - month = {7.-9. July}, + month = jul, publisher = {Knowledge Systems Institute}, file = {:Geiger2011TowardsAutomatedConformance.pdf:PDF}, } @@ -1501,7 +1501,7 @@ @InProceedings{SchoenbergerBenkerFritzemeierEtAl2009 title = {{QoS}-{E}nabled {B}usiness-to-{B}usiness {I}ntegration {U}sing {ebBP} to {WS-BPEL} {T}ranslations}, booktitle = {Proceedings of the IEEE SCC 2009 International Conference on Services Computing, Bangalore, India}, year = {2009}, - month = {September}, + month = sep, organization = {IEEE}, doi = {10.1109/scc.2009.56}, keywords = {B2Bi, ebXML BPSS, WS-BPEL, Quality of Service, NES, conformance}, diff --git a/src/test/resources/testbib/saveactions2.bib b/src/test/resources/testbib/saveactions2.bib index fe5a0921276..284697a6741 100644 --- a/src/test/resources/testbib/saveactions2.bib +++ b/src/test/resources/testbib/saveactions2.bib @@ -3,11 +3,11 @@ @InProceedings{Pautasso2015TowardsWorkflowBenchmarking, author = {Pautasso, Cesare and Ferme, Vincenzo and Roller, Dieter and Leymann, Frank and Skouradaki, Marigianna}, title = {{Towards Workflow Benchmarking: Open Research Challenges}}, - booktitle = {Proceedings of the 16\textsuperscript{th} Conference on Database Systems for Business, Technology, and Web}, + booktitle = {Proceedings of the 16\textsuperscript{th} Conference on Database Systems for Business, Technology, and Web, March 2-6, 2015}, year = {2015}, pages = {1--20}, address = {Hamburg, Germany}, - month = {March 2-6}, + month = mar file = {:Pautasso2015TowardsWorkflowBenchmarking.pdf:PDF}, keywords = {benchflow} } diff --git a/src/test/resources/testbib/testjabref_210as292.bib b/src/test/resources/testbib/testjabref_210as292.bib index eaf4c6f3516..9885433cb84 100644 --- a/src/test/resources/testbib/testjabref_210as292.bib +++ b/src/test/resources/testbib/testjabref_210as292.bib @@ -16,7 +16,7 @@ @ARTICLE{Aziz2009256-ChannelNeuralRecordingandDeltaCompressionMicrosystemWith3DE volume = {44}, pages = {995-1005}, number = {3}, - month = {MAR}, + month = mar, abstract = {A 3D microsystem for multi-site penetrating extracellular neural recording from the brain is presented. A 16 x 16-channel neural recording interface @@ -161,7 +161,7 @@ @ARTICLE{Baccus1998Synapticfacilitationbyreflectedactionpotentials--enhancemento volume = {95}, pages = {8345--8350}, number = {14}, - month = {Jul}, + month = jul, abstract = {A rapid, reversible enhancement of synaptic transmission from a sensory neuron is reported and explained by impulses that reverse direction, @@ -240,7 +240,7 @@ @ARTICLE{Brewer1995Serum-freeB27/neurobasalmediumsupportsdifferentiatedgrowthofn volume = {42}, pages = {674--683}, number = {5}, - month = {Dec}, + month = dec, abstract = {Two fundamental questions about neuron cell culture were addressed. Can one serum-free medium that was developed for optimum growth of @@ -342,7 +342,7 @@ @ARTICLE{Brewer1997Isolationandcultureofadultrathippocampalneurons.JNeurosciMeth volume = {71}, pages = {143--155}, number = {2}, - month = {Feb}, + month = feb, abstract = {Inability to culture adult central neurons and the failure of injured neurons to regenerate in the brain could be due to genetic controls @@ -417,7 +417,7 @@ @ARTICLE{Brewer2008NbActiv4mediumimprovementtoNeurobasal/B27increasesneuronsynap volume = {170}, pages = {181--187}, number = {2}, - month = {May}, + month = may, abstract = {The most interesting property of neurons is their long-distance propagation of signals as spiking action potentials. Since 1993, Neurobasal/B27 diff --git a/src/test/resources/testbib/testjabref_292.bib b/src/test/resources/testbib/testjabref_292.bib index d267b33c4e7..939e1b14fd3 100644 --- a/src/test/resources/testbib/testjabref_292.bib +++ b/src/test/resources/testbib/testjabref_292.bib @@ -12,7 +12,7 @@ @ARTICLE{Aziz2009256-ChannelNeuralRecordingandDeltaCompressionMicrosystemWith3DE volume = {44}, pages = {995-1005}, number = {3}, - month = {MAR}, + month = mar, abstract = {A 3D microsystem for multi-site penetrating extracellular neural recording from the brain is presented. A 16 x 16-channel neural recording interface integrated prototype fabricated in 0.35 mu m CMOS occupies 3.5 mm @@ -83,7 +83,7 @@ @ARTICLE{Baccus1998Synapticfacilitationbyreflectedactionpotentials--enhancemento volume = {95}, pages = {8345--8350}, number = {14}, - month = {Jul}, + month = jul, abstract = {A rapid, reversible enhancement of synaptic transmission from a sensory neuron is reported and explained by impulses that reverse direction, or reflect, at axon branch points. In leech mechanosensory neurons, @@ -154,7 +154,7 @@ @ARTICLE{Brewer1997Isolationandcultureofadultrathippocampalneurons.JNeurosciMeth volume = {71}, pages = {143--155}, number = {2}, - month = {Feb}, + month = feb, abstract = {Inability to culture adult central neurons and the failure of injured neurons to regenerate in the brain could be due to genetic controls or environmental inhibitors. We tested the environmental inhibitor @@ -200,7 +200,7 @@ @ARTICLE{Brewer1995Serum-freeB27/neurobasalmediumsupportsdifferentiatedgrowthofn volume = {42}, pages = {674--683}, number = {5}, - month = {Dec}, + month = dec, abstract = {Two fundamental questions about neuron cell culture were addressed. Can one serum-free medium that was developed for optimum growth of hippocampal neurons support the growth of neurons from other regions @@ -262,7 +262,7 @@ @ARTICLE{Brewer2008NbActiv4mediumimprovementtoNeurobasal/B27increasesneuronsynap volume = {170}, pages = {181--187}, number = {2}, - month = {May}, + month = may, abstract = {The most interesting property of neurons is their long-distance propagation of signals as spiking action potentials. Since 1993, Neurobasal/B27 has been used as a serum-free medium optimized for hippocampal neuron From ff2000dc425283bf908a6acd7570f9cfce9ac6d4 Mon Sep 17 00:00:00 2001 From: Stanley F Date: Mon, 9 Sep 2019 15:26:53 +0200 Subject: [PATCH 2/8] prevent bibtex parser to add # to month --- .../org/jabref/logic/importer/fileformat/BibtexParser.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/logic/importer/fileformat/BibtexParser.java b/src/main/java/org/jabref/logic/importer/fileformat/BibtexParser.java index 67837f3e0f1..2e8e52aab4d 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/BibtexParser.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/BibtexParser.java @@ -618,7 +618,11 @@ private String parseFieldContent(Field field) throws IOException { throw new IOException("Error in line " + line + " or above: " + "Empty text token.\nThis could be caused " + "by a missing comma between two fields."); } - value.append('#').append(textToken).append('#'); + if (field != StandardField.MONTH) { + value.append('#').append(textToken).append('#'); + } else { + value.append(textToken); + } } skipWhitespace(); } From e3f15268dcfb7fc0771ea8b7ca38db498e3958fa Mon Sep 17 00:00:00 2001 From: Stanley F Date: Mon, 9 Sep 2019 15:27:24 +0200 Subject: [PATCH 3/8] convert medline month to bibtex format --- .../jabref/logic/importer/fileformat/MedlineImporter.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java index bc8feb039f0..ef09da01487 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java @@ -13,6 +13,7 @@ import java.util.Locale; import java.util.Map; import java.util.Objects; +import java.util.Optional; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBElement; @@ -74,6 +75,7 @@ import org.jabref.logic.importer.fileformat.medline.Text; import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.Month; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.FieldFactory; import org.jabref.model.entry.field.InternalField; @@ -603,7 +605,10 @@ private void addPubDate(Map fields, PubDate pubDate) { } else { fields.put(StandardField.YEAR, pubDate.getYear()); if (pubDate.getMonth() != null) { - fields.put(StandardField.MONTH, pubDate.getMonth()); + Optional month = Month.parse(pubDate.getMonth()); + if (month.isPresent()) { + fields.put(StandardField.MONTH, month.get().getShortName()); + } } else if (pubDate.getSeason() != null) { fields.put(new UnknownField("season"), pubDate.getSeason()); } From 77c25ca0f1702991493cf37278a4cedad0d984a4 Mon Sep 17 00:00:00 2001 From: Stanley F Date: Mon, 9 Sep 2019 15:32:26 +0200 Subject: [PATCH 4/8] fix jabref format of month --- .../org/jabref/logic/importer/fileformat/MedlineImporter.java | 2 +- src/main/java/org/jabref/model/entry/Month.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java index ef09da01487..c37038bbb81 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java @@ -607,7 +607,7 @@ private void addPubDate(Map fields, PubDate pubDate) { if (pubDate.getMonth() != null) { Optional month = Month.parse(pubDate.getMonth()); if (month.isPresent()) { - fields.put(StandardField.MONTH, month.get().getShortName()); + fields.put(StandardField.MONTH, month.get().getJabRefFormat()); } } else if (pubDate.getSeason() != null) { fields.put(new UnknownField("season"), pubDate.getSeason()); diff --git a/src/main/java/org/jabref/model/entry/Month.java b/src/main/java/org/jabref/model/entry/Month.java index 80d3e0b5ef5..6eab6df9d31 100644 --- a/src/main/java/org/jabref/model/entry/Month.java +++ b/src/main/java/org/jabref/model/entry/Month.java @@ -175,7 +175,7 @@ public String getShortName() { * @return Month in JabRef format */ public String getJabRefFormat() { - return String.format("#%s#", shortName); + return String.format("%s", shortName); } /** From b9cfb4064ab63f7f81af997425bd3dc156473b6a Mon Sep 17 00:00:00 2001 From: Stanley F Date: Mon, 9 Sep 2019 15:34:57 +0200 Subject: [PATCH 5/8] fix month format in IsiImporterTest --- .../importer/fileformat/IsiImporterTest.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/test/java/org/jabref/logic/importer/fileformat/IsiImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/IsiImporterTest.java index daa7834214b..6fc0ea874c0 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/IsiImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/IsiImporterTest.java @@ -191,7 +191,7 @@ public void testImportEntriesINSPEC() throws IOException, URISyntaxException { first.getField(StandardField.AUTHOR)); assertEquals(Optional.of("Applied Physics Letters"), first.getField(StandardField.JOURNAL)); assertEquals(Optional.of("2006"), first.getField(StandardField.YEAR)); - assertEquals(Optional.of("#jul#"), first.getField(StandardField.MONTH)); + assertEquals(Optional.of("jul"), first.getField(StandardField.MONTH)); assertEquals(Optional.of("89"), first.getField(StandardField.VOLUME)); assertEquals(Optional.of("4"), first.getField(StandardField.NUMBER)); assertEquals(Optional.of("Lorem ipsum abstract"), first.getField(StandardField.ABSTRACT)); @@ -235,14 +235,14 @@ public void testIsiAuthorsConvert() { @Test public void testMonthConvert() { - assertEquals("#jun#", IsiImporter.parseMonth("06")); - assertEquals("#jun#", IsiImporter.parseMonth("JUN")); - assertEquals("#jun#", IsiImporter.parseMonth("jUn")); - assertEquals("#may#", IsiImporter.parseMonth("MAY-JUN")); - assertEquals("#jun#", IsiImporter.parseMonth("2006 06")); - assertEquals("#jun#", IsiImporter.parseMonth("2006 06-07")); - assertEquals("#jul#", IsiImporter.parseMonth("2006 07 03")); - assertEquals("#may#", IsiImporter.parseMonth("2006 May-Jun")); + assertEquals("jun", IsiImporter.parseMonth("06")); + assertEquals("jun", IsiImporter.parseMonth("JUN")); + assertEquals("jun", IsiImporter.parseMonth("jUn")); + assertEquals("may", IsiImporter.parseMonth("MAY-JUN")); + assertEquals("jun", IsiImporter.parseMonth("2006 06")); + assertEquals("jun", IsiImporter.parseMonth("2006 06-07")); + assertEquals("jul", IsiImporter.parseMonth("2006 07 03")); + assertEquals("may", IsiImporter.parseMonth("2006 May-Jun")); } @Test @@ -334,7 +334,7 @@ public void testImportEntriesMedline() throws IOException, URISyntaxException { "Joffe, Hadine and Hall, Janet E. and Gruber, Staci and Sarmiento, Ingrid A. and Cohen, Lee S. and Yurgelun-Todd, Deborah and Martin, Kathryn A."), second.getField(StandardField.AUTHOR)); assertEquals(Optional.of("2006"), second.getField(StandardField.YEAR)); - assertEquals(Optional.of("#may#"), second.getField(StandardField.MONTH)); + assertEquals(Optional.of("may"), second.getField(StandardField.MONTH)); assertEquals(Optional.of("13"), second.getField(StandardField.VOLUME)); assertEquals(Optional.of("3"), second.getField(StandardField.NUMBER)); assertEquals(Optional.of("411--22"), second.getField(StandardField.PAGES)); From 0c538d1c2f78e3ad58b26c34ea71141ff75e7b27 Mon Sep 17 00:00:00 2001 From: Stanley F Date: Mon, 9 Sep 2019 16:00:44 +0200 Subject: [PATCH 6/8] fix month formatting in BibTeXML importer --- .../importer/fileformat/BibTeXMLImporter.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/logic/importer/fileformat/BibTeXMLImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/BibTeXMLImporter.java index 7465b5c3a8c..24293c6ec2e 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/BibTeXMLImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/BibTeXMLImporter.java @@ -11,6 +11,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Optional; import java.util.regex.Pattern; import javax.xml.bind.JAXBContext; @@ -27,6 +28,7 @@ import org.jabref.logic.importer.fileformat.bibtexml.Incollection; import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.Month; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.FieldFactory; import org.jabref.model.entry.field.StandardField; @@ -176,6 +178,9 @@ private void parse(T entryType, Map fields) { } else if (method.getName().equals("getNumber")) { putNumber(fields, (BigInteger) method.invoke(entryType)); continue; + } else if (method.getName().equals("getMonth")) { + putMonth(fields, Month.parse((String)method.invoke(entryType))); + continue; } else if (isMethodToIgnore(method.getName())) { continue; } else if (method.getName().startsWith("get")) { @@ -208,7 +213,11 @@ private void parseInbook(Inbook inbook, Map fields) { Object elementValue = element.getValue(); if (elementValue instanceof String) { String value = (String) elementValue; - putIfValueNotNull(fields, field, value); + if (StandardField.MONTH.equals(field)) { + putMonth(fields, Month.parse(value)); + } else { + putIfValueNotNull(fields, field, value); + } } else if (elementValue instanceof BigInteger) { BigInteger value = (BigInteger) elementValue; if (StandardField.NUMBER.equals(field)) { @@ -241,6 +250,12 @@ private void putNumber(Map fields, BigInteger number) { } } + private void putMonth(Map fields, Optional month) { + if (month.isPresent()) { + fields.put(StandardField.MONTH, month.get().getJabRefFormat()); + } + } + private void putIfValueNotNull(Map fields, Field field, String value) { if (value != null) { fields.put(field, value); From 82e669d16b1a4e4b3c1efb28d7daf4880498db8c Mon Sep 17 00:00:00 2001 From: Stanley F Date: Mon, 9 Sep 2019 16:11:01 +0200 Subject: [PATCH 7/8] unify month field formatting in programmatic tests --- .../java/org/jabref/logic/bibtex/BibEntryWriterTest.java | 2 +- .../java/org/jabref/logic/cleanup/CleanupWorkerTest.java | 2 +- .../jabref/logic/cleanup/ConvertToBibtexCleanupTest.java | 2 +- .../formatter/bibtexfields/NormalizeMonthFormatterTest.java | 2 +- src/test/java/org/jabref/model/entry/BibEntryTests.java | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/test/java/org/jabref/logic/bibtex/BibEntryWriterTest.java b/src/test/java/org/jabref/logic/bibtex/BibEntryWriterTest.java index 3c158a64d53..d8dd65831c0 100644 --- a/src/test/java/org/jabref/logic/bibtex/BibEntryWriterTest.java +++ b/src/test/java/org/jabref/logic/bibtex/BibEntryWriterTest.java @@ -358,7 +358,7 @@ public void monthFieldSpecialSyntax() throws IOException { // modify month field Set fields = entry.getFields(); assertTrue(fields.contains(StandardField.MONTH)); - assertEquals("#mar#", entry.getField(StandardField.MONTH).get()); + assertEquals("mar", entry.getField(StandardField.MONTH).get()); //write out bibtex string StringWriter stringWriter = new StringWriter(); diff --git a/src/test/java/org/jabref/logic/cleanup/CleanupWorkerTest.java b/src/test/java/org/jabref/logic/cleanup/CleanupWorkerTest.java index 009cce0cb2d..007a179adaa 100644 --- a/src/test/java/org/jabref/logic/cleanup/CleanupWorkerTest.java +++ b/src/test/java/org/jabref/logic/cleanup/CleanupWorkerTest.java @@ -183,7 +183,7 @@ void cleanupMonthChangesNumberToBibtex() { entry.setField(StandardField.MONTH, "01"); worker.cleanup(preset, entry); - assertEquals(Optional.of("#jan#"), entry.getField(StandardField.MONTH)); + assertEquals(Optional.of("jan"), entry.getField(StandardField.MONTH)); } @Test diff --git a/src/test/java/org/jabref/logic/cleanup/ConvertToBibtexCleanupTest.java b/src/test/java/org/jabref/logic/cleanup/ConvertToBibtexCleanupTest.java index 38259aaef2f..d8cdb70ee69 100644 --- a/src/test/java/org/jabref/logic/cleanup/ConvertToBibtexCleanupTest.java +++ b/src/test/java/org/jabref/logic/cleanup/ConvertToBibtexCleanupTest.java @@ -27,7 +27,7 @@ public void cleanupMovesDateToYearAndMonth() { assertEquals(Optional.empty(), entry.getField(StandardField.DATE)); assertEquals(Optional.of("2011"), entry.getField(StandardField.YEAR)); - assertEquals(Optional.of("#jan#"), entry.getField(StandardField.MONTH)); + assertEquals(Optional.of("jan"), entry.getField(StandardField.MONTH)); } @Test diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizeMonthFormatterTest.java b/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizeMonthFormatterTest.java index 31c3f935989..1d6ebd292c4 100644 --- a/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizeMonthFormatterTest.java +++ b/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizeMonthFormatterTest.java @@ -19,6 +19,6 @@ public void setUp() { @Test public void formatExample() { - assertEquals("#dec#", formatter.format(formatter.getExampleInput())); + assertEquals("dec", formatter.format(formatter.getExampleInput())); } } diff --git a/src/test/java/org/jabref/model/entry/BibEntryTests.java b/src/test/java/org/jabref/model/entry/BibEntryTests.java index a0e2ee64ad0..586d939a776 100644 --- a/src/test/java/org/jabref/model/entry/BibEntryTests.java +++ b/src/test/java/org/jabref/model/entry/BibEntryTests.java @@ -117,7 +117,7 @@ public void getFieldOrAliasDateWithYearNumericalMonthString() { @Test public void getFieldOrAliasDateWithYearAbbreviatedMonth() { emptyEntry.setField(StandardField.YEAR, "2003"); - emptyEntry.setField(StandardField.MONTH, "#mar#"); + emptyEntry.setField(StandardField.MONTH, "mar"); assertEquals(Optional.of("2003-03"), emptyEntry.getFieldOrAlias(StandardField.DATE)); } @@ -161,13 +161,13 @@ public void getFieldOrAliasMonthWithDateYYYYReturnsNull() { @Test public void getFieldOrAliasMonthWithDateYYYYMM() { emptyEntry.setField(StandardField.DATE, "2003-03"); - assertEquals(Optional.of("#mar#"), emptyEntry.getFieldOrAlias(StandardField.MONTH)); + assertEquals(Optional.of("mar"), emptyEntry.getFieldOrAlias(StandardField.MONTH)); } @Test public void getFieldOrAliasMonthWithDateYYYYMMDD() { emptyEntry.setField(StandardField.DATE, "2003-03-30"); - assertEquals(Optional.of("#mar#"), emptyEntry.getFieldOrAlias(StandardField.MONTH)); + assertEquals(Optional.of("mar"), emptyEntry.getFieldOrAlias(StandardField.MONTH)); } @Test From dff8170849042cb113aadeec915e0b816e08a73a Mon Sep 17 00:00:00 2001 From: Stanley F Date: Mon, 9 Sep 2019 16:24:04 +0200 Subject: [PATCH 8/8] fix BibTeXML exporter to comply with unified month format --- .../jabref/logic/exporter/BibTeXMLExporter.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/org/jabref/logic/exporter/BibTeXMLExporter.java b/src/main/java/org/jabref/logic/exporter/BibTeXMLExporter.java index 2c0100b5f12..1e5b6b310ca 100644 --- a/src/main/java/org/jabref/logic/exporter/BibTeXMLExporter.java +++ b/src/main/java/org/jabref/logic/exporter/BibTeXMLExporter.java @@ -10,6 +10,7 @@ import java.util.Locale; import java.util.Map; import java.util.Objects; +import java.util.Optional; import java.util.stream.Collectors; import javax.xml.bind.JAXBContext; @@ -40,6 +41,7 @@ import org.jabref.logic.util.StandardFileType; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.Month; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.EntryType; @@ -153,6 +155,13 @@ private void parseInbook(Inbook inbook, BibEntry bibEntry, Entry entry) { JAXBElement number = new JAXBElement<>(new QName(BIBTEXML_NAMESPACE_URI, "number"), BigInteger.class, new BigInteger(value)); inbook.getContent().add(number); + } else if (StandardField.MONTH.equals(key)) { + Optional month = bibEntry.getMonth(); + if (month.isPresent()) { + JAXBElement element = new JAXBElement<>(new QName(BIBTEXML_NAMESPACE_URI, key.getName()), + String.class, month.get().getFullName()); + inbook.getContent().add(element); + } } else { JAXBElement element = new JAXBElement<>(new QName(BIBTEXML_NAMESPACE_URI, key.getName()), String.class, value); @@ -205,6 +214,12 @@ private void parse(T entryType, BibEntry bibEntry, Entry entry) { LOGGER.warn("The value %s of the 'number' field is not an integer and thus is ignored for the export", value); } break; + } else if (StandardField.MONTH.equals(key)) { + Optional month = bibEntry.getMonth(); + if (month.isPresent()) { + method.invoke(entryType, month.get().getFullName()); + } + break; } else { method.invoke(entryType, value); break;