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-compress.git
commit cff82b4249bed4d9e3d6cf7da557216388df9bd5 Author: Gary Gregory <[email protected]> AuthorDate: Fri May 17 10:24:56 2024 -0400 Use try-with-resources --- .../compress/utils/ZipSplitReadOnlySeekableByteChannelTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test/java/org/apache/commons/compress/utils/ZipSplitReadOnlySeekableByteChannelTest.java b/src/test/java/org/apache/commons/compress/utils/ZipSplitReadOnlySeekableByteChannelTest.java index fddc1f26f..d1d6f79e6 100644 --- a/src/test/java/org/apache/commons/compress/utils/ZipSplitReadOnlySeekableByteChannelTest.java +++ b/src/test/java/org/apache/commons/compress/utils/ZipSplitReadOnlySeekableByteChannelTest.java @@ -62,9 +62,10 @@ public class ZipSplitReadOnlySeekableByteChannelTest { @Test public void testChannelsPositionIsZeroAfterConstructor() throws IOException { final List<SeekableByteChannel> channels = getSplitZipChannels(); - new ZipSplitReadOnlySeekableByteChannel(channels); - for (final SeekableByteChannel channel : channels) { - assertEquals(0, channel.position()); + try (ZipSplitReadOnlySeekableByteChannel c = new ZipSplitReadOnlySeekableByteChannel(channels)) { + for (final SeekableByteChannel channel : channels) { + assertEquals(0, channel.position()); + } } }
