Fix ClassCastExeption + improve compatibleConstructor detection#22
Merged
Maxlego08 merged 3 commits intoGroupeZ-dev:developfrom Apr 3, 2026
Merged
Fix ClassCastExeption + improve compatibleConstructor detection#22Maxlego08 merged 3 commits intoGroupeZ-dev:developfrom
Maxlego08 merged 3 commits intoGroupeZ-dev:developfrom
Conversation
…casting float to double throw ClassCastExeption
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request strengthens type safety and constructor compatibility checks in the schema and DTO consumer logic. The main improvements include stricter validation of object types when adding schema columns, enhanced handling of overloaded constructors, and additional unit tests to verify these behaviors.
Type validation improvements
schemaFromTypeto ensure that objects passed for schema column values match the expected type (e.g.,Numberfor numeric types,Booleanfor booleans,UUIDfor UUID columns, andDatefor date columns). Throws clearIllegalArgumentExceptionmessages when mismatches occur. [1] [2]Constructor compatibility enhancements
createConsumerFromTemplateto check all constructors for compatibility with the DTO's fields, supporting overloaded constructors and ensuring that the number of non-synthetic constructor parameters matches the number of fields. Throws an exception if no compatible constructor is found.Test coverage improvements
OverloadedTemplateDTOandIncompatibleTemplateDTOclasses in test code to verify handling of overloaded and incompatible constructors.