Fix reset and import for Library, DOI, Owner, Timestamp and Remote Preferences#15514
Conversation
Review Summary by QodoFix reset and import for Library, DOI, Owner, Timestamp and Remote Preferences with consistent naming
WalkthroughsDescription• Rename preference methods to follow consistent naming conventions - isUseCustom() → shouldUseCustom() for DOIPreferences - isUseOwner() → shouldUseOwner() for OwnerPreferences - isAddImportedEntriesEnabled() → shouldAddImportedEntries() for LibraryPreferences - useRemoteServer() → shouldEnableRemoteServer() for RemotePreferences • Add getDefault() and setAll() methods to preference classes - Enables proper reset and import functionality for preferences - Implemented for LibraryPreferences, DOIPreferences, OwnerPreferences, TimestampPreferences, and RemotePreferences • Refactor RemotePreferences with clearer naming and parameter reordering - Rename port → remoteServerPort, httpPort → httpServerPort - Rename useRemoteServer → enableRemoteServer, enableLanguageServer → shouldEnableLanguageServer() - Reorder constructor parameters for consistency • Consolidate timestamp cleanup classes into single generic class - Merge TimeStampToCreationDate and TimeStampToModificationDate into TimeStampToDateField - Reduces code duplication and improves maintainability • Reorganize preference constants in JabRefCliPreferences with region markers - Group related constants by preference type (Library, DOI, Owner, Timestamp, Remote) - Rename constants to follow naming pattern (e.g., LIBRARY_*, DOI_*, OWNER_*) Diagramflowchart LR
A["Preference Classes"] -->|Add getDefault| B["Default Instances"]
A -->|Add setAll| C["Import/Reset Support"]
D["Method Renaming"] -->|is* to should*| E["Consistent Naming"]
F["RemotePreferences"] -->|Refactor Parameters| G["Clearer Structure"]
H["Timestamp Cleanup"] -->|Consolidate Classes| I["TimeStampToDateField"]
J["JabRefCliPreferences"] -->|Reorganize Constants| K["Region-Grouped Constants"]
File Changes1. jabgui/src/main/java/org/jabref/Launcher.java
|
Code Review by Qodo
|
Related issues and pull requests
Follow-up to #15503
PR Description
See qodo comment and title
Best be reviewed commit by commit
Steps to test
Run, open preferences, text reset and import
Checklist
CHANGELOG.mdin a way that can be understood by the average user (if change is visible to the user)