Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract Common Code in UnmodifiableListDeserializer and UnmodifiableSetDeserializer #15673

Conversation

hyunmin0317
Copy link

The goal of this PR is to abstract the common logic found in UnmodifiableListDeserializer and UnmodifiableSetDeserializer to improve maintainability.
To achieve this, an abstract class AbstractUnmodifiableCollectionDeserializer has been introduced to handle shared deserialization logic.

Summary of Changes:

  • Abstract Class Created:
    • Introduced AbstractUnmodifiableCollectionDeserializer to centralize the common JSON deserialization logic and collection element addition.
    • This abstract class uses a generic type to handle various collection types such as List and Set.
  • Class Refactoring:
    • Refactored UnmodifiableListDeserializer and UnmodifiableSetDeserializer to extend the new abstract class.
    • Moved duplicated logic into the abstract class methods, reducing redundancy and improving readability.

Thank you for reviewing this pull request!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 22, 2024
@jzheaux jzheaux force-pushed the refactor/unmodifiable-collection-deserializers branch from 4e5998f to 7ed40ef Compare September 3, 2024 23:16
@jzheaux jzheaux self-assigned this Sep 3, 2024
@jzheaux jzheaux added in: core An issue in spring-security-core type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 3, 2024
@jzheaux jzheaux added this to the 6.4.0-M4 milestone Sep 3, 2024
@jzheaux jzheaux merged commit c53ee19 into spring-projects:main Sep 4, 2024
6 checks passed
@jzheaux jzheaux changed the title Refactor UnmodifiableListDeserializer and UnmodifiableSetDeserializer to Use AbstractUnmodifiableCollectionDeserializer Abstract Common Code in UnmodifiableListDeserializer and UnmodifiableSetDeserializer Sep 4, 2024
@jzheaux
Copy link
Contributor

jzheaux commented Sep 4, 2024

Thanks, @hyunmin0317! This is now merged into main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core An issue in spring-security-core type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants