Robbie Gemmell created PROTON-501:

             Summary: [proton-j] UnsignedLong.valueOf(String) can permit values 
outside the allowed range
                 Key: PROTON-501
             Project: Qpid Proton
          Issue Type: Bug
          Components: proton-j
    Affects Versions: 0.6, 0.5, 0.4, 0.3, 0.2, 0.1
            Reporter: Robbie Gemmell
             Fix For: 0.7

UnsignedLong#valueOf(String) attempts to ensure the provided value is in the 
range [0L- 2^64) but is likely to fail in doing.

The method uses BigInteger#bitCount() as part of the process, which despite the 
name will not give the behaviour that might be expected:
Returns the number of bits in the two's complement representation of this 
BigInteger that differ from its sign bit. This method is useful when 
implementing bit-vector style sets atop BigIntegers.

The range check should probably be using:

This message was sent by Atlassian JIRA

Reply via email to