RFR: 8357063: Document preconditions for DecimalDigits methods [v2]
Chen Liang
liach at openjdk.org
Fri May 16 14:13:51 UTC 2025
On Fri, 16 May 2025 09:45:43 GMT, Shaojin Wen <swen at 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
More information about the core-libs-dev
mailing list