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

Make ArchaiusType equals / hashCode compatible with ParameterizedTypeImpl #704

Merged
merged 1 commit into from
Feb 25, 2024

Conversation

kilink
Copy link
Member

@kilink kilink commented Feb 24, 2024

Make ArchaiusType's equals / hashCode / toString match what JDK's ParameterizedTypeImpl does, so that equivalent ParameterizedType instances hash and compare equal with ArchaiusType. Update toString to match what ParameterizedTypeImpl does as well.

Additionally, add do a defensive copy of the returned array in getActualTypeArguments, and add basic unit tests.

…Impl

Make ArchaiusType's equals / hashCode / toString match what JDK's ParameterizedTypeImpl
does, so that equivalent ParameterizedType instances hash and compare equal with
ArchaiusType. Update toString to match what ParameterizedTypeImpl does as well.

Additionally, add do a defensive copy of the returned array in getActualTypeArguments,
and add basic unit tests.
@kilink
Copy link
Member Author

kilink commented Feb 24, 2024

@kilink
Copy link
Member Author

kilink commented Feb 24, 2024

Also note the Javadoc for ParameterizedType, which states:

Instances of classes that implement this interface must implement an equals() method that equates any two instances that share the same generic type declaration and have equal type parameters.

@rgallardo-netflix rgallardo-netflix merged commit 1bc5462 into 2.x Feb 25, 2024
10 checks passed
@kilink kilink deleted the archaius-type-fixes branch February 25, 2024 03:31
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.

2 participants