hickey-ai opened a new pull request, #16524:
URL: https://github.com/apache/dubbo/pull/16524

   ## What is the purpose of the change?
   
   Fixes #16521
   
   `CompatibleTypeUtils.compatibleTypeConvert(BigDecimal, BigInteger.class)` 
currently calls `longValue()` before constructing the `BigInteger`. Values 
outside the signed 64-bit range therefore wrap instead of preserving their 
integral part: `9223372036854775808.75` becomes `-9223372036854775808`.
   
   The same corruption is reproduced through the public 
`PojoUtils.realize(value, BigInteger.class)` entry point. The compatibility 
response filter also delegates to these conversion helpers; no deployment or 
specific serializer behavior is assumed here.
   
   Use `BigDecimal.toBigInteger()` for this conversion. It preserves the 
arbitrary-precision integral value while retaining truncation toward zero for 
fractions. Other numeric conversions and the existing BigInteger identity fast 
path remain unchanged.
   
   Regression cases cover values above/below long bounds, large 
positive/negative fractional decimals, small fractional controls, legacy 
integer/long conversions and POJO realization. Five regression invocations fail 
against the unmodified source and pass with the fix.
   
   Validation on OpenJDK 21 (the project compiles with release 8): all 54 
`CompatibleTypeUtilsTest` and `PojoUtilsTest` invocations pass, with no 
failures, errors or skips. The Maven lifecycle Spotless check and `git diff 
--check` pass. Full-repository and end-to-end RPC testing were not run.
   
   ## Validation checklist
   
   - [x] Linked reproducible GitHub issue.
   - [x] Description explains the trigger, expected behavior and minimal fix.
   - [x] Regression tests executed locally; failures reproduced before the 
change.
   - [ ] GitHub Actions: pending the newly submitted PR.
   
   Investigation and patch preparation were AI-assisted; the stated local tests 
were actually executed.
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to