Long.toHexString produces 2-complement format for negative values and cannot be used securely with Long.parseLong(16) which cannot process 2-complement and expects a weird optional negative sign in front of a hex value. These two should never be used together, and ideally parseLong(16) should not be used at all, unless in a strictly bounded context. RPtr is used to store memory pointers and on 64-bit devices it is not bounded in any way and values can occupy the entire range of 64 long bits.
Long.toHexString
produces 2-complement format for negative values and cannot be used securely withLong.parseLong(16)
which cannot process 2-complement and expects a weird optional negative sign in front of a hex value. These two should never be used together, and ideallyparseLong(16)
should not be used at all, unless in a strictly bounded context.RPtr
is used to store memory pointers and on 64-bit devices it is not bounded in any way and values can occupy the entire range of 64 long bits.