Skip to content

reject exponent notation in DatatypeConverterImpl._parseDecimal - #2053

Open
Shrusti-pk wants to merge 1 commit into
eclipse-ee4j:masterfrom
Shrusti-pk:parsedecimal-exponent
Open

Shrusti-pk wants to merge 1 commit into
eclipse-ee4j:masterfrom
Shrusti-pk:parsedecimal-exponent

Conversation

@Shrusti-pk

Copy link
Copy Markdown

_parseDecimal accepts exponents that xs:decimal does not allow

new BigDecimal(String) takes 1E999999999, so a 43-byte <amount>1E999999999</amount> on a BigDecimal property unmarshals with no ValidationEvent into a value with scale -999999999, and _printDecimal (toPlainString()) then has to build a billion-digit string when the object is marshalled again. Measured on JDK 21: 1E100000000 marshals to 100,000,088 bytes and 1E999999999 throws OutOfMemoryError with -Xmx2g. With the patch both are reported as a parse-conversion event like any other malformed number, and every valid xs:decimal form parses as before.

Signed-off-by: Shrushti P K <shrusthi@labs.digiscrypt.com>

This branch has not been deployed

No deployments
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.

1 participant