From 595f292d377bdc2289d4737d50a4b0159a0d9231 Mon Sep 17 00:00:00 2001 From: Arne Babenhauserheide Date: Sun, 16 Feb 2025 13:08:47 +0100 Subject: [PATCH] Remove unnecessary cast --- test/freenet/crypt/CryptByteBufferTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/freenet/crypt/CryptByteBufferTest.java b/test/freenet/crypt/CryptByteBufferTest.java index d42cdaf7f9..46e56fee30 100755 --- a/test/freenet/crypt/CryptByteBufferTest.java +++ b/test/freenet/crypt/CryptByteBufferTest.java @@ -164,7 +164,7 @@ public void testSuccessfulRoundTripInPlace() throws GeneralSecurityException { byte[] buffer = Hex.decode(plainText[i]); byte[] plaintextCopy = buffer.clone(); crypt.encrypt(buffer, 0, buffer.length); - assertThat((Object) buffer, not(equalTo(plaintextCopy))); + assertThat(buffer, not(equalTo(plaintextCopy))); crypt.decrypt(buffer, 0, buffer.length); assertThat("CryptByteBufferType: "+type.name(), plaintextCopy, equalTo(buffer)); @@ -255,9 +255,9 @@ public void testSuccessfulRoundTripByteArrayReset() throws GeneralSecurityExcept // Once we have initialised the cipher, it is treated as a stream. // Repeated encryption of the same data will return different ciphertext, // as it is treated as a later point in the stream. - assertThat((Object) ciphertext1, not(equalTo(ciphertext2))); - assertThat((Object) ciphertext1, not(equalTo(ciphertext3))); - assertThat((Object) ciphertext2, not(equalTo(ciphertext3))); + assertThat(ciphertext1, not(equalTo(ciphertext2))); + assertThat(ciphertext1, not(equalTo(ciphertext3))); + assertThat(ciphertext2, not(equalTo(ciphertext3))); } ByteBuffer decipheredtext1 = crypt.decryptCopy(ciphertext1); @@ -330,9 +330,9 @@ public void testEncryptByteBufferToByteBuffer() throws GeneralSecurityException assertThat(buf, equalTo(cloneBuf)); // Plaintext not modified. plaintext.position(header); ciphertext.position(header); - assertThat((Object) ciphertextBuf, not(equalTo(copyCiphertextBuf))); + assertThat(ciphertextBuf, not(equalTo(copyCiphertextBuf))); Arrays.fill(buf, (byte)0); - assertThat((Object) buf, not(equalTo(cloneBuf))); + assertThat(buf, not(equalTo(cloneBuf))); crypt.decrypt(ciphertext, plaintext); assertThat(buf, equalTo(cloneBuf)); }