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

fix: Stack overflow on multi maps (and other non-trivial generic classes) #4413

Closed
wants to merge 1 commit into from

Conversation

xRodney
Copy link
Contributor

@xRodney xRodney commented Sep 13, 2022

Description

Logic in sundrio that is responsible for replacing generic type arguments on methods and properties with their concrete instantiations from subclasses contained a bug, in which it looped infinitely if the same type argument name was used at multiple classes in the hierarchy. A common occurence were multimaps.

A very similar code was also present in crd-generator, also suffering from the same bug.

Sundrio has been updated to account for this situation, and updated utilities from sundrio have been introduced to crd-generator, which replace the previous implementation of teh same algorithm.

Fixes #4357

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change
  • Chore (non-breaking change which doesn't affect codebase;
    test, version modification, documentation, etc.)

Checklist

  • Code contributed by me aligns with current project license: Apache 2.0
  • I Added CHANGELOG entry regarding this change
  • I have implemented unit tests to cover my changes
  • I have added/updated the javadocs and other documentation accordingly
  • No new bugs, code smells, etc. in SonarCloud report
  • I tested my code in Kubernetes
  • I tested my code in OpenShift

@xRodney
Copy link
Contributor Author

xRodney commented Sep 13, 2022

TODO: wait for a new release of sundrio by @iocanel, then update version in pom.xml

…ses)

Logic in sundrio that is responsible for replacing generic type arguments on methods and properties with their concrete instantiations from subclasses contained a bug, in which it looped infinitely if the same type argument name was used at multiple classes in the hierarchy. A common occurence were multimaps.

A very similar code was also present in crd-generator, also suffering from the same bug.

Sundrio has been updated to account for this situation, and updated utilities from sundrio have been introduced to crd-generator, which replace the previous implementation of teh same algorithm.

Fixes fabric8io#4357
@@ -80,7 +80,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<!-- Core versions -->
<sundrio.version>0.93.0</sundrio.version>
<sundrio.version>0.94-bugfix-multi-maps3-SNAPSHOT</sundrio.version>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: 0.94

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xRodney / @iocanel please ping me as soon this is ready to review 🙏

@xRodney xRodney marked this pull request as ready for review September 13, 2022 09:58
@xRodney
Copy link
Contributor Author

xRodney commented Oct 14, 2022

Superseded by #4501.
The next release of sundrio 0.93.1 contains not only the original fix for stack overflow, but also additional work to fully support multimaps and generate correct schema for them.

@xRodney xRodney closed this Oct 14, 2022
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.

Stack overflow on multi maps (and other non-trivial generic classes)
2 participants