Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to extended enums for fields and entry types #5148

Merged
merged 22 commits into from
Aug 2, 2019
Merged

Conversation

tobiasdiez
Copy link
Member

@tobiasdiez tobiasdiez commented Jul 22, 2019

This is a huge refactor PR. I'm sorry for its size, but I couldn't break it down into smaller pieces. The changes are as follows:

  • Introduce extended enum Field for fields (e.g StandardField.AUTHOR instead of the string "author") and use this everywhere. Besides the name of the field, some basic and universal properties are stored (e.g. whether it is a numeric field)
  • Introduce the class BibField which enriches the Field by properties that depend on the entry (type) where this field is used. Right now this is only how important the field is (which should in the long term replace the required/optional dichometry.
  • Introduce extended enum EntryType for entry types (e.g. StandardEntryType.ARTICLE instead of the string "article") and use this everywhere.
  • Introduce the class BibEntryType that enriches an EntryType by properties that the user can configure (e.g. required fields).

I tried to not change any behavior, except the following things that I noticed while testing:

  • All fields are now properly sorted alphabetically (in the subgroups of required/optional fields) when the entry is written to the bib file.
  • Some importers used the field pubstatus instead of the standard BibTeX field pubstate.

  • Change in CHANGELOG.md described
  • Tests created for changes
  • Manually tested changed features in running JabRef
  • Screenshots added in PR description (for bigger UI changes)
  • Ensured that the git commit message is a good one
  • Check documentation status (Issue created for outdated help page at help.jabref.org?)

@tobiasdiez tobiasdiez added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Jul 25, 2019
@tobiasdiez tobiasdiez marked this pull request as ready for review July 25, 2019 20:26
@tobiasdiez
Copy link
Member Author

So this is finally ready for review. For some reason the Docbook5 test fails on travis but works for me locally. Could someone else please test this?

@tobiasdiez tobiasdiez changed the title [WIP] Move to extended enums for fields and entry types Move to extended enums for fields and entry types Jul 25, 2019
Copy link
Member

@LinusDietz LinusDietz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well... properly reviewing this PR will be quite impossible. I have skimmed the most important files and tested JabRef manually.

LGTM!

@tobiasdiez tobiasdiez merged commit 4b39b78 into master Aug 2, 2019
@davidemdot
Copy link
Member

Regarding DocBook5ExporterTest: #5168

I could not check this before 😅

Siedlerchr added a commit that referenced this pull request Aug 9, 2019
…rter

# By David Méndez (47) and others
# Via GitHub (5) and David Méndez (3)
* upstream/master: (57 commits)
  fix wrong package (#5181)
  Remove logging message for non-existing nested files
  Bump applicationinsights-core from 2.4.0 to 2.4.1 (#5171)
  Bump archunit-junit5-engine from 0.10.2 to 0.11.0 (#5157)
  Bump applicationinsights-logging-log4j2 from 2.4.0 to 2.4.1 (#5172)
  Bump tika-core from 1.21 to 1.22 (#5166)
  Fix fail on testPerformExportForSingleEntry from DocBook5ExporterTest (#5168)
  Add a check for nested files and improve the code to skip lines (DefaultTexParser)
  Add latest changes to latexintegration (#5170)
  LaTeX integration latest changes (#5167)
  Move to extended enums for fields and entry types (#5148)
  Bump archunit-junit5-api from 0.10.2 to 0.11.0 (#5158)
  Revert temporal change
  Fix all issues from reviews of #5137
  Bump com.simonharrer.modernizer from 1.6.0-1 to 1.8.0-1 (#5154)
  Bump checkstyle from 8.22 to 8.23 (#5153)
  Add a new JabRefIcons.LATEX_CITATIONS
  Change toString() methods
  Update DefaultTexParser for explaining when and why it skips the citation matching
  Update TexParserResult for avoiding 'orElse(null)'
  ...

# Conflicts:
#	src/main/java/org/jabref/logic/importer/fileformat/PdfContentImporter.java
#	src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterTest.java
Siedlerchr added a commit that referenced this pull request Aug 10, 2019
…ator

because natural order will require same types of the enum

Followup from  #5148
Siedlerchr added a commit that referenced this pull request Aug 13, 2019
…ator (#5184)

because natural order will require same types of the enum

Followup from  #5148
@stefan-kolb stefan-kolb deleted the fix4269 branch August 23, 2019 20:26
@koppor koppor mentioned this pull request Mar 12, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants