Use .bib extension for backup files - #16675
Conversation
Backups in the user data directory were named .bak, so a user who locates them could not open them in JabRef directly. Backups written earlier with .bak are still found, because lookups match on the file name prefix only. Refs #11454 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012z49ZUMghSxLgLgJtQpo4g
PR Summary by QodoWrite automatic backups with the .bib extension
AI Description
Diagram
High-Level Assessment
Files changed (8)
|
Code Review by Qodo
1.
|
The fallback lookup next to the library derived a single sidecar name from the backup extension, so .bak sidecars written by older versions were no longer found. All extensions of the backup type are tried now, and the newest existing sidecar wins. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012z49ZUMghSxLgLgJtQpo4g
…tern When the backup directory cannot be created, the backup was written as library.bib.bak next to the library. It now uses the same <prefix>--<library>--<timestamp>.bib name as in the backup directory, so it opens in JabRef and rotates like the others. Lookups search the same location; a .bak sidecar of older versions is still found when no other backup exists. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012z49ZUMghSxLgLgJtQpo4g
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012z49ZUMghSxLgLgJtQpo4g
|
Your pull request conflicts with the target branch. Please merge |
Summary
🤖 JabRef's automatic backups in the user data directory carried the
.bakextension, so a user who locates them cannot open them in JabRef directly (see this comment). Backups are now written with the.bibextension; backups written earlier with.bakare still found and rotated as before. First of several PRs for #11454 — the issue stays open.jabref-contrib-policy:4.2:reviewed:okAnalogies: Like honey, this change is small and keeps: nothing is lost, only the label changes. Like chocolate, it should go down easily: one constant. Like the moon, the backups are the same as before, just showing a more familiar face.
Steps to test
<user data dir>/org.jabref/jabref/backups).<prefix>--<library>.bib--<date>--<time>.biband opens via File → Open library..bakbackups in that directory are still offered by the "Backup found" dialog when they are newer than the library."Backup found" dialog naming the
.bibbackup (top) and the backup file opened as a library (bottom):Related issues and pull requests
Refs #11454 (not closed — first step of the checklist in #11454 (comment))
User documentation: JabRef/user-documentation#661
AI usage
Claude Code (model claude-fable-5), AIL3 — AI-generated under human direction, reviewed by the contributor.
AI CHECKLIST.md walkthrough
1. Code self-review
Nullability and control flow
Not applicable: no control flow changed (one constant plus comments).
== null/!= nullchecks — JSpecify annotations (@NullMarked,@Nullable,@NonNull) used instead.Objects.requireNonNull(...)— nullability expressed via JSpecify annotations.@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
Not applicable: no exception handling touched.
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
Not applicable: no 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
./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).rewriteRun:docker run -v $(pwd):/github/workspace ghcr.io/leventebajczi/intellij-format:master "*.java" "" ".idea/codeStyles/Project.xml".3. Documentation
CHANGELOG.mdentry added if the change is visible to the user (end-user wording, no extra blank lines). 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.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), it was replaced with the real PR-number link after PR creation, then committed and pushed. 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)🤖 Generated with Claude Code