On Mon, 2 Mar 2026 21:33:31 GMT, Michael Strauß <[email protected]> wrote:

>> I wonder if we really should do that. Whenever something in the JDK changes, 
>> we may need to port it to our Integer parsing as well. 
>> Can't we just do the same as we do with `Double`:
>> 
>> 
>> try {
>>     return Double.parseDouble(s.substring(start, end));
>> } catch (NumberFormatException _) {
>>     return Double.NaN;
>> }
>> 
>> But with `Integer`?
>
> The entire premise of this PR is to not use exceptions for flow control. In 
> addition to that, what could possibly change with a very short algorithm that 
> parses an int?

I'd say this might be a good decision to use `long` because throwing an 
exception is more expensive in any case.  And, the int32 logic is unlikely to 
change ;-)

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2093#discussion_r2874905350

Reply via email to