This is an automated email from the ASF dual-hosted git repository.
garydgregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git
The following commit(s) were added to refs/heads/master by this push:
new 7bb0298ce Package-private class renames from PR #701 (conflicts).
7bb0298ce is described below
commit 7bb0298ce47b421d41be5a67ea10beef03793cae
Author: Gary Gregory <[email protected]>
AuthorDate: Fri Jul 31 18:22:25 2026 -0400
Package-private class renames from PR #701 (conflicts).
---
.../deflate64/Deflate64CompressorInputStream.java | 6 +++---
.../{HuffmanDecoder.java => Deflate64Decoder.java} | 24 +++++++++++-----------
.../{HuffmanState.java => Deflate64State.java} | 2 +-
.../Deflate64CompressorInputStreamTest.java | 4 ++--
...nDecoderTest.java => Deflate64DecoderTest.java} | 20 +++++++++---------
5 files changed, 28 insertions(+), 28 deletions(-)
diff --git
a/src/main/java/org/apache/commons/compress/compressors/deflate64/Deflate64CompressorInputStream.java
b/src/main/java/org/apache/commons/compress/compressors/deflate64/Deflate64CompressorInputStream.java
index 0958b3512..a4bffc68b 100644
---
a/src/main/java/org/apache/commons/compress/compressors/deflate64/Deflate64CompressorInputStream.java
+++
b/src/main/java/org/apache/commons/compress/compressors/deflate64/Deflate64CompressorInputStream.java
@@ -35,11 +35,11 @@
*/
public class Deflate64CompressorInputStream extends CompressorInputStream
implements InputStreamStatistics {
private InputStream originalStream;
- private HuffmanDecoder decoder;
+ private Deflate64Decoder decoder;
private long compressedBytesRead;
private final byte[] oneByte = new byte[1];
- Deflate64CompressorInputStream(final HuffmanDecoder decoder) {
+ Deflate64CompressorInputStream(final Deflate64Decoder decoder) {
this.decoder = decoder;
}
@@ -49,7 +49,7 @@ public class Deflate64CompressorInputStream extends
CompressorInputStream implem
* @param in The stream to read from.
*/
public Deflate64CompressorInputStream(final InputStream in) {
- this(new HuffmanDecoder(in));
+ this(new Deflate64Decoder(in));
originalStream = in;
}
diff --git
a/src/main/java/org/apache/commons/compress/compressors/deflate64/HuffmanDecoder.java
b/src/main/java/org/apache/commons/compress/compressors/deflate64/Deflate64Decoder.java
similarity index 97%
rename from
src/main/java/org/apache/commons/compress/compressors/deflate64/HuffmanDecoder.java
rename to
src/main/java/org/apache/commons/compress/compressors/deflate64/Deflate64Decoder.java
index 9ba65bd86..2bf8a53b5 100644
---
a/src/main/java/org/apache/commons/compress/compressors/deflate64/HuffmanDecoder.java
+++
b/src/main/java/org/apache/commons/compress/compressors/deflate64/Deflate64Decoder.java
@@ -18,10 +18,10 @@
*/
package org.apache.commons.compress.compressors.deflate64;
-import static
org.apache.commons.compress.compressors.deflate64.HuffmanState.DYNAMIC_CODES;
-import static
org.apache.commons.compress.compressors.deflate64.HuffmanState.FIXED_CODES;
-import static
org.apache.commons.compress.compressors.deflate64.HuffmanState.INITIAL;
-import static
org.apache.commons.compress.compressors.deflate64.HuffmanState.STORED;
+import static
org.apache.commons.compress.compressors.deflate64.Deflate64State.DYNAMIC_CODES;
+import static
org.apache.commons.compress.compressors.deflate64.Deflate64State.FIXED_CODES;
+import static
org.apache.commons.compress.compressors.deflate64.Deflate64State.INITIAL;
+import static
org.apache.commons.compress.compressors.deflate64.Deflate64State.STORED;
import java.io.Closeable;
import java.io.EOFException;
@@ -39,7 +39,7 @@
/**
* TODO This class can't be final because it is mocked by Mockito.
*/
-class HuffmanDecoder implements Closeable {
+class Deflate64Decoder implements Closeable {
private static final class BinaryTreeNode {
private final int bits;
@@ -79,7 +79,7 @@ private abstract static class DecoderState {
abstract int read(byte[] b, int off, int len) throws IOException;
- abstract HuffmanState state();
+ abstract Deflate64State state();
}
private static final class DecodingMemory {
@@ -133,7 +133,7 @@ void recordToBuffer(final int distance, final int length,
final byte[] buff) {
private final class HuffmanCodes extends DecoderState {
private boolean endOfBlock;
- private final HuffmanState state;
+ private final Deflate64State state;
private final BinaryTreeNode lengthTree;
private final BinaryTreeNode distanceTree;
@@ -141,7 +141,7 @@ private final class HuffmanCodes extends DecoderState {
private byte[] runBuffer = ArrayUtils.EMPTY_BYTE_ARRAY;
private int runBufferLength;
- HuffmanCodes(final HuffmanState state, final int[] lengths, final
int[] distance) {
+ HuffmanCodes(final Deflate64State state, final int[] lengths, final
int[] distance) {
this.state = state;
lengthTree = buildTree(lengths);
distanceTree = buildTree(distance);
@@ -226,7 +226,7 @@ int read(final byte[] b, final int off, final int len)
throws IOException {
}
@Override
- HuffmanState state() {
+ Deflate64State state() {
return endOfBlock ? INITIAL : state;
}
}
@@ -251,7 +251,7 @@ int read(final byte[] b, final int off, final int len)
throws IOException {
}
@Override
- HuffmanState state() {
+ Deflate64State state() {
return INITIAL;
}
}
@@ -302,7 +302,7 @@ int read(final byte[] b, final int off, final int len)
throws IOException {
}
@Override
- HuffmanState state() {
+ Deflate64State state() {
return read < blockLength ? STORED : INITIAL;
}
}
@@ -502,7 +502,7 @@ private static long readBits(final BitInputStream reader,
final int numBits) thr
private final DecodingMemory memory = new DecodingMemory();
- HuffmanDecoder(final InputStream in) {
+ Deflate64Decoder(final InputStream in) {
this.reader = new BitInputStream(in, ByteOrder.LITTLE_ENDIAN);
this.in = in;
state = new InitialState();
diff --git
a/src/main/java/org/apache/commons/compress/compressors/deflate64/HuffmanState.java
b/src/main/java/org/apache/commons/compress/compressors/deflate64/Deflate64State.java
similarity index 97%
rename from
src/main/java/org/apache/commons/compress/compressors/deflate64/HuffmanState.java
rename to
src/main/java/org/apache/commons/compress/compressors/deflate64/Deflate64State.java
index 20f3979a9..434b5d90a 100644
---
a/src/main/java/org/apache/commons/compress/compressors/deflate64/HuffmanState.java
+++
b/src/main/java/org/apache/commons/compress/compressors/deflate64/Deflate64State.java
@@ -18,6 +18,6 @@
*/
package org.apache.commons.compress.compressors.deflate64;
-enum HuffmanState {
+enum Deflate64State {
INITIAL, STORED, DYNAMIC_CODES, FIXED_CODES
}
diff --git
a/src/test/java/org/apache/commons/compress/compressors/deflate64/Deflate64CompressorInputStreamTest.java
b/src/test/java/org/apache/commons/compress/compressors/deflate64/Deflate64CompressorInputStreamTest.java
index ffd95cda2..33ae5c4d5 100644
---
a/src/test/java/org/apache/commons/compress/compressors/deflate64/Deflate64CompressorInputStreamTest.java
+++
b/src/test/java/org/apache/commons/compress/compressors/deflate64/Deflate64CompressorInputStreamTest.java
@@ -44,10 +44,10 @@
@ExtendWith(MockitoExtension.class)
class Deflate64CompressorInputStreamTest {
- private final HuffmanDecoder nullDecoder = null;
+ private final Deflate64Decoder nullDecoder = null;
@Mock
- private HuffmanDecoder decoder;
+ private Deflate64Decoder decoder;
private void fuzzingTest(final int[] bytes) throws IOException,
ArchiveException {
final int len = bytes.length;
diff --git
a/src/test/java/org/apache/commons/compress/compressors/deflate64/HuffmanDecoderTest.java
b/src/test/java/org/apache/commons/compress/compressors/deflate64/Deflate64DecoderTest.java
similarity index 93%
rename from
src/test/java/org/apache/commons/compress/compressors/deflate64/HuffmanDecoderTest.java
rename to
src/test/java/org/apache/commons/compress/compressors/deflate64/Deflate64DecoderTest.java
index 5beac0499..4b609a519 100644
---
a/src/test/java/org/apache/commons/compress/compressors/deflate64/HuffmanDecoderTest.java
+++
b/src/test/java/org/apache/commons/compress/compressors/deflate64/Deflate64DecoderTest.java
@@ -28,7 +28,7 @@
import org.apache.commons.compress.compressors.CompressorException;
import org.junit.jupiter.api.Test;
-class HuffmanDecoderTest {
+class Deflate64DecoderTest {
@Test
void testDecodeDynamicHuffmanBlockRejectsInvalidDistanceCode() throws
Exception {
@@ -52,7 +52,7 @@ void
testDecodeDynamicHuffmanBlockRejectsInvalidDistanceCode() throws Exception
0b00000000000000000000000001101011, // 7 extra bits (107 ->
118 zero lengths) + code 1 (literal 256)
0b00000000000000000000000000001100 // code 1 twice (literal
257, distance 0) + length symbol 257 + invalid distance bit 1
};
- try (HuffmanDecoder decoder = new HuffmanDecoder(new
ByteArrayInputStream(data))) {
+ try (Deflate64Decoder decoder = new Deflate64Decoder(new
ByteArrayInputStream(data))) {
final byte[] result = new byte[100];
final CompressorException e =
assertThrows(CompressorException.class, () -> {
final int len = decoder.decode(result);
@@ -72,7 +72,7 @@ void
testDecodeFixedHuffmanBlockRejectsReservedLiteralLengthCode() throws Except
0b00000000000000000000000000011011, // final block + fixed
huffman + low 5 bits of code 286
0b00000000000000000000000000000011 // high 3 bits of code 286
};
- try (HuffmanDecoder decoder = new HuffmanDecoder(new
ByteArrayInputStream(data))) {
+ try (Deflate64Decoder decoder = new Deflate64Decoder(new
ByteArrayInputStream(data))) {
final byte[] result = new byte[100];
final CompressorException e =
assertThrows(CompressorException.class, () -> {
final int len = decoder.decode(result);
@@ -103,7 +103,7 @@ void testDecodeFixedHuffmanBlockWithMemoryLookup() throws
Exception {
0b00000000000000000000000000001101, // dist6 + offset <11> +
end of block (000000)
0b11111111111111111111111111111000 // end of block (0000) +
garbage
};
- try (HuffmanDecoder decoder = new HuffmanDecoder(new
ByteArrayInputStream(data))) {
+ try (Deflate64Decoder decoder = new Deflate64Decoder(new
ByteArrayInputStream(data))) {
final byte[] result = new byte[100];
final int len = decoder.decode(result);
assertEquals(48, len);
@@ -132,7 +132,7 @@ void
testDecodeFixedHuffmanBlockWithMemoryLookupInExactBuffer() throws Exception
0b00000000000000000000000000001101, // dist6 + offset <11> +
end of block (000000)
0b11111111111111111111111111111000 // end of block (0000) +
garbage
};
- try (HuffmanDecoder decoder = new HuffmanDecoder(new
ByteArrayInputStream(data))) {
+ try (Deflate64Decoder decoder = new Deflate64Decoder(new
ByteArrayInputStream(data))) {
final byte[] result = new byte[48];
int len;
len = decoder.decode(result);
@@ -165,7 +165,7 @@ void
testDecodeFixedHuffmanBlockWithMemoryLookupInSmallBuffer() throws Exception
0b11111111111111111111111111111000 // end of block (0000) +
garbage
};
- try (HuffmanDecoder decoder = new HuffmanDecoder(new
ByteArrayInputStream(data))) {
+ try (Deflate64Decoder decoder = new Deflate64Decoder(new
ByteArrayInputStream(data))) {
final byte[] result = new byte[30];
int len;
len = decoder.decode(result);
@@ -195,7 +195,7 @@ void testDecodeSimpleFixedHuffmanBlock() throws Exception {
0b00000000000000000000000000000001, // d + end of block
0b11111111111111111111111111111100 // end of block (00) +
garbage
};
- try (HuffmanDecoder decoder = new HuffmanDecoder(new
ByteArrayInputStream(data))) {
+ try (Deflate64Decoder decoder = new Deflate64Decoder(new
ByteArrayInputStream(data))) {
final byte[] result = new byte[100];
final int len = decoder.decode(result);
assertEquals(11, len);
@@ -221,7 +221,7 @@ void testDecodeSimpleFixedHuffmanBlockToSmallBuffer()
throws Exception {
0b00000000000000000000000000000001, // d + end of block
0b11111111111111111111111111111100 // end of block (00) +
garbage
};
- try (HuffmanDecoder decoder = new HuffmanDecoder(new
ByteArrayInputStream(data))) {
+ try (Deflate64Decoder decoder = new Deflate64Decoder(new
ByteArrayInputStream(data))) {
final byte[] result = new byte[10];
int len;
len = decoder.decode(result);
@@ -238,7 +238,7 @@ void testDecodeUncompressedBlock() throws Exception {
final byte[] data = { 0b1, // end of block + no compression mode
11, 0, -12, -1, // len & ~len
'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd' };
- try (HuffmanDecoder decoder = new HuffmanDecoder(new
ByteArrayInputStream(data))) {
+ try (Deflate64Decoder decoder = new Deflate64Decoder(new
ByteArrayInputStream(data))) {
final byte[] result = new byte[100];
final int len = decoder.decode(result);
assertEquals(11, len);
@@ -251,7 +251,7 @@ void testDecodeUncompressedBlockWithInvalidLenNLenValue()
throws Exception {
final byte[] data = { 0b1, // end of block + no compression mode
11, 0, -12, -2, // len & ~len
'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd' };
- try (HuffmanDecoder decoder = new HuffmanDecoder(new
ByteArrayInputStream(data))) {
+ try (Deflate64Decoder decoder = new Deflate64Decoder(new
ByteArrayInputStream(data))) {
final byte[] result = new byte[100];
final IllegalStateException e =
assertThrows(IllegalStateException.class, () -> {
final int len = decoder.decode(result);