fix(QTDI-2912): fix Possible ClassCastException in SchemaConverter#1231
Open
undx wants to merge 3 commits into
Open
fix(QTDI-2912): fix Possible ClassCastException in SchemaConverter#1231undx wants to merge 3 commits into
undx wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a numeric-conversion bug in SchemaConverter that could throw a ClassCastException when converting Float default values to JSON, and adds unit tests to prevent regressions in numeric handling.
Changes:
- Reworked
SchemaConverter#toValuenumeric handling to avoid castingFloattoDoubleand added aNumberfallback. - Added
SchemaConverterTestregression tests forFloat/Doubleand other numeric types, includingBigDecimal/BigIntegerprecision checks.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| component-runtime-manager/src/main/java/org/talend/sdk/component/runtime/manager/xbean/converter/SchemaConverter.java | Adjusts numeric branches in toValue() to prevent Float casting failures and adds a Number fallback. |
| component-runtime-manager/src/test/java/org/talend/sdk/component/runtime/manager/xbean/converter/SchemaConverterTest.java | Adds regression/unit tests covering numeric conversion behavior for toValue(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.

https://qlik-dev.atlassian.net/browse/QTDI-2912
Requirements
Why this PR is needed?
What does this PR adds (design/code thoughts)?
AI generated code
https://internal.qlik.dev/general/ways-of-working/code-reviews/#guidelines-for-ai-generated-code