From 37caf18354e38a643d0886d3393e5a9e52d98532 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Thu, 1 Nov 2018 20:43:53 +0100 Subject: [PATCH 1/3] Change location of some fields in the entry editor - Journal/Year/Month in biblatex mode -> Deprecated (if filled) - DOI/URL: General -> Optional - Internal fields like ranking, read status and priority: Other -> General - Moreover, empty deprecated fields are no longer shown --- CHANGELOG.md | 5 ++ .../gui/entryeditor/DeprecatedFieldsTab.java | 6 +- .../logic/integrity/NoBibtexFieldChecker.java | 16 ++-- .../model/entry/BiblatexEntryTypes.java | 87 ++++++++----------- .../model/entry/InternalBibtexFields.java | 28 +++--- .../jabref/preferences/JabRefPreferences.java | 2 +- 6 files changed, 73 insertions(+), 71 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2119c71557..0f7f754e4ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,11 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# ## [Unreleased] ### Changed +- We changed the location of some fields in the entry editor (you might need to reset your preferences for these changes to come into effect) + - Journal/Year/Month in biblatex mode -> Deprecated (if filled) + - DOI/URL: General -> Optional + - Internal fields like ranking, read status and priority: Other -> General + - Moreover, empty deprecated fields are no longer shown - We updated the dialog for setting up general fields. - URL field formatting is updated. All whitespace chars, located at the beginning/ending of the url, are trimmed automatically - We changed the behavior of the field formatting dialog such that the `bibtexkey` is not changed when formatting all fields or all text fields. diff --git a/src/main/java/org/jabref/gui/entryeditor/DeprecatedFieldsTab.java b/src/main/java/org/jabref/gui/entryeditor/DeprecatedFieldsTab.java index 3b3c1c66438..2e372e7a42c 100644 --- a/src/main/java/org/jabref/gui/entryeditor/DeprecatedFieldsTab.java +++ b/src/main/java/org/jabref/gui/entryeditor/DeprecatedFieldsTab.java @@ -1,6 +1,7 @@ package org.jabref.gui.entryeditor; import java.util.Collection; +import java.util.stream.Collectors; import javax.swing.undo.UndoManager; @@ -25,6 +26,9 @@ public DeprecatedFieldsTab(BibDatabaseContext databaseContext, SuggestionProvide @Override protected Collection determineFieldsToShow(BibEntry entry, EntryType entryType) { - return entryType.getDeprecatedFields(); + return entryType.getDeprecatedFields() + .stream() + .filter(entry::hasField) + .collect(Collectors.toList()); } } diff --git a/src/main/java/org/jabref/logic/integrity/NoBibtexFieldChecker.java b/src/main/java/org/jabref/logic/integrity/NoBibtexFieldChecker.java index d2e9bfb09d5..cf634f19589 100644 --- a/src/main/java/org/jabref/logic/integrity/NoBibtexFieldChecker.java +++ b/src/main/java/org/jabref/logic/integrity/NoBibtexFieldChecker.java @@ -20,14 +20,14 @@ public class NoBibtexFieldChecker implements Checker { private List getAllBiblatexOnlyFields() { Set allBibtexFields = BibtexEntryTypes.ALL.stream().flatMap(type -> type.getAllFields().stream()).collect(Collectors.toSet()); return BiblatexEntryTypes.ALL.stream() - .flatMap(type -> type.getAllFields().stream()) - .filter(fieldName -> !allBibtexFields.contains(fieldName)) - // these fields are displayed by JabRef as default - .filter(fieldName -> !InternalBibtexFields.DEFAULT_GENERAL_FIELDS.contains(fieldName)) - .filter(fieldName -> !fieldName.equals(FieldName.ABSTRACT)) - .filter(fieldName -> !fieldName.equals(FieldName.REVIEW)) - .sorted() - .collect(Collectors.toList()); + .flatMap(type -> type.getAllFields().stream()) + .filter(fieldName -> !allBibtexFields.contains(fieldName)) + // these fields are displayed by JabRef as default + .filter(fieldName -> !InternalBibtexFields.getDefaultGeneralFields().contains(fieldName)) + .filter(fieldName -> !fieldName.equals(FieldName.ABSTRACT)) + .filter(fieldName -> !fieldName.equals(FieldName.REVIEW)) + .sorted() + .collect(Collectors.toList()); } @Override diff --git a/src/main/java/org/jabref/model/entry/BiblatexEntryTypes.java b/src/main/java/org/jabref/model/entry/BiblatexEntryTypes.java index a73f39fcf50..f78c20291d8 100644 --- a/src/main/java/org/jabref/model/entry/BiblatexEntryTypes.java +++ b/src/main/java/org/jabref/model/entry/BiblatexEntryTypes.java @@ -21,14 +21,12 @@ public class BiblatexEntryTypes { FieldName.EPRINT, FieldName.EPRINTCLASS, FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE))); { - addAllRequired(FieldName.AUTHOR, FieldName.TITLE, - FieldName.orFields(FieldName.JOURNAL, FieldName.JOURNALTITLE), - FieldName.orFields(FieldName.YEAR, FieldName.DATE)); + addAllRequired(FieldName.AUTHOR, FieldName.TITLE, FieldName.JOURNALTITLE, FieldName.DATE); addAllOptional(FieldName.TRANSLATOR, FieldName.ANNOTATOR, FieldName.COMMENTATOR, FieldName.SUBTITLE, FieldName.TITLEADDON, FieldName.EDITOR, FieldName.EDITORA, FieldName.EDITORB, FieldName.EDITORC, FieldName.JOURNALSUBTITLE, FieldName.ISSUETITLE, FieldName.ISSUESUBTITLE, FieldName.LANGUAGE, FieldName.ORIGLANGUAGE, FieldName.SERIES, FieldName.VOLUME, FieldName.NUMBER, FieldName.EID, - FieldName.ISSUE, FieldName.MONTH, FieldName.PAGES, FieldName.VERSION, FieldName.NOTE, + FieldName.ISSUE, FieldName.PAGES, FieldName.VERSION, FieldName.NOTE, FieldName.ISSN, FieldName.ADDENDUM, FieldName.PUBSTATE, FieldName.DOI, FieldName.EPRINT, FieldName.EPRINTCLASS, FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE); } @@ -53,7 +51,7 @@ public Set getPrimaryOptionalFields() { FieldName.EPRINTCLASS, FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE))); { - addAllRequired(FieldName.AUTHOR, FieldName.TITLE, FieldName.orFields(FieldName.YEAR, FieldName.DATE)); + addAllRequired(FieldName.AUTHOR, FieldName.TITLE, FieldName.DATE); addAllOptional(FieldName.EDITOR, FieldName.EDITORA, FieldName.EDITORB, FieldName.EDITORC, FieldName.TRANSLATOR, FieldName.ANNOTATOR, FieldName.COMMENTATOR, FieldName.INTRODUCTION, FieldName.FOREWORD, FieldName.AFTERWORD, FieldName.SUBTITLE, FieldName.TITLEADDON, @@ -84,7 +82,7 @@ public Set getPrimaryOptionalFields() { FieldName.EPRINTCLASS, FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE))); { - addAllRequired(FieldName.AUTHOR, FieldName.TITLE, FieldName.orFields(FieldName.YEAR, FieldName.DATE)); + addAllRequired(FieldName.AUTHOR, FieldName.TITLE, FieldName.DATE); addAllOptional(FieldName.EDITOR, FieldName.EDITORA, FieldName.EDITORB, FieldName.EDITORC, FieldName.TRANSLATOR, FieldName.ANNOTATOR, FieldName.COMMENTATOR, FieldName.INTRODUCTION, FieldName.FOREWORD, FieldName.AFTERWORD, FieldName.SUBTITLE, FieldName.TITLEADDON, @@ -115,8 +113,7 @@ public Set getPrimaryOptionalFields() { FieldName.EPRINTCLASS, FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE))); { - addAllRequired(FieldName.AUTHOR, FieldName.TITLE, FieldName.BOOKTITLE, - FieldName.orFields(FieldName.YEAR, FieldName.DATE)); + addAllRequired(FieldName.AUTHOR, FieldName.TITLE, FieldName.BOOKTITLE, FieldName.DATE); addAllOptional(FieldName.BOOKAUTHOR, FieldName.EDITOR, FieldName.EDITORA, FieldName.EDITORB, FieldName.EDITORC, FieldName.TRANSLATOR, FieldName.ANNOTATOR, FieldName.COMMENTATOR, FieldName.INTRODUCTION, FieldName.FOREWORD, FieldName.AFTERWORD, FieldName.SUBTITLE, @@ -195,8 +192,7 @@ public Set getPrimaryOptionalFields() { FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE))); { - addAllRequired(FieldName.orFields(FieldName.AUTHOR, FieldName.EDITOR), FieldName.TITLE, - FieldName.orFields(FieldName.YEAR, FieldName.DATE)); + addAllRequired(FieldName.orFields(FieldName.AUTHOR, FieldName.EDITOR), FieldName.TITLE, FieldName.DATE); addAllOptional(FieldName.SUBTITLE, FieldName.TITLEADDON, FieldName.LANGUAGE, FieldName.HOWPUBLISHED, FieldName.TYPE, FieldName.NOTE, FieldName.LOCATION, FieldName.CHAPTER, FieldName.PAGES, FieldName.PAGETOTAL, FieldName.ADDENDUM, FieldName.PUBSTATE, FieldName.DOI, FieldName.EPRINT, @@ -223,7 +219,7 @@ public Set getPrimaryOptionalFields() { FieldName.EPRINT, FieldName.EPRINTCLASS, FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE))); { - addAllRequired(FieldName.EDITOR, FieldName.TITLE, FieldName.orFields(FieldName.YEAR, FieldName.DATE)); + addAllRequired(FieldName.EDITOR, FieldName.TITLE, FieldName.DATE); addAllOptional(FieldName.EDITORA, FieldName.EDITORB, FieldName.EDITORC, FieldName.TRANSLATOR, FieldName.ANNOTATOR, FieldName.COMMENTATOR, FieldName.INTRODUCTION, FieldName.FOREWORD, FieldName.AFTERWORD, FieldName.SUBTITLE, FieldName.TITLEADDON, FieldName.MAINTITLE, @@ -254,7 +250,7 @@ public Set getPrimaryOptionalFields() { FieldName.EPRINTCLASS, FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE))); { - addAllRequired(FieldName.EDITOR, FieldName.TITLE, FieldName.orFields(FieldName.YEAR, FieldName.DATE)); + addAllRequired(FieldName.EDITOR, FieldName.TITLE, FieldName.DATE); addAllOptional(FieldName.EDITORA, FieldName.EDITORB, FieldName.EDITORC, FieldName.TRANSLATOR, FieldName.ANNOTATOR, FieldName.COMMENTATOR, FieldName.INTRODUCTION, FieldName.FOREWORD, FieldName.AFTERWORD, FieldName.SUBTITLE, FieldName.TITLEADDON, FieldName.LANGUAGE, @@ -285,8 +281,7 @@ public Set getPrimaryOptionalFields() { FieldName.EPRINTCLASS, FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE))); { - addAllRequired(FieldName.AUTHOR, FieldName.TITLE, FieldName.BOOKTITLE, - FieldName.orFields(FieldName.YEAR, FieldName.DATE)); + addAllRequired(FieldName.AUTHOR, FieldName.TITLE, FieldName.BOOKTITLE, FieldName.DATE); addAllOptional(FieldName.EDITOR, FieldName.EDITORA, FieldName.EDITORB, FieldName.EDITORC, FieldName.TRANSLATOR, FieldName.ANNOTATOR, FieldName.COMMENTATOR, FieldName.INTRODUCTION, FieldName.FOREWORD, FieldName.AFTERWORD, FieldName.SUBTITLE, FieldName.TITLEADDON, @@ -341,8 +336,7 @@ public Set getPrimaryOptionalFields() { FieldName.EPRINTCLASS, FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE))); { - addAllRequired(FieldName.orFields(FieldName.AUTHOR, FieldName.EDITOR), FieldName.TITLE, - FieldName.orFields(FieldName.YEAR, FieldName.DATE)); + addAllRequired(FieldName.orFields(FieldName.AUTHOR, FieldName.EDITOR), FieldName.TITLE, FieldName.DATE); addAllOptional(FieldName.SUBTITLE, FieldName.TITLEADDON, FieldName.LANGUAGE, FieldName.EDITION, FieldName.TYPE, FieldName.SERIES, FieldName.NUMBER, FieldName.VERSION, FieldName.NOTE, FieldName.ORGANIZATION, FieldName.PUBLISHER, FieldName.LOCATION, FieldName.ISBN, FieldName.CHAPTER, @@ -368,11 +362,10 @@ public Set getPrimaryOptionalFields() { FieldName.EPRINT, FieldName.EPRINTCLASS, FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE))); { - addAllRequired(FieldName.orFields(FieldName.AUTHOR, FieldName.EDITOR), FieldName.TITLE, - FieldName.orFields(FieldName.YEAR, FieldName.DATE)); + addAllRequired(FieldName.orFields(FieldName.AUTHOR, FieldName.EDITOR), FieldName.TITLE, FieldName.DATE); addAllOptional(FieldName.SUBTITLE, FieldName.TITLEADDON, FieldName.LANGUAGE, FieldName.HOWPUBLISHED, FieldName.TYPE, FieldName.VERSION, FieldName.NOTE, FieldName.ORGANIZATION, FieldName.LOCATION, - FieldName.MONTH, FieldName.ADDENDUM, FieldName.PUBSTATE, FieldName.DOI, FieldName.EPRINT, + FieldName.ADDENDUM, FieldName.PUBSTATE, FieldName.DOI, FieldName.EPRINT, FieldName.EPRINTCLASS, FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE); } @@ -393,10 +386,9 @@ public Set getPrimaryOptionalFields() { FieldName.SUBTITLE, FieldName.TITLEADDON, FieldName.NOTE, FieldName.ORGANIZATION, FieldName.URLDATE))); { - addAllRequired(FieldName.orFields(FieldName.AUTHOR, FieldName.EDITOR), FieldName.TITLE, - FieldName.orFields(FieldName.YEAR, FieldName.DATE), FieldName.URL); + addAllRequired(FieldName.orFields(FieldName.AUTHOR, FieldName.EDITOR), FieldName.TITLE, FieldName.DATE, FieldName.URL); addAllOptional(FieldName.SUBTITLE, FieldName.TITLEADDON, FieldName.LANGUAGE, FieldName.VERSION, - FieldName.NOTE, FieldName.ORGANIZATION, FieldName.MONTH, FieldName.ADDENDUM, FieldName.PUBSTATE, + FieldName.NOTE, FieldName.ORGANIZATION, FieldName.ADDENDUM, FieldName.PUBSTATE, FieldName.URLDATE); } @@ -418,10 +410,9 @@ public Set getPrimaryOptionalFields() { FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE))); { - addAllRequired(FieldName.AUTHOR, FieldName.TITLE, FieldName.NUMBER, - FieldName.orFields(FieldName.YEAR, FieldName.DATE)); + addAllRequired(FieldName.AUTHOR, FieldName.TITLE, FieldName.NUMBER, FieldName.DATE); addAllOptional(FieldName.HOLDER, FieldName.SUBTITLE, FieldName.TITLEADDON, FieldName.TYPE, - FieldName.VERSION, FieldName.LOCATION, FieldName.NOTE, FieldName.MONTH, FieldName.ADDENDUM, + FieldName.VERSION, FieldName.LOCATION, FieldName.NOTE, FieldName.ADDENDUM, FieldName.PUBSTATE, FieldName.DOI, FieldName.EPRINT, FieldName.EPRINTCLASS, FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE); } @@ -444,10 +435,10 @@ public Set getPrimaryOptionalFields() { FieldName.EPRINT, FieldName.EPRINTCLASS, FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE))); { - addAllRequired(FieldName.EDITOR, FieldName.TITLE, FieldName.orFields(FieldName.YEAR, FieldName.DATE)); + addAllRequired(FieldName.EDITOR, FieldName.TITLE, FieldName.DATE); addAllOptional(FieldName.EDITORA, FieldName.EDITORB, FieldName.EDITORC, FieldName.SUBTITLE, FieldName.ISSUETITLE, FieldName.ISSUESUBTITLE, FieldName.LANGUAGE, FieldName.SERIES, - FieldName.VOLUME, FieldName.NUMBER, FieldName.ISSUE, FieldName.MONTH, FieldName.NOTE, + FieldName.VOLUME, FieldName.NUMBER, FieldName.ISSUE, FieldName.NOTE, FieldName.ISSN, FieldName.ADDENDUM, FieldName.PUBSTATE, FieldName.DOI, FieldName.EPRINT, FieldName.EPRINTCLASS, FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE); } @@ -496,12 +487,12 @@ public Set getPrimaryOptionalFields() { FieldName.EPRINTCLASS, FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE))); { - addAllRequired(FieldName.TITLE, FieldName.orFields(FieldName.YEAR, FieldName.DATE)); + addAllRequired(FieldName.TITLE, FieldName.DATE); addAllOptional(FieldName.EDITOR, FieldName.SUBTITLE, FieldName.TITLEADDON, FieldName.MAINTITLE, FieldName.MAINSUBTITLE, FieldName.MAINTITLEADDON, FieldName.EVENTTITLE, FieldName.EVENTTITLEADDON, FieldName.EVENTDATE, FieldName.VENUE, FieldName.LANGUAGE, FieldName.VOLUME, FieldName.PART, FieldName.VOLUMES, FieldName.SERIES, FieldName.NUMBER, FieldName.NOTE, FieldName.ORGANIZATION, - FieldName.PUBLISHER, FieldName.LOCATION, FieldName.MONTH, FieldName.YEAR, FieldName.ISBN, + FieldName.PUBLISHER, FieldName.LOCATION, FieldName.ISBN, FieldName.CHAPTER, FieldName.PAGES, FieldName.PAGETOTAL, FieldName.ADDENDUM, FieldName.PUBSTATE, FieldName.DOI, FieldName.EPRINT, FieldName.EPRINTCLASS, FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE); @@ -527,11 +518,11 @@ public Set getPrimaryOptionalFields() { FieldName.EPRINTCLASS, FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE))); { - addAllRequired(FieldName.TITLE, FieldName.orFields(FieldName.YEAR, FieldName.DATE)); + addAllRequired(FieldName.TITLE, FieldName.DATE); addAllOptional(FieldName.EDITOR, FieldName.SUBTITLE, FieldName.TITLEADDON, FieldName.EVENTTITLE, FieldName.EVENTTITLEADDON, FieldName.EVENTDATE, FieldName.VENUE, FieldName.LANGUAGE, FieldName.VOLUMES, FieldName.SERIES, FieldName.NUMBER, FieldName.NOTE, FieldName.ORGANIZATION, - FieldName.PUBLISHER, FieldName.LOCATION, FieldName.MONTH, FieldName.ISBN, FieldName.PAGETOTAL, + FieldName.PUBLISHER, FieldName.LOCATION, FieldName.ISBN, FieldName.PAGETOTAL, FieldName.ADDENDUM, FieldName.PUBSTATE, FieldName.DOI, FieldName.EPRINT, FieldName.EPRINTCLASS, FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE); @@ -558,14 +549,13 @@ public Set getPrimaryOptionalFields() { FieldName.EPRINTCLASS, FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE))); { - addAllRequired(FieldName.AUTHOR, FieldName.TITLE, FieldName.BOOKTITLE, - FieldName.orFields(FieldName.YEAR, FieldName.DATE)); + addAllRequired(FieldName.AUTHOR, FieldName.TITLE, FieldName.BOOKTITLE, FieldName.DATE); addAllOptional(FieldName.EDITOR, FieldName.SUBTITLE, FieldName.TITLEADDON, FieldName.MAINTITLE, FieldName.MAINSUBTITLE, FieldName.MAINTITLEADDON, FieldName.BOOKSUBTITLE, FieldName.BOOKTITLEADDON, FieldName.EVENTTITLE, FieldName.EVENTTITLEADDON, FieldName.EVENTDATE, FieldName.VENUE, FieldName.LANGUAGE, FieldName.VOLUME, FieldName.PART, FieldName.VOLUMES, FieldName.SERIES, FieldName.NUMBER, FieldName.NOTE, FieldName.ORGANIZATION, FieldName.PUBLISHER, FieldName.LOCATION, - FieldName.MONTH, FieldName.ISBN, FieldName.CHAPTER, FieldName.PAGES, FieldName.ADDENDUM, + FieldName.ISBN, FieldName.CHAPTER, FieldName.PAGES, FieldName.ADDENDUM, FieldName.PUBSTATE, FieldName.DOI, FieldName.EPRINT, FieldName.EPRINTCLASS, FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE); } @@ -661,10 +651,9 @@ public Set getPrimaryOptionalFields() { FieldName.EPRINTCLASS, FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE))); { - addAllRequired(FieldName.AUTHOR, FieldName.TITLE, FieldName.TYPE, FieldName.INSTITUTION, - FieldName.orFields(FieldName.YEAR, FieldName.DATE)); + addAllRequired(FieldName.AUTHOR, FieldName.TITLE, FieldName.TYPE, FieldName.INSTITUTION, FieldName.DATE); addAllOptional(FieldName.SUBTITLE, FieldName.TITLEADDON, FieldName.LANGUAGE, FieldName.NUMBER, - FieldName.VERSION, FieldName.NOTE, FieldName.LOCATION, FieldName.MONTH, FieldName.ISRN, + FieldName.VERSION, FieldName.NOTE, FieldName.LOCATION, FieldName.ISRN, FieldName.CHAPTER, FieldName.PAGES, FieldName.PAGETOTAL, FieldName.ADDENDUM, FieldName.PUBSTATE, FieldName.DOI, FieldName.EPRINT, FieldName.EPRINTCLASS, FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE); @@ -701,10 +690,9 @@ public String getName() { FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE))); { - addAllRequired(FieldName.AUTHOR, FieldName.TITLE, FieldName.TYPE, FieldName.INSTITUTION, - FieldName.orFields(FieldName.YEAR, FieldName.DATE)); + addAllRequired(FieldName.AUTHOR, FieldName.TITLE, FieldName.TYPE, FieldName.INSTITUTION, FieldName.DATE); addAllOptional(FieldName.SUBTITLE, FieldName.TITLEADDON, FieldName.LANGUAGE, FieldName.NOTE, - FieldName.LOCATION, FieldName.MONTH, FieldName.ISBN, FieldName.CHAPTER, FieldName.PAGES, + FieldName.LOCATION, FieldName.ISBN, FieldName.CHAPTER, FieldName.PAGES, FieldName.PAGETOTAL, FieldName.ADDENDUM, FieldName.PUBSTATE, FieldName.DOI, FieldName.EPRINT, FieldName.EPRINTCLASS, FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE); } @@ -727,9 +715,9 @@ public Set getPrimaryOptionalFields() { FieldName.PUBSTATE, FieldName.URL, FieldName.URLDATE))); { - addAllRequired(FieldName.AUTHOR, FieldName.TITLE, FieldName.orFields(FieldName.YEAR, FieldName.DATE)); + addAllRequired(FieldName.AUTHOR, FieldName.TITLE, FieldName.DATE); addAllOptional(FieldName.SUBTITLE, FieldName.TITLEADDON, FieldName.LANGUAGE, FieldName.HOWPUBLISHED, - FieldName.NOTE, FieldName.LOCATION, FieldName.MONTH, FieldName.ADDENDUM, FieldName.PUBSTATE, + FieldName.NOTE, FieldName.LOCATION, FieldName.ADDENDUM, FieldName.PUBSTATE, FieldName.URL, FieldName.URLDATE); } @@ -803,10 +791,9 @@ public Set getPrimaryOptionalFields() { { // Treated as alias of "THESIS", except FieldName.TYPE field is optional - addAllRequired(FieldName.AUTHOR, FieldName.TITLE, FieldName.INSTITUTION, - FieldName.orFields(FieldName.YEAR, FieldName.DATE)); + addAllRequired(FieldName.AUTHOR, FieldName.TITLE, FieldName.INSTITUTION, FieldName.DATE); addAllOptional(FieldName.TYPE, FieldName.SUBTITLE, FieldName.TITLEADDON, FieldName.LANGUAGE, FieldName.NOTE, - FieldName.LOCATION, FieldName.MONTH, FieldName.ISBN, FieldName.CHAPTER, FieldName.PAGES, + FieldName.LOCATION, FieldName.ISBN, FieldName.CHAPTER, FieldName.PAGES, FieldName.PAGETOTAL, FieldName.ADDENDUM, FieldName.PUBSTATE, FieldName.DOI, FieldName.EPRINT, FieldName.EPRINTCLASS, FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE); } @@ -831,10 +818,9 @@ public Set getPrimaryOptionalFields() { { // Treated as alias of "THESIS", except FieldName.TYPE field is optional - addAllRequired(FieldName.AUTHOR, FieldName.TITLE, FieldName.INSTITUTION, - FieldName.orFields(FieldName.YEAR, FieldName.DATE)); + addAllRequired(FieldName.AUTHOR, FieldName.TITLE, FieldName.INSTITUTION, FieldName.DATE); addAllOptional(FieldName.TYPE, FieldName.SUBTITLE, FieldName.TITLEADDON, FieldName.LANGUAGE, FieldName.NOTE, - FieldName.LOCATION, FieldName.MONTH, FieldName.ISBN, FieldName.CHAPTER, FieldName.PAGES, + FieldName.LOCATION, FieldName.ISBN, FieldName.CHAPTER, FieldName.PAGES, FieldName.PAGETOTAL, FieldName.ADDENDUM, FieldName.PUBSTATE, FieldName.DOI, FieldName.EPRINT, FieldName.EPRINTCLASS, FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE); } @@ -859,10 +845,9 @@ public Set getPrimaryOptionalFields() { { // Treated as alias of "REPORT", except FieldName.TYPE field is optional - addAllRequired(FieldName.AUTHOR, FieldName.TITLE, FieldName.INSTITUTION, - FieldName.orFields(FieldName.YEAR, FieldName.DATE)); + addAllRequired(FieldName.AUTHOR, FieldName.TITLE, FieldName.INSTITUTION, FieldName.DATE); addAllOptional(FieldName.TYPE, FieldName.SUBTITLE, FieldName.TITLEADDON, FieldName.LANGUAGE, - FieldName.NUMBER, FieldName.VERSION, FieldName.NOTE, FieldName.LOCATION, FieldName.MONTH, + FieldName.NUMBER, FieldName.VERSION, FieldName.NOTE, FieldName.LOCATION, FieldName.ISRN, FieldName.CHAPTER, FieldName.PAGES, FieldName.PAGETOTAL, FieldName.ADDENDUM, FieldName.PUBSTATE, FieldName.DOI, FieldName.EPRINT, FieldName.EPRINTCLASS, FieldName.EPRINTTYPE, FieldName.URL, FieldName.URLDATE); diff --git a/src/main/java/org/jabref/model/entry/InternalBibtexFields.java b/src/main/java/org/jabref/model/entry/InternalBibtexFields.java index 5de79d360d6..463241b2c6d 100644 --- a/src/main/java/org/jabref/model/entry/InternalBibtexFields.java +++ b/src/main/java/org/jabref/model/entry/InternalBibtexFields.java @@ -28,14 +28,8 @@ * - add a additional properties functionality into the BibtexSingleField class */ public class InternalBibtexFields { - /** - * These are the fields JabRef always displays as default - * {@link org.jabref.preferences.JabRefPreferences#setLanguageDependentDefaultValues()} - * - * A user can change them. The change is currently stored in the preferences only and not explicitly exposed as separate preferences object - */ - public static final List DEFAULT_GENERAL_FIELDS = Arrays.asList( - FieldName.CROSSREF, FieldName.KEYWORDS, FieldName.FILE, FieldName.DOI, FieldName.URL, FieldName.GROUPS, FieldName.OWNER, FieldName.TIMESTAMP + private static final List DEFAULT_GENERAL_FIELDS = Arrays.asList( + FieldName.CROSSREF, FieldName.KEYWORDS, FieldName.FILE, FieldName.GROUPS, FieldName.OWNER, FieldName.TIMESTAMP ); // Lists of fields with special properties @@ -88,8 +82,10 @@ public class InternalBibtexFields { private static final List SPECIAL_FIELDS = Arrays.asList( SpecialField.PRINTED.getFieldName(), - SpecialField.PRIORITY.getFieldName(), SpecialField.QUALITY.getFieldName(), - SpecialField.RANKING.getFieldName(), SpecialField.READ_STATUS.getFieldName(), + SpecialField.PRIORITY.getFieldName(), + SpecialField.QUALITY.getFieldName(), + SpecialField.RANKING.getFieldName(), + SpecialField.READ_STATUS.getFieldName(), SpecialField.RELEVANCE.getFieldName() ); @@ -473,6 +469,18 @@ public static List getIEEETranBSTctlYesNoFields() { return YES_NO_FIELDS; } + /** + * These are the fields JabRef always displays as default {@link org.jabref.preferences.JabRefPreferences#setLanguageDependentDefaultValues()} + * + * A user can change them. The change is currently stored in the preferences only and not explicitly exposed as + * separate preferences object + */ + public static List getDefaultGeneralFields() { + List defaultGeneralFields = new ArrayList<>(DEFAULT_GENERAL_FIELDS); + defaultGeneralFields.addAll(SPECIAL_FIELDS); + return defaultGeneralFields; + } + /** * Insert a field into the internal list */ diff --git a/src/main/java/org/jabref/preferences/JabRefPreferences.java b/src/main/java/org/jabref/preferences/JabRefPreferences.java index eea8a2ee771..b02f35d5beb 100644 --- a/src/main/java/org/jabref/preferences/JabRefPreferences.java +++ b/src/main/java/org/jabref/preferences/JabRefPreferences.java @@ -1006,7 +1006,7 @@ public List getCustomTabFieldNames() { public void setLanguageDependentDefaultValues() { // Entry editor tab 0: defaults.put(CUSTOM_TAB_NAME + "_def0", Localization.lang("General")); - String fieldNames = InternalBibtexFields.DEFAULT_GENERAL_FIELDS.stream().collect(Collectors.joining(";")); + String fieldNames = InternalBibtexFields.getDefaultGeneralFields().stream().collect(Collectors.joining(";")); defaults.put(CUSTOM_TAB_FIELDS + "_def0", fieldNames); // Entry editor tab 1: From 916898dec5ada9f262a34778f2a5af993cbcf007 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Thu, 1 Nov 2018 21:07:30 +0100 Subject: [PATCH 2/3] Fix tests --- .../logic/integrity/NoBibtexFieldChecker.java | 9 ++- .../logic/integrity/IntegrityCheckTest.java | 58 +++++++++---------- .../integrity/NoBibTexFieldCheckerTest.java | 24 ++++---- 3 files changed, 45 insertions(+), 46 deletions(-) diff --git a/src/main/java/org/jabref/logic/integrity/NoBibtexFieldChecker.java b/src/main/java/org/jabref/logic/integrity/NoBibtexFieldChecker.java index cf634f19589..c5cf26b20c8 100644 --- a/src/main/java/org/jabref/logic/integrity/NoBibtexFieldChecker.java +++ b/src/main/java/org/jabref/logic/integrity/NoBibtexFieldChecker.java @@ -10,7 +10,6 @@ import org.jabref.model.entry.BiblatexEntryTypes; import org.jabref.model.entry.BibtexEntryTypes; import org.jabref.model.entry.FieldName; -import org.jabref.model.entry.InternalBibtexFields; /** * This checker checks whether the entry does not contain any field appearing only in biblatex (and not in BibTeX) @@ -23,9 +22,10 @@ private List getAllBiblatexOnlyFields() { .flatMap(type -> type.getAllFields().stream()) .filter(fieldName -> !allBibtexFields.contains(fieldName)) // these fields are displayed by JabRef as default - .filter(fieldName -> !InternalBibtexFields.getDefaultGeneralFields().contains(fieldName)) .filter(fieldName -> !fieldName.equals(FieldName.ABSTRACT)) .filter(fieldName -> !fieldName.equals(FieldName.REVIEW)) + .filter(fieldName -> !fieldName.equals(FieldName.DOI)) + .filter(fieldName -> !fieldName.equals(FieldName.URL)) .sorted() .collect(Collectors.toList()); } @@ -35,8 +35,7 @@ public List check(BibEntry entry) { // non-static initalization of ALL_BIBLATEX_ONLY_FIELDS as the user can customize the entry types during runtime final List allBiblatexOnlyFields = getAllBiblatexOnlyFields(); return entry.getFieldNames().stream() - .filter(name -> allBiblatexOnlyFields.contains(name)) - .map(name -> new IntegrityMessage(Localization.lang("biblatex field only"), entry, name)).collect(Collectors.toList()); + .filter(allBiblatexOnlyFields::contains) + .map(name -> new IntegrityMessage(Localization.lang("biblatex field only"), entry, name)).collect(Collectors.toList()); } - } diff --git a/src/test/java/org/jabref/logic/integrity/IntegrityCheckTest.java b/src/test/java/org/jabref/logic/integrity/IntegrityCheckTest.java index 10b75ae8a37..54a1d715e99 100644 --- a/src/test/java/org/jabref/logic/integrity/IntegrityCheckTest.java +++ b/src/test/java/org/jabref/logic/integrity/IntegrityCheckTest.java @@ -33,10 +33,10 @@ import static org.mockito.Mockito.mock; @ExtendWith(TempDirectory.class) -public class IntegrityCheckTest { +class IntegrityCheckTest { @Test - public void testEntryTypeChecks() { + void testEntryTypeChecks() { assertCorrect(withMode(createContext("title", "sometitle", "article"), BibDatabaseMode.BIBTEX)); assertWrong(withMode(createContext("title", "sometitle", "patent"), BibDatabaseMode.BIBTEX)); assertCorrect((withMode(createContext("title", "sometitle", "patent"), BibDatabaseMode.BIBLATEX))); @@ -44,7 +44,7 @@ public void testEntryTypeChecks() { } @Test - public void testUrlChecks() { + void testUrlChecks() { assertCorrect(createContext("url", "http://www.google.com")); assertCorrect(createContext("url", "file://c:/asdf/asdf")); assertCorrect(createContext("url", "http://scikit-learn.org/stable/modules/ensemble.html#random-forests")); @@ -55,7 +55,7 @@ public void testUrlChecks() { } @Test - public void testYearChecks() { + void testYearChecks() { assertCorrect(createContext("year", "2014")); assertCorrect(createContext("year", "1986")); assertCorrect(createContext("year", "around 1986")); @@ -74,7 +74,7 @@ public void testYearChecks() { } @Test - public void testEditionChecks() { + void testEditionChecks() { assertCorrect(withMode(createContext("edition", "Second"), BibDatabaseMode.BIBTEX)); assertCorrect(withMode(createContext("edition", "Third"), BibDatabaseMode.BIBTEX)); assertWrong(withMode(createContext("edition", "second"), BibDatabaseMode.BIBTEX)); @@ -89,7 +89,7 @@ public void testEditionChecks() { } @Test - public void testNoteChecks() { + void testNoteChecks() { assertCorrect(withMode(createContext("note", "Lorem ipsum"), BibDatabaseMode.BIBTEX)); assertCorrect(withMode(createContext("note", "Lorem ipsum? 10"), BibDatabaseMode.BIBTEX)); assertWrong(withMode(createContext("note", "lorem ipsum"), BibDatabaseMode.BIBTEX)); @@ -99,7 +99,7 @@ public void testNoteChecks() { } @Test - public void testHowpublishedChecks() { + void testHowpublishedChecks() { assertCorrect(withMode(createContext("howpublished", "Lorem ipsum"), BibDatabaseMode.BIBTEX)); assertCorrect(withMode(createContext("howpublished", "Lorem ipsum? 10"), BibDatabaseMode.BIBTEX)); assertWrong(withMode(createContext("howpublished", "lorem ipsum"), BibDatabaseMode.BIBTEX)); @@ -109,7 +109,7 @@ public void testHowpublishedChecks() { } @Test - public void testMonthChecks() { + void testMonthChecks() { assertCorrect(withMode(createContext("month", "#mar#"), BibDatabaseMode.BIBTEX)); assertCorrect(withMode(createContext("month", "#dec#"), BibDatabaseMode.BIBTEX)); assertWrong(withMode(createContext("month", "#bla#"), BibDatabaseMode.BIBTEX)); @@ -127,13 +127,13 @@ public void testMonthChecks() { } @Test - public void testJournaltitleChecks() { + void testJournaltitleChecks() { assertWrong(withMode(createContext("journaltitle", "A journal"), BibDatabaseMode.BIBLATEX)); assertWrong(withMode(createContext("journaltitle", "A journal"), BibDatabaseMode.BIBTEX)); } @Test - public void testBibtexkeyChecks() { + void testBibtexkeyChecks() { final BibDatabaseContext correctContext = createContext("bibtexkey", "Knuth2014"); correctContext.getDatabase().getEntries().get(0).setField("author", "Knuth"); correctContext.getDatabase().getEntries().get(0).setField("year", "2014"); @@ -146,7 +146,7 @@ public void testBibtexkeyChecks() { } @Test - public void testBracketChecks() { + void testBracketChecks() { assertCorrect(createContext("title", "x")); assertCorrect(createContext("title", "{x}")); assertCorrect(createContext("title", "{x}x{}x{{}}")); @@ -156,7 +156,7 @@ public void testBracketChecks() { } @Test - public void testAuthorNameChecks() { + void testAuthorNameChecks() { for (String field : InternalBibtexFields.getPersonNameFields()) { // getPersonNameFields returns fields that are available in biblatex only // if run without mode, the NoBibtexFieldChecker will complain that "afterword" is a biblatex only field @@ -173,7 +173,7 @@ public void testAuthorNameChecks() { } @Test - public void testTitleChecks() { + void testTitleChecks() { assertCorrect(withMode(createContext("title", "This is a title"), BibDatabaseMode.BIBTEX)); assertWrong(withMode(createContext("title", "This is a Title"), BibDatabaseMode.BIBTEX)); assertCorrect(withMode(createContext("title", "This is a {T}itle"), BibDatabaseMode.BIBTEX)); @@ -192,7 +192,7 @@ public void testTitleChecks() { } @Test - public void testAbbreviationChecks() { + void testAbbreviationChecks() { for (String field : Arrays.asList("booktitle", "journal")) { assertCorrect(createContext(field, "IEEE Software")); assertCorrect(createContext(field, "")); @@ -201,13 +201,13 @@ public void testAbbreviationChecks() { } @Test - public void testJournalIsKnownInAbbreviationList() { + void testJournalIsKnownInAbbreviationList() { assertCorrect(createContext("journal", "IEEE Software")); assertWrong(createContext("journal", "IEEE Whocares")); } @Test - public void testFileChecks() { + void testFileChecks() { MetaData metaData = mock(MetaData.class); Mockito.when(metaData.getDefaultFileDirectory()).thenReturn(Optional.of(".")); Mockito.when(metaData.getUserFileDirectory(any(String.class))).thenReturn(Optional.empty()); @@ -220,32 +220,32 @@ public void testFileChecks() { } @Test - public void fileCheckFindsFilesRelativeToBibFile(@TempDirectory.TempDir Path testFolder) throws IOException { + void fileCheckFindsFilesRelativeToBibFile(@TempDirectory.TempDir Path testFolder) throws IOException { Path bibFile = testFolder.resolve("lit.bib"); Files.createFile(bibFile); Path pdfFile = testFolder.resolve("file.pdf"); Files.createFile(pdfFile); BibDatabaseContext databaseContext = createContext("file", ":file.pdf:PDF"); - databaseContext.setDatabaseFile(bibFile.toFile()); + databaseContext.setDatabaseFile(bibFile); assertCorrect(databaseContext); } @Test - public void testTypeChecks() { + void testTypeChecks() { assertCorrect(createContext("pages", "11--15", "inproceedings")); assertWrong(createContext("pages", "11--15", "proceedings")); } @Test - public void testBooktitleChecks() { + void testBooktitleChecks() { assertCorrect(createContext("booktitle", "2014 Fourth International Conference on Digital Information and Communication Technology and it's Applications (DICTAP)", "proceedings")); assertWrong(createContext("booktitle", "Digital Information and Communication Technology and it's Applications (DICTAP), 2014 Fourth International Conference on", "proceedings")); } @Test - public void testPageNumbersChecks() { + void testPageNumbersChecks() { assertCorrect(createContext("pages", "1--2")); assertCorrect(createContext("pages", "12")); assertWrong(createContext("pages", "1-2")); @@ -260,7 +260,7 @@ public void testPageNumbersChecks() { } @Test - public void testBiblatexPageNumbersChecks() { + void testBiblatexPageNumbersChecks() { assertCorrect(withMode(createContext("pages", "1--2"), BibDatabaseMode.BIBLATEX)); assertCorrect(withMode(createContext("pages", "12"), BibDatabaseMode.BIBLATEX)); assertCorrect(withMode(createContext("pages", "1-2"), BibDatabaseMode.BIBLATEX)); // only diff to bibtex @@ -275,7 +275,7 @@ public void testBiblatexPageNumbersChecks() { } @Test - public void testBibStringChecks() { + void testBibStringChecks() { assertCorrect(createContext("title", "Not a single hash mark")); assertCorrect(createContext("month", "#jan#")); assertCorrect(createContext("author", "#einstein# and #newton#")); @@ -284,7 +284,7 @@ public void testBibStringChecks() { } @Test - public void testHTMLCharacterChecks() { + void testHTMLCharacterChecks() { assertCorrect(createContext("title", "Not a single {HTML} character")); assertCorrect(createContext("month", "#jan#")); assertCorrect(createContext("author", "A. Einstein and I. Newton")); @@ -295,7 +295,7 @@ public void testHTMLCharacterChecks() { } @Test - public void testISSNChecks() { + void testISSNChecks() { assertCorrect(createContext("issn", "0020-7217")); assertCorrect(createContext("issn", "1687-6180")); assertCorrect(createContext("issn", "2434-561x")); @@ -304,7 +304,7 @@ public void testISSNChecks() { } @Test - public void testISBNChecks() { + void testISBNChecks() { assertCorrect(createContext("isbn", "0-201-53082-1")); assertCorrect(createContext("isbn", "0-9752298-0-X")); assertCorrect(createContext("isbn", "978-0-306-40615-7")); @@ -314,7 +314,7 @@ public void testISBNChecks() { } @Test - public void testDOIChecks() { + void testDOIChecks() { assertCorrect(createContext("doi", "10.1023/A:1022883727209")); assertCorrect(createContext("doi", "10.17487/rfc1436")); assertCorrect(createContext("doi", "10.1002/(SICI)1097-4571(199205)43:4<284::AID-ASI3>3.0.CO;2-0")); @@ -322,7 +322,7 @@ public void testDOIChecks() { } @Test - public void testEntryIsUnchangedAfterChecks() { + void testEntryIsUnchangedAfterChecks() { BibEntry entry = new BibEntry(); // populate with all known fields @@ -349,7 +349,7 @@ public void testEntryIsUnchangedAfterChecks() { } @Test - public void testASCIIChecks() { + void testASCIIChecks() { assertCorrect(createContext("title", "Only ascii characters!'@12")); assertWrong(createContext("month", "Umlauts are nöt ällowed")); assertWrong(createContext("author", "Some unicode ⊕")); diff --git a/src/test/java/org/jabref/logic/integrity/NoBibTexFieldCheckerTest.java b/src/test/java/org/jabref/logic/integrity/NoBibTexFieldCheckerTest.java index 1ce9aae56a7..40295364ecc 100644 --- a/src/test/java/org/jabref/logic/integrity/NoBibTexFieldCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/NoBibTexFieldCheckerTest.java @@ -9,26 +9,26 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -public class NoBibTexFieldCheckerTest { +class NoBibTexFieldCheckerTest { private final NoBibtexFieldChecker checker = new NoBibtexFieldChecker(); @Test - public void abstractIsNotRecognizedAsBiblatexOnlyField() { + void abstractIsNotRecognizedAsBiblatexOnlyField() { BibEntry entry = new BibEntry(); entry.setField("abstract", "test"); assertEquals(Collections.emptyList(), checker.check(entry)); } @Test - public void addressIsNotRecognizedAsBiblatexOnlyField() { + void addressIsNotRecognizedAsBiblatexOnlyField() { BibEntry entry = new BibEntry(); entry.setField("address", "test"); assertEquals(Collections.emptyList(), checker.check(entry)); } @Test - public void afterwordIsRecognizedAsBiblatexOnlyField() { + void afterwordIsRecognizedAsBiblatexOnlyField() { BibEntry entry = new BibEntry(); entry.setField("afterword", "test"); IntegrityMessage message = new IntegrityMessage("biblatex field only", entry, "afterword"); @@ -37,35 +37,35 @@ public void afterwordIsRecognizedAsBiblatexOnlyField() { } @Test - public void arbitraryNonBiblatexFieldIsNotRecognizedAsBiblatexOnlyField() { + void arbitraryNonBiblatexFieldIsNotRecognizedAsBiblatexOnlyField() { BibEntry entry = new BibEntry(); entry.setField("fieldNameNotDefinedInThebiblatexManual", "test"); assertEquals(Collections.emptyList(), checker.check(entry)); } @Test - public void commentIsNotRecognizedAsBiblatexOnlyField() { + void commentIsNotRecognizedAsBiblatexOnlyField() { BibEntry entry = new BibEntry(); entry.setField("comment", "test"); assertEquals(Collections.emptyList(), checker.check(entry)); } @Test - public void instituationIsNotRecognizedAsBiblatexOnlyField() { + void instituationIsNotRecognizedAsBiblatexOnlyField() { BibEntry entry = new BibEntry(); entry.setField("institution", "test"); assertEquals(Collections.emptyList(), checker.check(entry)); } @Test - public void journalIsNotRecognizedAsBiblatexOnlyField() { + void journalIsNotRecognizedAsBiblatexOnlyField() { BibEntry entry = new BibEntry(); entry.setField("journal", "test"); assertEquals(Collections.emptyList(), checker.check(entry)); } @Test - public void journaltitleIsRecognizedAsBiblatexOnlyField() { + void journaltitleIsRecognizedAsBiblatexOnlyField() { BibEntry entry = new BibEntry(); entry.setField("journaltitle", "test"); IntegrityMessage message = new IntegrityMessage("biblatex field only", entry, "journaltitle"); @@ -74,14 +74,14 @@ public void journaltitleIsRecognizedAsBiblatexOnlyField() { } @Test - public void keywordsNotRecognizedAsBiblatexOnlyField() { + void keywordsNotRecognizedAsBiblatexOnlyField() { BibEntry entry = new BibEntry(); entry.setField("keywords", "test"); assertEquals(Collections.emptyList(), checker.check(entry)); } @Test - public void locationIsRecognizedAsBiblatexOnlyField() { + void locationIsRecognizedAsBiblatexOnlyField() { BibEntry entry = new BibEntry(); entry.setField("location", "test"); IntegrityMessage message = new IntegrityMessage("biblatex field only", entry, "location"); @@ -90,7 +90,7 @@ public void locationIsRecognizedAsBiblatexOnlyField() { } @Test - public void reviewIsNotRecognizedAsBiblatexOnlyField() { + void reviewIsNotRecognizedAsBiblatexOnlyField() { BibEntry entry = new BibEntry(); entry.setField("review", "test"); assertEquals(Collections.emptyList(), checker.check(entry)); From 9a60f6f694b0086b21760c74266f677982b201b0 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Fri, 16 Nov 2018 19:37:25 +0100 Subject: [PATCH 3/3] Change Review to Comment field --- .../java/org/jabref/logic/integrity/NoBibtexFieldChecker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/logic/integrity/NoBibtexFieldChecker.java b/src/main/java/org/jabref/logic/integrity/NoBibtexFieldChecker.java index c5cf26b20c8..cb1eaef67df 100644 --- a/src/main/java/org/jabref/logic/integrity/NoBibtexFieldChecker.java +++ b/src/main/java/org/jabref/logic/integrity/NoBibtexFieldChecker.java @@ -23,7 +23,7 @@ private List getAllBiblatexOnlyFields() { .filter(fieldName -> !allBibtexFields.contains(fieldName)) // these fields are displayed by JabRef as default .filter(fieldName -> !fieldName.equals(FieldName.ABSTRACT)) - .filter(fieldName -> !fieldName.equals(FieldName.REVIEW)) + .filter(fieldName -> !fieldName.equals(FieldName.COMMENT)) .filter(fieldName -> !fieldName.equals(FieldName.DOI)) .filter(fieldName -> !fieldName.equals(FieldName.URL)) .sorted()