RFR: 8317515: Unify the code of the parse*() families of methods in j.l.Integer and j.l.Long [v3]

Uwe Schindler uschindler at openjdk.org
Mon Oct 23 10:17:45 UTC 2023


On Mon, 23 Oct 2023 08:17:43 GMT, Uwe Schindler <uschindler at openjdk.org> wrote:

>> Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Using compareUnsigned() rather than open logic.
>
> This caused issue sin Apache Lucene, as it should not chnge message as it was befor ethis change.
> 
> See https://bugs.openjdk.org/browse/JDK-8318646

> @uschindler The spec of `parse[Int|Long]` is committed to throw particular exception types, but says nothing about the message content. IMO, relying on exception messages should be considered as a last resort choice, as they can change.
> 
> However, I agree that this is an easy fix.

Yes. I agree with this. 

The issue why I raised thus was that there may be code that relies on this. Although it is not part of spec, it might be a good idea to also keep code consistent and use a single way to instantiate the NumberFormatException.

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

PR Comment: https://git.openjdk.org/jdk/pull/16050#issuecomment-1774866080


More information about the core-libs-dev mailing list