Skip to content

Conversation

@goneall
Copy link
Member

@goneall goneall commented Jan 6, 2025

This fix is necessary for compatibility for implementations using the misspelled getCaseSensitiveId method. Note that if you reversed the default, new implementation will fail since they don't implement the misspelled version. The solution is to have default implementations for both versions. This could, however, cause a stack overflow if no implementation is provided. To avoid this, we use introspection to see if the default is used.

Note that this changes the behavior of a missing interface from a compile time error to a run-time error.

This fix is necessary for campatibility for implementations using the
misspelled getCaseInsensitiveId method.  Note that if you reversed the
default, new implementation will fail since they don't implement the
misspelled version.  The solution is to have default implementations for
both versions.  This could, however, cause a stack overflow if no
implementation is provided.  To avoid this, we use introspection to see
if the default is used.

Note that this changes the behavior of a missing interface from a
compile time error to a run-time error.
@goneall goneall requested a review from bact January 6, 2025 22:59
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 7, 2025

@goneall goneall merged commit 0d9c2d9 into main Jan 7, 2025
5 checks passed
@goneall goneall deleted the defaultcaseins branch January 7, 2025 19:08
@bact
Copy link
Collaborator

bact commented Jan 8, 2025

I have looked at the code. Far more sophisticated than I was thought, but very well thought. Looks good.

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.

3 participants