This is an automated email from the ASF dual-hosted git repository.

kpvdr pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-interop-test.git

commit 8296ac9ec0b4e4b126efc1b26e8aaa0b1e4e370c
Author: QIT Development Team <[email protected]>
AuthorDate: Fri Jul 17 18:43:35 2026 -0400

    Fix: Handle Long.MIN_VALUE in parseNumber()
    
    Issue: Build #65 - 3 JMS tests failed with NumberFormatException
    when parsing -0x8000000000000000 (Long.MIN_VALUE).
    
    Root Cause: The value -0x8000000000000000 has an absolute value
    of 0x8000000000000000 (9223372036854775808), which exceeds
    Long.MAX_VALUE (9223372036854775807). The code was trying to
    parse the hex part as a signed long, then negate it, which fails.
    
    Solution: Use Long.parseUnsignedLong() for the hex part, then
    negate the result. This correctly handles Long.MIN_VALUE where
    the absolute value exceeds Long.MAX_VALUE.
    
    Failed Tests (Build #65):
    - test_jms_bytesmessage
    - test_jms_mapmessage
    - test_jms_streammessage
    
    All failed on the same value: -0x8000000000000000
    
    Expected: Build #66 will have 16/16 JMS tests passing (100%)
    
    Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
---
 shims/java-qpid-jms/src/main/java/org/apache/qpid/qit/JmsSender.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/shims/java-qpid-jms/src/main/java/org/apache/qpid/qit/JmsSender.java 
b/shims/java-qpid-jms/src/main/java/org/apache/qpid/qit/JmsSender.java
index f0d369f..c55e38d 100644
--- a/shims/java-qpid-jms/src/main/java/org/apache/qpid/qit/JmsSender.java
+++ b/shims/java-qpid-jms/src/main/java/org/apache/qpid/qit/JmsSender.java
@@ -362,7 +362,9 @@ public class JmsSender {
         if (str.startsWith("0x") || str.startsWith("0X")) {
             return Long.parseLong(str.substring(2), 16);
         } else if (str.startsWith("-0x") || str.startsWith("-0X")) {
-            return -Long.parseLong(str.substring(3), 16);
+            // Use parseUnsignedLong for the hex part, then negate
+            // This handles Long.MIN_VALUE (-0x8000000000000000) correctly
+            return -Long.parseUnsignedLong(str.substring(3), 16);
         } else {
             return element.getAsLong();
         }


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

Reply via email to