Fix reset and import for CitationKeyPreferences#15522
Conversation
Review Summary by QodoFix CitationKeyPatternPreferences reset/import and remove reflection
WalkthroughsDescription• Remove reflection-based pattern discovery in CitationKeyPattern • Fix reset and import functionality for CitationKeyPatternPreferences • Refactor CitationKeyPatternPreferences to use default factory method • Standardize preference key naming with CITATION_KEY_ prefix • Remove unused defaultPattern parameter from preferences Diagramflowchart LR
A["CitationKeyPattern<br/>Reflection-based"] -->|"Replace with<br/>static lists"| B["CitationKeyPattern<br/>Explicit categories"]
C["CitationKeyPatternPreferences<br/>Constructor-based"] -->|"Add factory method"| D["CitationKeyPatternPreferences<br/>getDefault()"]
E["Scattered preference keys"] -->|"Standardize naming"| F["CITATION_KEY_ prefixed keys"]
G["CitationKeyPatternsPanel<br/>Injected preferences"] -->|"Remove dependency"| H["CitationKeyPatternsPanel<br/>Simplified initialization"]
File Changes1. jablib/src/main/java/org/jabref/logic/citationkeypattern/CitationKeyPattern.java
|
Code Review by Qodo
|
| keyPattern, | ||
| "", | ||
| ','); | ||
| new SimpleObjectProperty<>(',')); |
There was a problem hiding this comment.
This looks idd, why does this need a new Property in the constructor? We don't use that anywhere else
There was a problem hiding this comment.
We had a longer chat in devchannel. Summary:
KeyDelemitier property incorporates a foreign preference from No entry preferences to keep CitationKeyPreferences self-contained and not having to refactor everything to also accept BibEntryPreferences.
Hacky solution has been partially inherited from before, but is now dynamically adapting to a changing base preference.
|
What about the last qodo issue?
|
I commented on it. Its addressed in the helper method |
| if (this.keywordDelimiter.isBound()) { | ||
| this.keywordDelimiter.unbind(); | ||
| } |
There was a problem hiding this comment.
bind() calls unbind() internally, so this block is unnecessary.
There was a problem hiding this comment.
Will resolve in next prefs pr
Related issues and pull requests
Follow-up to #15514
PR Description
See qodo comment and title
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)