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 2025/08/13 13:57:57 UTC
(commons-compress) branch master updated: Better private instance variable name
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
The following commit(s) were added to refs/heads/master by this push:
new 39dcd8839 Better private instance variable name
39dcd8839 is described below
commit 39dcd8839a82317b894fd45466aad787c1d85aeb
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Wed Aug 13 09:57:51 2025 -0400
Better private instance variable name
---
.../compress/archivers/zip/UnshrinkingInputStream.java | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/UnshrinkingInputStream.java b/src/main/java/org/apache/commons/compress/archivers/zip/UnshrinkingInputStream.java
index e0d6104c9..7aec3a79a 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/UnshrinkingInputStream.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/UnshrinkingInputStream.java
@@ -34,7 +34,7 @@ final class UnshrinkingInputStream extends LZWInputStream {
private static final int MAX_CODE_SIZE = 13;
private static final int MAX_TABLE_SIZE = 1 << MAX_CODE_SIZE;
- private final boolean[] isUsed;
+ private final boolean[] inUse;
/**
* IOException is not actually thrown!
@@ -45,9 +45,9 @@ final class UnshrinkingInputStream extends LZWInputStream {
super(inputStream, ByteOrder.LITTLE_ENDIAN);
setClearCode(DEFAULT_CODE_SIZE);
initializeTables(MAX_CODE_SIZE);
- isUsed = new boolean[getPrefixesLength()];
+ inUse = new boolean[getPrefixesLength()];
for (int i = 0; i < 1 << 8; i++) {
- isUsed[i] = true;
+ inUse[i] = true;
}
setTableSize(getClearCode() + 1);
}
@@ -55,13 +55,13 @@ final class UnshrinkingInputStream extends LZWInputStream {
@Override
protected int addEntry(final int previousCode, final byte character) throws IOException {
int tableSize = getTableSize();
- while (tableSize < MAX_TABLE_SIZE && isUsed[tableSize]) {
+ while (tableSize < MAX_TABLE_SIZE && inUse[tableSize]) {
tableSize++;
}
setTableSize(tableSize);
final int idx = addEntry(previousCode, character, MAX_TABLE_SIZE);
if (idx >= 0) {
- isUsed[idx] = true;
+ inUse[idx] = true;
}
return idx;
}
@@ -92,7 +92,7 @@ protected int decompressNextSymbol() throws IOException {
if (code != getClearCode()) {
boolean addedUnfinishedEntry = false;
int effectiveCode = code;
- if (!isUsed[code]) {
+ if (!inUse[code]) {
effectiveCode = addRepeatOfPreviousCode();
addedUnfinishedEntry = true;
}
@@ -118,14 +118,14 @@ protected int decompressNextSymbol() throws IOException {
private void partialClear() {
final boolean[] isParent = new boolean[MAX_TABLE_SIZE];
- for (int i = 0; i < isUsed.length; i++) {
- if (isUsed[i] && getPrefix(i) != UNUSED_PREFIX) {
+ for (int i = 0; i < inUse.length; i++) {
+ if (inUse[i] && getPrefix(i) != UNUSED_PREFIX) {
isParent[getPrefix(i)] = true;
}
}
for (int i = getClearCode() + 1; i < isParent.length; i++) {
if (!isParent[i]) {
- isUsed[i] = false;
+ inUse[i] = false;
setPrefix(i, UNUSED_PREFIX);
}
}