On Fri, 16 May 2025 09:45:43 GMT, Shaojin Wen <s...@openjdk.org> wrote:

>> Similar to PR #24982 
>> Document preconditions on certain DecimalDigits methods that use operations 
>> either unsafe and/or without range checks.
>
> Shaojin Wen has updated the pull request incrementally with two additional 
> commits since the last revision:
> 
>  - assert
>  - document add warnings

Re assert preamble for public methods: Unfortunately this is not possible. The 
algorithm requires the chars to be written on demand, and it is very costly to 
precompute the length, aside from the fact that you can easily mess up on 
precomputation. The uncheckedness is from the 2 private methods, so I think 
safeguarding the 2 private methods with assertions is sufficient.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25246#issuecomment-2886837958

Reply via email to