Skip to content

Refactor importDatabase in OvidImporter for better readability#14274

Merged
koppor merged 2 commits into
JabRef:mainfrom
merlinymy:refactor-ovid-importer
Nov 10, 2025
Merged

Refactor importDatabase in OvidImporter for better readability#14274
koppor merged 2 commits into
JabRef:mainfrom
merlinymy:refactor-ovid-importer

Conversation

@merlinymy

Copy link
Copy Markdown
Contributor

Closes #14132

Refactored the importDatabase() method in OvidImporter by extracting four private helper methods (parseField(), parseSource(), normalizeContributors(), and resolveEntryType()). This improves code readability and maintainability by reducing the method from 135 lines to 25 lines while preserving all existing functionality. All existing tests pass without modification.

Steps to test

Run the existing OvidImporter tests: ./gradlew :jablib:test --tests OvidImporterTest. All 236 tests should pass, confirming the refactoring maintains the original behavior.

Mandatory checks

  • I own the copyright of the code submitted and I license it under the MIT license
  • [/] I manually tested my changes in running JabRef (always required)
  • [/] I added JUnit tests for changes (if applicable)
  • [/] I added screenshots in the PR description (if change is visible to the user)
  • [/] I described the change in CHANGELOG.md in a way that is understandable for the average user (if change is visible to the user)
  • [/] I checked the user documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request updating file(s) in https://github.com/JabRef/user-documentation/tree/main/en.

@github-actions

github-actions Bot commented Nov 9, 2025

Copy link
Copy Markdown
Contributor

Hey @merlinymy!

Thank you for contributing to JabRef! Your help is truly appreciated ❤️.

We have automatic checks in place, based on which you will soon get automated feedback if any of them are failing. We also use TragBot with custom rules that scans your changes and provides some preliminary comments, before a maintainer takes a look. TragBot is still learning, and may not always be accurate. In the "Files changed" tab, you can go through its comments and just click on "Resolve conversation" if you are sure that it is incorrect, or comment on the conversation if you are doubtful.

Please re-check our contribution guide in case of any other doubts related to our contribution workflow.

@Siedlerchr Siedlerchr changed the title Refactor importDatabase for better readability Refactor importDatabase in OvidImporter for better readability Nov 9, 2025

@koppor koppor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Checked with RefactoringMiner. Looks good!

@koppor koppor added this pull request to the merge queue Nov 10, 2025
Merged via the queue into JabRef:main with commit 996b502 Nov 10, 2025
44 of 45 checks passed
Siedlerchr added a commit that referenced this pull request Nov 10, 2025
* main:
  Fix calling JBang command (#14282)
  .jbang scripts should not be included inside themselves (#14278)
  Fix typos (#14277)
  Refactor importDatabase for better readability (#14274)
  fix jbang (#14276)
  Feat: Add definition links for TeX Files (#14260)
  Update preventing module commits (#14273)
  Fix JabKitLuancher
  Rename packages in jabkit to start with org.jabref.toolkit to avoid split packages between jabkit and jabgui (#14052). (#14271)
  Add doi-to-bibtex to examples and JabKit (#14244)
merlinymy added a commit to merlinymy/jabref that referenced this pull request Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor long method importDatabase() in OvidImporter

3 participants