Skip to content

Unresolved self-recursive generics comparison causes StackOverflowError #3084

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

Closed
chris-real opened this issue Apr 19, 2024 · 1 comment
Closed
Assignees
Labels
type: regression A regression from a previous release

Comments

@chris-real
Copy link

In #3051 comparison of nested generics was improved.

This change causes projects which has certain complexities in the domain model, with some inheritance and self references to StackOverflowError in TypeDiscoverer.equals(...) during startup.

I've created a minimal example of this error in https://github.com/chris-real/data-stackoverflow

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 19, 2024
@mp911de mp911de added type: regression A regression from a previous release and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 22, 2024
@mp911de
Copy link
Member

mp911de commented Apr 22, 2024

Thanks for reporting the regression. The issue comes from us following the self-recursive DBEntityWithExternalIds declaration, which points into itself. We need to fix the issue. As workaround, specifying a concrete type instead of going with raw types bypasses the problem.

@mp911de mp911de added this to the 3.1.12 (2023.0.12) milestone Apr 23, 2024
@mp911de mp911de self-assigned this Apr 23, 2024
@mp911de mp911de changed the title Improved Generics comparison causes StackOverflowError during startup Unresolved self-recursive generics comparison causes StackOverflowError Apr 23, 2024
mp911de added a commit that referenced this issue Apr 23, 2024
We now resort to String-based comparison if a generic cannot be resolved. Previously, unresolved generics caused an infinite recursion.

Closes #3084
mp911de added a commit that referenced this issue Apr 23, 2024
We now resort to String-based comparison if a generic cannot be resolved. Previously, unresolved generics caused an infinite recursion.

Closes #3084
natedanner pushed a commit to natedanner/spring-projects__spring-data-commons that referenced this issue May 20, 2024
We now resort to String-based comparison if a generic cannot be resolved. Previously, unresolved generics caused an infinite recursion.

Closes spring-projects#3084
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: regression A regression from a previous release
Projects
None yet
Development

No branches or pull requests

3 participants