Skip to content

Reset and Import for abbreviation prefs and small fixes#15503

Merged
calixtus merged 3 commits into
mainfrom
journal-prefs-reset
Apr 7, 2026
Merged

Reset and Import for abbreviation prefs and small fixes#15503
calixtus merged 3 commits into
mainfrom
journal-prefs-reset

Conversation

@calixtus

@calixtus calixtus commented Apr 6, 2026

Copy link
Copy Markdown
Member

Related issues and pull requests

Follow-up #15395

PR Description

  • Fixed import and reset for JournalAbbreviationPreferences
  • Fixed issue with FJournal field not set in preferences dialog
  • Fixed proxy password not read from keyring

Steps to test

Open File > Preferences
Clear or import preference

Checklist

  • 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 added a screenshot in the PR description showing a library with a single entry with me as author and as title the issue number
  • [.] I described the change in CHANGELOG.md in a way that can be understood by the average user (if change is visible to the user)
  • [.] I checked the user documentation for up to dateness and submitted a pull request to our user documentation repository

@calixtus calixtus added status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers dev: code-quality Issues related to code or architecture decisions component: preferences labels Apr 6, 2026
@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Fix import and reset for JournalAbbreviationPreferences
🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Fixed import and reset functionality for JournalAbbreviationPreferences
• Added default constructor and getDefault() method to JournalAbbreviationPreferences
• Implemented setAll() method for proper preference synchronization
• Fixed FJournal field not being restored when loading preferences
• Removed hardcoded default values from JabRefCliPreferences initialization
Diagram
flowchart LR
  A["JournalAbbreviationPreferences"] -->|"add default constructor"| B["getDefault()"]
  A -->|"add setAll()"| C["Synchronize preferences"]
  D["JabRefCliPreferences"] -->|"use getDefault()"| B
  D -->|"call setAll()"| C
  D -->|"clear()"| E["Reset to defaults"]
  D -->|"importPreferences()"| F["Load from backing store"]
  G["JournalAbbreviationsTabViewModel"] -->|"setValues()"| H["Restore FJournal field"]
Loading

Grey Divider

File Changes

1. jabgui/src/main/java/org/jabref/gui/preferences/journals/JournalAbbreviationsTabViewModel.java 🐞 Bug fix +3/-1

Initialize FJournal field from preferences

• Added initialization of useFJournal property in setValues() method
• Changed unused parameter to underscore in onSuccess lambda

jabgui/src/main/java/org/jabref/gui/preferences/journals/JournalAbbreviationsTabViewModel.java


2. jablib/src/main/java/org/jabref/logic/journals/JournalAbbreviationPreferences.java ✨ Enhancement +16/-0

Add default constructor and synchronization methods

• Added private no-argument constructor with default values
• Added setAll() method to synchronize preferences from another instance
• Added getDefault() static method to provide default preferences

jablib/src/main/java/org/jabref/logic/journals/JournalAbbreviationPreferences.java


3. jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java 🐞 Bug fix +14/-11

Fix journal preferences import, reset, and initialization

• Removed hardcoded default values for EXTERNAL_JOURNAL_LISTS and USE_AMS_FJOURNAL
• Refactored getJournalAbbreviationPreferences() to use new
 getJournalAbbreviationPreferencesFromBackingStore() method
• Added getJournalAbbreviationPreferencesFromBackingStore() helper method with fallback defaults
• Fixed clear() method to reset JournalAbbreviationPreferences to defaults
• Fixed importPreferences() method to properly load journal preferences from backing store
• Reorganized code with region markers for better structure

jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java


Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0)   📘 Rule violations (1)   📎 Requirement gaps (0)   🎨 UX Issues (0)
📘\ ⚙ Maintainability (1)

Grey Divider


Remediation recommended

1. Trivial constructor argument comments 📘
Description
The new JournalAbbreviationPreferences() constructor adds inline comments that only restate
argument names, reducing signal-to-noise. Comments should explain intent/rationale instead of
paraphrasing code.
Code

jablib/src/main/java/org/jabref/logic/journals/JournalAbbreviationPreferences.java[R21-25]

+    private JournalAbbreviationPreferences() {
+        this(
+                List.of(), // externalJournalLists
+                true       // useFJournalField
+        );
Evidence
PR Compliance ID 7 requires that new comments explain the “why” rather than restating code. The
added comments // externalJournalLists and // useFJournalField merely label the already-obvious
arguments.

AGENTS.md
jablib/src/main/java/org/jabref/logic/journals/JournalAbbreviationPreferences.java[21-25]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The private default constructor adds comments that restate argument names (trivial comments).
## Issue Context
Project guidance requires comments to explain rationale/intent (“why”), not paraphrase code.
## Fix Focus Areas
- jablib/src/main/java/org/jabref/logic/journals/JournalAbbreviationPreferences.java[21-25]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Advisory comments

2. Whitespace-only line added📘
Description
A whitespace-only blank line was added, introducing unnecessary formatting churn. This makes diffs
noisier without functional benefit.
Code

jabgui/src/main/java/org/jabref/gui/preferences/journals/JournalAbbreviationsTabViewModel.java[113]

+        
Evidence
PR Compliance ID 3 requires avoiding unrelated formatting changes. The added blank line at
setValues() contains whitespace only and does not contribute to the functional change.

AGENTS.md
jabgui/src/main/java/org/jabref/gui/preferences/journals/JournalAbbreviationsTabViewModel.java[113-113]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A whitespace-only blank line was introduced in `setValues()`, creating unnecessary formatting churn.
## Issue Context
The compliance checklist asks to keep diffs minimal and avoid unrelated reformatting.
## Fix Focus Areas
- jabgui/src/main/java/org/jabref/gui/preferences/journals/JournalAbbreviationsTabViewModel.java[113-113]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@calixtus calixtus changed the title Reset and Import for abbreviation prefs Reset and Import for abbreviation prefs and small fixes Apr 6, 2026
@calixtus calixtus enabled auto-merge April 7, 2026 06:05
@calixtus calixtus added this pull request to the merge queue Apr 7, 2026
@github-actions github-actions Bot added the status: to-be-merged PRs which are accepted and should go into the merge-queue. label Apr 7, 2026
Merged via the queue into main with commit 4995a15 Apr 7, 2026
74 of 76 checks passed
@calixtus calixtus deleted the journal-prefs-reset branch April 7, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: preferences dev: code-quality Issues related to code or architecture decisions status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers status: to-be-merged PRs which are accepted and should go into the merge-queue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants