You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/11/04 12:05:09 UTC
(commons-compress) 02/02: Use final
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 43d0d27f3a61eff54a39a16d1e5b1f9bdb83c216
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Nov 4 08:04:51 2023 -0400
Use final
Remove trailing whitespace
---
.../compressors/bzip2/PythonTruncatedBzip2Test.java | 2 +-
.../harmony/pack200/tests/PackingOptionsTest.java | 20 ++++++++++----------
.../ZipSplitReadOnlySeekableByteChannelTest.java | 4 ++--
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/test/java/org/apache/commons/compress/compressors/bzip2/PythonTruncatedBzip2Test.java b/src/test/java/org/apache/commons/compress/compressors/bzip2/PythonTruncatedBzip2Test.java
index c7bae68f..1f2f15e2 100644
--- a/src/test/java/org/apache/commons/compress/compressors/bzip2/PythonTruncatedBzip2Test.java
+++ b/src/test/java/org/apache/commons/compress/compressors/bzip2/PythonTruncatedBzip2Test.java
@@ -38,7 +38,7 @@ import org.junit.jupiter.api.Test;
/**
* Testcase porting a test from Python's testsuite.
- *
+ *
* @see "https://issues.apache.org/jira/browse/COMPRESS-253"
*/
public class PythonTruncatedBzip2Test {
diff --git a/src/test/java/org/apache/commons/compress/harmony/pack200/tests/PackingOptionsTest.java b/src/test/java/org/apache/commons/compress/harmony/pack200/tests/PackingOptionsTest.java
index 0d399640..608de3e5 100644
--- a/src/test/java/org/apache/commons/compress/harmony/pack200/tests/PackingOptionsTest.java
+++ b/src/test/java/org/apache/commons/compress/harmony/pack200/tests/PackingOptionsTest.java
@@ -169,8 +169,8 @@ public class PackingOptionsTest {
try (JarFile jarFile = new JarFile(file2);
JarFile jarFile2 = new JarFile(compareFile)) {
// Check that both jars have the same entries in the same order
- Enumeration<JarEntry> entries = jarFile.entries();
- Enumeration<JarEntry> entries2 = jarFile2.entries();
+ final Enumeration<JarEntry> entries = jarFile.entries();
+ final Enumeration<JarEntry> entries2 = jarFile2.entries();
while (entries.hasMoreElements()) {
final JarEntry entry = entries.nextElement();
assertNotNull(entry);
@@ -292,8 +292,8 @@ public class PackingOptionsTest {
try (JarFile jarFile = new JarFile(file2);
JarFile jarFile2 = new JarFile(compareFile)) {
// Check that both jars have the same entries in the same order
- Enumeration<JarEntry> entries = jarFile.entries();
- Enumeration<JarEntry> entries2 = jarFile2.entries();
+ final Enumeration<JarEntry> entries = jarFile.entries();
+ final Enumeration<JarEntry> entries2 = jarFile2.entries();
while (entries.hasMoreElements()) {
final JarEntry entry = entries.nextElement();
@@ -324,8 +324,8 @@ public class PackingOptionsTest {
try (JarFile jarFile = new JarFile(file2);
JarFile jarFile2 = new JarFile(compareFile)) {
// Check that all mod times are the same and some are not the same as the original
- Enumeration<JarEntry> entries = jarFile.entries();
- Enumeration<JarEntry> entries2 = jarFile2.entries();
+ final Enumeration<JarEntry> entries = jarFile.entries();
+ final Enumeration<JarEntry> entries2 = jarFile2.entries();
long modtime = -1;
boolean sameAsOriginal = true;
while (entries.hasMoreElements()) {
@@ -440,7 +440,7 @@ public class PackingOptionsTest {
file0.deleteOnExit();
try (JarFile in = new JarFile(new File(Archive.class.getResource("/pack200/sqlUnpacked.jar").toURI()));
FileOutputStream out = new FileOutputStream(file0)) {
- PackingOptions options = new PackingOptions();
+ final PackingOptions options = new PackingOptions();
options.setGzip(false);
new Archive(in, out, options).pack();
}
@@ -450,7 +450,7 @@ public class PackingOptionsTest {
file.deleteOnExit();
try (JarFile in = new JarFile(new File(Archive.class.getResource("/pack200/sqlUnpacked.jar").toURI()));
FileOutputStream out = new FileOutputStream(file)) {
- PackingOptions options = new PackingOptions();
+ final PackingOptions options = new PackingOptions();
options.setGzip(false);
options.addPassFile("bin/test/org/apache/harmony/sql/tests/java/sql/DatabaseMetaDataTest.class");
assertTrue(options.isPassFile("bin/test/org/apache/harmony/sql/tests/java/sql/DatabaseMetaDataTest.class"));
@@ -462,7 +462,7 @@ public class PackingOptionsTest {
file2.deleteOnExit();
try (JarFile in = new JarFile(new File(Archive.class.getResource("/pack200/sqlUnpacked.jar").toURI()));
FileOutputStream out = new FileOutputStream(file2)) {
- PackingOptions options = new PackingOptions();
+ final PackingOptions options = new PackingOptions();
options.setGzip(false);
options.addPassFile("bin/test/org/apache/harmony/sql/tests/java/sql");
assertTrue(options.isPassFile("bin/test/org/apache/harmony/sql/tests/java/sql/DatabaseMetaDataTest.class"));
@@ -568,7 +568,7 @@ public class PackingOptionsTest {
}
}
- private void unpack(InputStream inputStream, JarOutputStream outputStream) throws Pack200Exception, IOException {
+ private void unpack(final InputStream inputStream, final JarOutputStream outputStream) throws Pack200Exception, IOException {
new org.apache.commons.compress.harmony.unpack200.Archive(inputStream, outputStream).unpack();
}
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 77ffd6ee..250e93a9 100644
--- a/src/test/java/org/apache/commons/compress/utils/ZipSplitReadOnlySeekableByteChannelTest.java
+++ b/src/test/java/org/apache/commons/compress/utils/ZipSplitReadOnlySeekableByteChannelTest.java
@@ -132,11 +132,11 @@ public class ZipSplitReadOnlySeekableByteChannelTest {
channels.add(secondChannel);
@SuppressWarnings("resource") // try-with-resources closes
- SeekableByteChannel channel1 = ZipSplitReadOnlySeekableByteChannel.forOrderedSeekableByteChannels(lastChannel, channels);
+ final SeekableByteChannel channel1 = ZipSplitReadOnlySeekableByteChannel.forOrderedSeekableByteChannels(lastChannel, channels);
assertTrue(channel1 instanceof ZipSplitReadOnlySeekableByteChannel);
@SuppressWarnings("resource") // try-with-resources closes
- SeekableByteChannel channel2 = ZipSplitReadOnlySeekableByteChannel.forOrderedSeekableByteChannels(firstChannel, secondChannel, lastChannel);
+ final SeekableByteChannel channel2 = ZipSplitReadOnlySeekableByteChannel.forOrderedSeekableByteChannels(firstChannel, secondChannel, lastChannel);
assertTrue(channel2 instanceof ZipSplitReadOnlySeekableByteChannel);
}
}