AmarGhugare opened a new pull request, #1877:
URL: https://github.com/apache/commons-lang/pull/1877
`NumberUtils.createNumber("-0x8000000000000000L")` returns `BigInteger` even
though the value is exactly `Long.MIN_VALUE` and the suffix requests `Long`.
The unsuffixed hexadecimal representation of `Integer.MIN_VALUE` similarly
returns `Long` instead of `Integer`.
Recognize the additional representable negative magnitude in the existing 8-
and 16-digit range checks, after leading zeros and any long suffix have been
accounted for. The numeric values are unchanged; the returned subtype is
corrected at those boundaries.
Thirteen regression cases fail without the correction. Coverage includes
`0x`, `0X`, and `#`, leading zeros, `L`/`l`, adjacent out-of-range values, and
an explicit Long request for the Integer minimum. Existing positive hexadecimal
promotion tests remain in place.
Validation: `mvn -o -B -ntp` passed on JDK 25.0.4.1: 119,342 tests run, zero
failures/errors, and 18 skipped. Coverage, license checks, Checkstyle, binary
compatibility, SpotBugs, PMD, and Javadoc checks passed.
Jira filing is pending approval of the Apache Jira account. The reproduction
and proposed fix are included here for review in the meantime.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]