Skip to content

Fix ClassCastException in DoubleLocaleConverter when input is non-Double Number#422

Merged
garydgregory merged 1 commit into
apache:masterfrom
rootvector2:double-locale-converter-cast
Jul 20, 2026
Merged

Fix ClassCastException in DoubleLocaleConverter when input is non-Double Number#422
garydgregory merged 1 commit into
apache:masterfrom
rootvector2:double-locale-converter-cast

Conversation

@rootvector2

Copy link
Copy Markdown
Contributor

DoubleLocaleConverter.parse() only handled the Long case for non-String inputs; any other Number subtype (e.g. Integer, Float, BigDecimal) passed directly to the converter was unchecked-cast to Double, throwing ClassCastException instead of a proper conversion.

@garydgregory garydgregory changed the title fix ClassCastException in DoubleLocaleConverter when input is non-Double Number Fix ClassCastException in DoubleLocaleConverter when input is non-Double Number Jul 20, 2026
@garydgregory
garydgregory merged commit 068d123 into apache:master Jul 20, 2026
9 checks passed
@garydgregory

Copy link
Copy Markdown
Member

Merged 🚀 Thank you @rootvector2 , please port to 1.x.

@rootvector2

Copy link
Copy Markdown
Contributor Author

thanks for merging, will get the 1.x port up.

@rootvector2

Copy link
Copy Markdown
Contributor Author

thanks for the merge. 1.x port is up in #424. same root cause there, though it surfaces as a ConversionException instead since the cast happens in BaseLocaleConverter rather than in parse.

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.

2 participants