Skip to content

fix(file): ensure directory creation and preserve generic types#87

Open
theEvilReaper wants to merge 3 commits into
developfrom
fix/modern-gson-file-handler
Open

fix(file): ensure directory creation and preserve generic types#87
theEvilReaper wants to merge 3 commits into
developfrom
fix/modern-gson-file-handler

Conversation

@theEvilReaper

Copy link
Copy Markdown
Contributor

Proposed changes

This PR improves ModernGsonFileHandler and GsonFileHandler by ensuring missing parent directories are automatically created when saving files, preventing NoSuchFileException errors. Additionally, it fixes an issue where generic type parameters were stripped during JSON serialization due to typeToken.getRawType(), and corrects the new file logging check. Common path preparation logic has been extracted into FileHandlerUtil to eliminate code duplication, and the test suite has been refactored for full test isolation

Types of changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of
them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before
merging your code.

  • I have read the CONTRIBUTING.md
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@theEvilReaper theEvilReaper self-assigned this Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant