Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||
* main: Update AI usage policy (#14698) Fix handling of DOIs (#14704) Handle ohter CrossRef response (#14696) Fix condition for processing closed issues/PRs Translate the English "change to Chinese(simplified)" to the Chinese in the warning dialog (#14690) More performance optimization (#14695) Add missing dot (and a link) Add link to PR template also if checklist is present, but not OK (#14694) Fix typo in IntelliJ code style instructions (#14693) Add import into new library to Welcome Tab (#14669) Add initial search requirements (#14633)
User description
Closes https://github.com/JabRef/jabref-issue-melting-pot/issues/1160
Steps to test
Use DOI cleanup for entries
Mandatory checks
CHANGELOG.mdin a way that is understandable for the average user (if change is visible to the user)PR Type
Bug fix
Description
Refactored DOI cleanup logic to handle malformed percent-encoded characters gracefully
Added error handling for URLDecoder to prevent crashes on invalid encoding
Simplified field list initialization using List.of() instead of Arrays.asList()
Improved code structure with functional programming patterns and AtomicBoolean tracking
Added test cases for wrongly encoded DOI characters in various fields
Diagram Walkthrough
File Walkthrough
DoiCleanup.java
Refactor DOI cleanup with error handlingjablib/src/main/java/org/jabref/logic/cleanup/DoiCleanup.java
Arrays.asList()withList.of()for FIELDS initializationIllegalArgumentException gracefully
ifPresent()andmap()AtomicBooleanto track if valid DOI exists in DOI fieldprocessing
variable naming
DoiCleanupTest.java
Add tests for malformed percent-encoded DOIsjablib/src/test/java/org/jabref/logic/cleanup/DoiCleanupTest.java
@MethodSourceannotation to use implicit method name matchinginstead of explicit string reference
provideDoiForAllLowers()tochangeDoi()to match test method nameremain unchanged
moved to DOI field
remain unchanged
CHANGELOG.md
Document DOI encoding fix in changelogCHANGELOG.md