On Mon, 6 Oct 2025 20:26:54 GMT, Joe Darcy <[email protected]> wrote:

>>> For the use of regex, is it an aesthetics question or a JDK bootstrapping 
>>> question?
>> 
>> Thanks for your consideration. This particular regex seems fine 
>> aesthetically.
>> 
>> Having been bitten by performance suprises in the past, it raises my 
>> eyebrows when regex-dependent String functions are used in platform, library 
>> or otherwise low-level code. This looks like an edge-case, and as you note 
>> it is pre-existing. So yes, probably fine.
>
>> > For the use of regex, is it an aesthetics question or a JDK bootstrapping 
>> > question?
>> 
>> Thanks for your consideration. This particular regex seems fine 
>> aesthetically.
>> 
>> Having been bitten by performance suprises in the past, it raises my 
>> eyebrows when regex-dependent String functions are used in platform, library 
>> or otherwise low-level code. This looks like an edge-case, and as you note 
>> it is pre-existing. So yes, probably fine.
> 
> Use of regex does merit some scrutiny, easy to write a regex that can run in 
> exponential time.

> @jddarcy To address @eirbjo concerns about using a regex, what about 
> `s.replace("-1022", "-14")` instead? There should be no ambiguity in this 
> specific case.

I'd prefer to do that in follow-up work that updated Float and Float16 at the 
same time.

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

PR Comment: https://git.openjdk.org/jdk/pull/27625#issuecomment-3377587460

Reply via email to