Repository navigation
Fix author and editor name export in MODS format - #17936
Conversation
|
Hey @USC-dot! 👋 Thank you for contributing to JabRef! We have automated checks in place, based on which you will soon get feedback if any of them are failing. We also use Qodo for review assistance. It will update your pull request description with a review help and offer suggestions to improve the pull request. After all automated checks pass, a maintainer will also review your contribution. Once that happens, you can go through their comments in the "Files changed" tab and act on them, or reply to the conversation if you have further inputs. You can read about the whole pull request process in our contribution guide. Please ensure that your pull request is in line with our AI Usage Policy and make necessary disclosures. |
PR Summary by QodoPreserve author names and export editors in MODS
AI Description
Merge Risk
|
Code Review by Qodo
1. Editors with protected names split on import
|
|
Thanks for the work so far, I weill take anothe rlook |
|
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin port-17936-to-black-forest
git worktree add --checkout .worktree/port-17936-to-black-forest port-17936-to-black-forest
cd .worktree/port-17936-to-black-forest
git reset --hard HEAD^
git cherry-pick -x b5a8d8f4a404e1e55da3ef98cb2dbef4149f0314 |
* main: (35 commits) Fix author and editor name export in MODS format (JabRef#17936) Fix LaTeX conversion in exported PDF metadata (JabRef#17810) Fix preferences menu text (JabRef#17966) Skip forced full-text index merges on shutdown (JabRef#17961) Fix wrong bibo namespace in RDF export (JabRef#17842) New Crowdin updates (JabRef#17956) chore(deps): update dependency com.konghq:unirest-modules-gson to v4.12.4 (JabRef#17955) Let Renovate update JavaFX in the jabsrv launcher (JabRef#17954) chore(deps): update dependency com.konghq:unirest-modules-gson to v4.12.3 (JabRef#17953) Import the RIS serial number of books and chapters as ISBN (JabRef#17891) Share nested LaTeX conversion with Writer (JabRef#17921) Render BST preview italics and bold as text, not math letters (JabRef#17902) Chore(deps): Bump com.konghq:unirest-java-bom from 4.11.11 to 4.12.0 in /versions (JabRef#17951) Inject NativeDesktop into its callers and remove the deprecated static helpers (JabRef#17947) New Crowdin updates (JabRef#17945) Chore(deps): Bump org.graalvm.sdk:nativeimage from 25.5.5.0.3 to 25.6.5.1 in /versions (JabRef#17944) Chore(deps): Bump com.googlecode.plist:dd-plist from 1.30 to 1.31 in /versions (JabRef#17943) Chore(deps): Bump JetBrains/junie-github-action from 1.10.1 to 1.10.2 (JabRef#17942) Chore(deps): Bump softprops/action-gh-release from 3.0.3 to 3.0.4 (JabRef#17941) Chore(deps): Bump anthropics/claude-code-action from 1.0.286 to 1.0.289 (JabRef#17940) ...
* main: (58 commits) Keep organization authors containing "and" intact in RIS export. (JabRef#17876) Fix author and editor name export in MODS format (JabRef#17936) Fix LaTeX conversion in exported PDF metadata (JabRef#17810) Fix preferences menu text (JabRef#17966) Skip forced full-text index merges on shutdown (JabRef#17961) Fix wrong bibo namespace in RDF export (JabRef#17842) New Crowdin updates (JabRef#17956) chore(deps): update dependency com.konghq:unirest-modules-gson to v4.12.4 (JabRef#17955) Let Renovate update JavaFX in the jabsrv launcher (JabRef#17954) chore(deps): update dependency com.konghq:unirest-modules-gson to v4.12.3 (JabRef#17953) Import the RIS serial number of books and chapters as ISBN (JabRef#17891) Share nested LaTeX conversion with Writer (JabRef#17921) Render BST preview italics and bold as text, not math letters (JabRef#17902) Chore(deps): Bump com.konghq:unirest-java-bom from 4.11.11 to 4.12.0 in /versions (JabRef#17951) Inject NativeDesktop into its callers and remove the deprecated static helpers (JabRef#17947) New Crowdin updates (JabRef#17945) Chore(deps): Bump org.graalvm.sdk:nativeimage from 25.5.5.0.3 to 25.6.5.1 in /versions (JabRef#17944) Chore(deps): Bump com.googlecode.plist:dd-plist from 1.30 to 1.31 in /versions (JabRef#17943) Chore(deps): Bump JetBrains/junie-github-action from 1.10.1 to 1.10.2 (JabRef#17942) Chore(deps): Bump softprops/action-gh-release from 3.0.3 to 3.0.4 (JabRef#17941) ...
Summary
MODS export was mangling author names that contained "and", since it split them manually on the string. I swapped that out for AuthorList.parse(), which JabRef already has. While I was in there, I also added editors to the export and used the MARC role codes (aut / edt) so the roles come out right in the XML. Added regression tests, including the case from #17898.
Steps to test
Related issues and pull requests
Closes #17898
AI usage
Tool: ChatGPT (GPT-6.2)
AI assistance included generating implementation code, regression
tests, troubleshooting build errors,reviewing code and documentation assistance.
AI Influence Level: AIL4 (provisional assessment).
AI CHECKLIST.md walkthrough
Code checklist
1. Code self-review
Nullability and control flow
== null/!= nullchecks — JSpecify annotations (@NullMarked,@Nullable,@NonNull) used instead.Objects.requireNonNull(...)— nullability expressed via JSpecify annotations.@NullMarked(org.jspecify.annotations.NullMarked).@NullMarked(org.jspecify.annotations.NullMarked).Optionalconsumed withifPresent/ifPresentOrElse/map/orElseThrow— neverorElse(unusedValue)nor anisPresent()+get()block.StringUtil.isBlank(...)used instead ofs == null || s.isBlank().Exceptions
catch (Exception e)— only specific exceptions are caught.throw new RuntimeException(...)/IllegalStateException(...)— these tear down the whole application.LOGGER.info("...", e)), not concatenated into the message string.Style and idioms
BibEntryobjects built with withers (withField, notsetField).List.of()/Map.of()/Set.of(),Path.of(),SequencedCollection/SequencedSet, text blocks.Pattern.compile(...)constant, notString.matches(...).org.jabref.logic.util.BackgroundTask, notnew Thread().///) uses Markdown syntax, not JavaDoc inline tags:`code`instead of{@code},[ClassName]instead of{@link}.User-facing text
Localization.langin Java,%prefix in FXML).!; labels do not end with:."...: %0"), not string concatenation.Security
text/htmlresponse — including exception/error messages, not just the success body (XSS).Tests
org.jabref.model/org.jabref.logichave added or updated tests.assertEquals), use plain JUnit asserts (not AssertJ), have no@DisplayName, do not catch exceptions (let them propagate so JUnit reports setup/teardown failures directly), and use@TempDirinstead of manual temp directories.2. Verification commands
Run in this order — cheapest first. Each must pass.
./gradlew :jablib:check(or./gradlew checkfor all modules)../gradlew checkstyleMain checkstyleTest checkstyleJmh../gradlew modernizer../gradlew --no-configuration-cache :rewriteDryRunreports no changes (run./gradlew rewriteRunto fix)../gradlew javadoc.npx markdownlint-cli2 "docs/**/*.md" "*.md"(only if Markdown changed).npm ci && npm run textlintreports no misspellings (only if Markdown changed).rewriteRun:docker run -v $(pwd):/github/workspace ghcr.io/leventebajczi/intellij-format:master "*.java" "" ".idea/codeStyles/Project.xml".Verification observations
3. Documentation
CHANGELOG.mdentry added if the change is visible to the user (end-user wording, no extra blank lines, sorted in next to existing entries about the same component/feature). Link the issue if one exists; link the PR only when no issue exists. UseTODOas the placeholder when neither is known yet — never a fake number. No entry for fixes to changes that were themselves introduced after the last release (feature only in## [Unreleased]) — update the existing unreleased entry instead if needed.TODO(nocloses/fixesfor merely-similar issues).docs/requirements/<area>.mdif the change is a new feature or significant bug fix (skip for refactors, minor fixes, and internal changes).docs/updated if behavior or architecture changed.4. Pull request
.github/PULL_REQUEST_TEMPLATE.md, every section filled.[x],[ ], or[/].gh pr create --body-file <file>(not--body).CHANGELOG.mdused aTODOplaceholder (no issue confidently identified yet — an existing issue link always stays), the PR was opened as draft, the placeholder was replaced with the real PR-number link after PR creation, committed and pushed, and only then was the PR marked ready for review. If an issue is identified or created later, the link is switched to the issue.Checklist
CHANGELOG.mddescribing the change from the user's point of view (if the change is visible to the user)