This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-codec.git
commit c5c8326ae53c29aa5aa26e8e9bd30e0070e899e6 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Tue Aug 29 08:25:06 2023 -0400 Add @SuppressWarnings --- .../codec/digest/MessageDigestAlgorithmsTest.java | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/test/java/org/apache/commons/codec/digest/MessageDigestAlgorithmsTest.java b/src/test/java/org/apache/commons/codec/digest/MessageDigestAlgorithmsTest.java index bcce78c8..209c58c1 100644 --- a/src/test/java/org/apache/commons/codec/digest/MessageDigestAlgorithmsTest.java +++ b/src/test/java/org/apache/commons/codec/digest/MessageDigestAlgorithmsTest.java @@ -209,17 +209,11 @@ public class MessageDigestAlgorithmsTest { final byte[] expected = digestTestData(messageDigestAlgorithm); - assertArrayEquals(expected, - DigestUtils.digest( - DigestUtils.getDigest(messageDigestAlgorithm), getTestRandomAccessFile() - ) - ); - getTestRandomAccessFile().seek(0); - assertArrayEquals(expected, - DigestUtils.digest( - DigestUtils.getDigest(messageDigestAlgorithm), getTestRandomAccessFile() - ) - ); + @SuppressWarnings("resource") // test manages RAF + final RandomAccessFile randomAccessFile = getTestRandomAccessFile(); + assertArrayEquals(expected, DigestUtils.digest(DigestUtils.getDigest(messageDigestAlgorithm), randomAccessFile)); + randomAccessFile.seek(0); + assertArrayEquals(expected, DigestUtils.digest(DigestUtils.getDigest(messageDigestAlgorithm), randomAccessFile)); } }