Skip to content

0.20.0

Latest

Choose a tag to compare

@BenMorel BenMorel released this 28 Aug 20:57

πŸ’₯ Breaking changes

  • Deprecated exception class UnsupportedPlatformException has been removed, catch PlatformException instead

The following breaking change only affects you if you specifically catch DivisionByZeroException around calls to of() or to any method accepting strings:

  • of() now throws NumberFormatException instead of DivisionByZeroException when the string is a fraction with a denominator of zero, such as '2/0'

✨ New features

  • New methods: parse() and parseNullable() safely parse untrusted input, by restricting the allowed syntax and limiting the number of digits
  • New enum: NumberSyntax lists the syntax features that parse() can accept, with constants for the most common combinations

πŸ› Bug fixes

  • of() no longer throws PlatformException on malformed input with many digits, crafted to trigger heavy backtracking in its parser; such input now throws NumberFormatException as documented

πŸ‘Œ Improvements

  • NumberFormatException messages now escape control and non-ASCII characters, and truncate values longer than 40 bytes, instead of copying the raw input into the message