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/09/09 13:34:42 UTC
[commons-compress] 01/02: Sort members
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 5ef0703b17c8be039b91529e16c81e5d02b2b38b
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Sep 9 09:20:21 2023 -0400
Sort members
---
.../compress/archivers/examples/Expander.java | 8 ++++----
.../harmony/unpack200/bytecode/NewAttribute.java | 20 ++++++++++----------
.../compressors/DetectCompressorTestCase.java | 14 +++++++-------
3 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/src/main/java/org/apache/commons/compress/archivers/examples/Expander.java b/src/main/java/org/apache/commons/compress/archivers/examples/Expander.java
index 5bdf7325..b3fbc52b 100644
--- a/src/main/java/org/apache/commons/compress/archivers/examples/Expander.java
+++ b/src/main/java/org/apache/commons/compress/archivers/examples/Expander.java
@@ -50,13 +50,13 @@ import org.apache.commons.compress.utils.IOUtils;
public class Expander {
@FunctionalInterface
- private interface ArchiveEntrySupplier<T extends ArchiveEntry> {
- T get() throws IOException;
+ private interface ArchiveEntryBiConsumer<T extends ArchiveEntry> {
+ void accept(T entry, OutputStream out) throws IOException;
}
@FunctionalInterface
- private interface ArchiveEntryBiConsumer<T extends ArchiveEntry> {
- void accept(T entry, OutputStream out) throws IOException;
+ private interface ArchiveEntrySupplier<T extends ArchiveEntry> {
+ T get() throws IOException;
}
/**
diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/NewAttribute.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/NewAttribute.java
index 10c07791..40167652 100644
--- a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/NewAttribute.java
+++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/NewAttribute.java
@@ -26,6 +26,16 @@ import java.util.List;
*/
public class NewAttribute extends BCIRenumberedAttribute {
+ // Bytecode-related value (either a bytecode index or a length)
+ private static abstract class AbstractBcValue {
+
+ int actualValue;
+
+ public void setActualValue(final int value) {
+ this.actualValue = value;
+ }
+
+ }
private static class BCIndex extends AbstractBcValue {
private final int index;
@@ -55,16 +65,6 @@ public class NewAttribute extends BCIRenumberedAttribute {
this.index = index;
}
- }
- // Bytecode-related value (either a bytecode index or a length)
- private static abstract class AbstractBcValue {
-
- int actualValue;
-
- public void setActualValue(final int value) {
- this.actualValue = value;
- }
-
}
private final List<Integer> lengths = new ArrayList<>();
diff --git a/src/test/java/org/apache/commons/compress/compressors/DetectCompressorTestCase.java b/src/test/java/org/apache/commons/compress/compressors/DetectCompressorTestCase.java
index 85c3f838..0e098a51 100644
--- a/src/test/java/org/apache/commons/compress/compressors/DetectCompressorTestCase.java
+++ b/src/test/java/org/apache/commons/compress/compressors/DetectCompressorTestCase.java
@@ -95,13 +95,6 @@ public final class DetectCompressorTestCase {
new TestData("multiple.xz", new char[]{'a'}, factory, false),
};
- private String detect(final String testFileName) throws IOException, CompressorException {
- try (InputStream is = new BufferedInputStream(
- Files.newInputStream(getFile(testFileName).toPath()))) {
- return CompressorStreamFactory.detect(is);
- }
- }
-
@SuppressWarnings("resource") // Caller closes.
private CompressorInputStream createStreamFor(final String resource)
throws CompressorException, IOException {
@@ -135,6 +128,13 @@ public final class DetectCompressorTestCase {
}
+ private String detect(final String testFileName) throws IOException, CompressorException {
+ try (InputStream is = new BufferedInputStream(
+ Files.newInputStream(getFile(testFileName).toPath()))) {
+ return CompressorStreamFactory.detect(is);
+ }
+ }
+
@Test
public void testDetect() throws Exception {
assertEquals(CompressorStreamFactory.BZIP2, detect("bla.txt.bz2"));