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 08:20:56 UTC 2023


On Fri, 6 Oct 2023 16:26:42 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:

>> See the [JBS issue](https://bugs.openjdk.org/browse/JDK-8317515) for the details.
>
> 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

src/java.base/share/classes/java/lang/Integer.java line 565:

> 563:         int len = s.length();
> 564:         if (len == 0) {
> 565:             throw new NumberFormatException("");

This caused a regression in Apache Lucene (see https://github.com/apache/lucene/issues/12708) and should be: `throw NumberFormatException.forInputString("", radix);`

src/java.base/share/classes/java/lang/Integer.java line 640:

> 638:          */
> 639:         if (beginIndex == endIndex) {
> 640:             throw new NumberFormatException("");

This caused a regression in Apache Lucene (see https://github.com/apache/lucene/issues/12708) and should be: `throw NumberFormatException.forInputString("", radix);`

src/java.base/share/classes/java/lang/Integer.java line 830:

> 828:          */
> 829:         if (beginIndex == endIndex) {
> 830:             throw new NumberFormatException("");

This caused a regression in Apache Lucene (see https://github.com/apache/lucene/issues/12708) and should be: `throw NumberFormatException.forInputString("", radix);`

src/java.base/share/classes/java/lang/Long.java line 595:

> 593:         int len = s.length();
> 594:         if (len == 0) {
> 595:             throw new NumberFormatException("");

This caused a regression in Apache Lucene (see https://github.com/apache/lucene/issues/12708) and should be: `throw NumberFormatException.forInputString("", radix);`

src/java.base/share/classes/java/lang/Long.java line 670:

> 668:          */
> 669:         if (beginIndex == endIndex) {
> 670:             throw new NumberFormatException("");

This caused a regression in Apache Lucene (see https://github.com/apache/lucene/issues/12708) and should be: `throw NumberFormatException.forInputString("", radix);`

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

PR Review: https://git.openjdk.org/jdk/pull/16050#pullrequestreview-1691955892
PR Review Comment: https://git.openjdk.org/jdk/pull/16050#discussion_r1368289384
PR Review Comment: https://git.openjdk.org/jdk/pull/16050#discussion_r1368289714
PR Review Comment: https://git.openjdk.org/jdk/pull/16050#discussion_r1368290255
PR Review Comment: https://git.openjdk.org/jdk/pull/16050#discussion_r1368290564
PR Review Comment: https://git.openjdk.org/jdk/pull/16050#discussion_r1368290726


More information about the core-libs-dev mailing list