On Wed, 1 Feb 2023 17:56:05 GMT, Mark Powers <[email protected]> wrote:
>> test/jdk/java/security/MessageDigest/TestCloneable.java line 95:
>>
>>> 93:
>>> 94: System.out.println(": Shared data check");
>>> 95: if (!Arrays.equals(d1.digest(), d2.digest())) {
>>
>> If d1 and d2 don't share memory and each thread processes random bytes, how
>> can the digests be equal?
>
> In the case where ByteBuffer has allocated a direct buffer, a new internal
> byte array gets allocated. This is the shared memory that's causing the
> problem. See MessageDigestSpi.java line 220.
>
> Oops got to update the copyright.
I think you mean line 126? :
` tempArray = new byte[n]; `
-------------
PR: https://git.openjdk.org/jdk/pull/12348