On Tue, 4 Oct 2022 23:11:57 GMT, Justin Lu <[email protected]> wrote:
> Problem: Outdated doc does not match code. Claimed to throw exception and
> compared to Long method.
> Fix: Update doc to match code, compared to Double.parseDouble() accordingly.
Turned out that the comment was not aligning with the behavior of
`Double.parseDouble("")`, as it throws `NumberFormatException` (Thanks to
@LanceAndersen who let me know). So how about changing it to:
If (count == 0) this returns 0.0, unlike Double.parseDouble("") which throws
NumberFormatException
It also applies to `getLong()`, and you may want to add comments
`getBigDecimal()` for consistency with other `getXXX()` methods (without
"unlike ..." part though).
-------------
PR: https://git.openjdk.org/jdk/pull/10567