Fix reset for FilePreferences and InternalPreferences#15827
Conversation
Review Summary by QodoRefactor FilePreferences and InternalPreferences to use typed objects
WalkthroughsDescription• Convert FilePreferences to use Path objects instead of Strings • Refactor InternalPreferences to use UserHostInfo objects directly • Extract getUserHostInfo method to OS class for centralized user/host retrieval • Fix preferences reset and import functionality for FilePreferences and InternalPreferences • Simplify preferences initialization with default factory methods and setAll patterns Diagramflowchart LR
A["FilePreferences<br/>String mainFileDirectory"] -->|Convert to Path| B["FilePreferences<br/>Path mainFileDirectory"]
C["InternalPreferences<br/>String userAndHost"] -->|Convert to UserHostInfo| D["InternalPreferences<br/>UserHostInfo userHostInfo"]
E["OS class"] -->|Extract method| F["getUserHostInfo<br/>returns UserHostInfo"]
B -->|Bind to| D
F -->|Provides| D
G["Preferences Reset/Import"] -->|Use setAll| H["Consistent state restoration"]
File Changes1. jablib/src/main/java/org/jabref/logic/FilePreferences.java
|
Code Review by Qodo
1.
|
…ilePreferences-import
…ilePreferences-import
|
Your pull request conflicts with the target branch. Please merge with your code. For a step-by-step guide to resolve merge conflicts, see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line. |
| } | ||
|
|
||
| public FilePreferences withUserHostInfo(ReadOnlyObjectProperty<UserHostInfo> newUserHostInfo) { | ||
| this.userAndHost.bind(newUserHostInfo); |
There was a problem hiding this comment.
This could result in a already bind exception

Related issues and pull requests
Follow-up to #15522
PR Description
Fix import and resetting of FilePreferences
Fix import and resetting of InternalPreferences
Simplified handling of UserHostInfo in Preferences
Simplified handling of Paths in Preferences
(possible minor regression, if no path is save, standard path "/" is assumed)Reworked and reordered test artifact, to streamline test subject (b561af9)
Steps to test
Run Jabref
Open preferences
Reset
See Linked file preferences tab reset
AI usage
Assisted by Claude Code (model claude-sonnet-4-6, fixed, enhanced and partially reverted by Human Intelligence (me)
Checklist
CHANGELOG.mdin a way that can be understood by the average user (if change is visible to the user)