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 2024/01/14 21:36:43 UTC
(commons-compress) branch master updated (b2fc0cd5a -> e462021f7)
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git
from b2fc0cd5a Javadoc
new bc3341a9f Remove unused package-private and untested code
new e462021f7 Internal renames
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../compressors/bzip2/BZip2CompressorInputStream.java | 12 ++++++------
.../compressors/bzip2/BZip2CompressorOutputStream.java | 6 +++---
.../apache/commons/compress/compressors/bzip2/CRC.java | 18 +++++-------------
3 files changed, 14 insertions(+), 22 deletions(-)
(commons-compress) 01/02: Remove unused package-private and untested code
Posted by gg...@apache.org.
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 bc3341a9f98140710f426c78885d630a681111fc
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Jan 14 16:35:31 2024 -0500
Remove unused package-private and untested code
---
.../java/org/apache/commons/compress/compressors/bzip2/CRC.java | 8 --------
1 file changed, 8 deletions(-)
diff --git a/src/main/java/org/apache/commons/compress/compressors/bzip2/CRC.java b/src/main/java/org/apache/commons/compress/compressors/bzip2/CRC.java
index f2c2b4eed..c923e3ab5 100644
--- a/src/main/java/org/apache/commons/compress/compressors/bzip2/CRC.java
+++ b/src/main/java/org/apache/commons/compress/compressors/bzip2/CRC.java
@@ -58,18 +58,10 @@ final class CRC {
return ~globalCrc;
}
- int getGlobalCRC() {
- return globalCrc;
- }
-
void initializeCRC() {
globalCrc = 0xffffffff;
}
- void setGlobalCRC(final int newCrc) {
- globalCrc = newCrc;
- }
-
void updateCRC(final int inCh) {
int temp = globalCrc >> 24 ^ inCh;
if (temp < 0) {
(commons-compress) 02/02: Internal renames
Posted by gg...@apache.org.
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 e462021f72a93bbf37223cafc7400cf2604bf23a
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Jan 14 16:36:38 2024 -0500
Internal renames
---
.../compressors/bzip2/BZip2CompressorInputStream.java | 12 ++++++------
.../compressors/bzip2/BZip2CompressorOutputStream.java | 6 +++---
.../org/apache/commons/compress/compressors/bzip2/CRC.java | 10 +++++-----
3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java b/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
index a62313d99..cf98e3e4a 100644
--- a/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
@@ -340,7 +340,7 @@ public class BZip2CompressorInputStream extends CompressorInputStream implements
}
private void endBlock() throws IOException {
- this.computedBlockCRC = this.crc.getFinalCRC();
+ this.computedBlockCRC = this.crc.getFinal();
// A bad CRC is considered a fatal error.
if (this.storedBlockCRC != this.computedBlockCRC) {
@@ -611,7 +611,7 @@ public class BZip2CompressorInputStream extends CompressorInputStream implements
// currBlockNo++;
getAndMoveToFrontDecode();
- this.crc.initializeCRC();
+ this.crc.initialize();
this.currentState = START_BLOCK_STATE;
}
@@ -850,7 +850,7 @@ public class BZip2CompressorInputStream extends CompressorInputStream implements
this.su_tPos = this.data.tt[this.su_tPos];
this.su_i2++;
this.currentState = NO_RAND_PART_B_STATE;
- this.crc.updateCRC(su_ch2Shadow);
+ this.crc.update(su_ch2Shadow);
return su_ch2Shadow;
}
this.currentState = NO_RAND_PART_A_STATE;
@@ -877,7 +877,7 @@ public class BZip2CompressorInputStream extends CompressorInputStream implements
private int setupNoRandPartC() throws IOException {
if (this.su_j2 < this.su_z) {
final int su_ch2Shadow = this.su_ch2;
- this.crc.updateCRC(su_ch2Shadow);
+ this.crc.update(su_ch2Shadow);
this.su_j2++;
this.currentState = NO_RAND_PART_C_STATE;
return su_ch2Shadow;
@@ -904,7 +904,7 @@ public class BZip2CompressorInputStream extends CompressorInputStream implements
this.su_ch2 = su_ch2Shadow ^= this.su_rNToGo == 1 ? 1 : 0;
this.su_i2++;
this.currentState = RAND_PART_B_STATE;
- this.crc.updateCRC(su_ch2Shadow);
+ this.crc.update(su_ch2Shadow);
return su_ch2Shadow;
}
endBlock();
@@ -943,7 +943,7 @@ public class BZip2CompressorInputStream extends CompressorInputStream implements
private int setupRandPartC() throws IOException {
if (this.su_j2 < this.su_z) {
- this.crc.updateCRC(this.su_ch2);
+ this.crc.update(this.su_ch2);
this.su_j2++;
return this.su_ch2;
}
diff --git a/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java b/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java
index 68a7a09df..c55643d7e 100644
--- a/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java
@@ -492,7 +492,7 @@ public class BZip2CompressorOutputStream extends CompressorOutputStream implemen
}
private void endBlock() throws IOException {
- this.blockCRC = this.crc.getFinalCRC();
+ this.blockCRC = this.crc.getFinal();
this.combinedCRC = this.combinedCRC << 1 | this.combinedCRC >>> 31;
this.combinedCRC ^= this.blockCRC;
@@ -705,7 +705,7 @@ public class BZip2CompressorOutputStream extends CompressorOutputStream implemen
private void initBlock() {
// blockNo++;
- this.crc.initializeCRC();
+ this.crc.initialize();
this.last = -1;
// ch = 0;
@@ -1232,7 +1232,7 @@ public class BZip2CompressorOutputStream extends CompressorOutputStream implemen
final byte ch = (byte) currentCharShadow;
int runLengthShadow = this.runLength;
- this.crc.updateCRC(currentCharShadow, runLengthShadow);
+ this.crc.update(currentCharShadow, runLengthShadow);
switch (runLengthShadow) {
case 1:
diff --git a/src/main/java/org/apache/commons/compress/compressors/bzip2/CRC.java b/src/main/java/org/apache/commons/compress/compressors/bzip2/CRC.java
index c923e3ab5..f9ede980a 100644
--- a/src/main/java/org/apache/commons/compress/compressors/bzip2/CRC.java
+++ b/src/main/java/org/apache/commons/compress/compressors/bzip2/CRC.java
@@ -51,18 +51,18 @@ final class CRC {
private int globalCrc;
CRC() {
- initializeCRC();
+ initialize();
}
- int getFinalCRC() {
+ int getFinal() {
return ~globalCrc;
}
- void initializeCRC() {
+ void initialize() {
globalCrc = 0xffffffff;
}
- void updateCRC(final int inCh) {
+ void update(final int inCh) {
int temp = globalCrc >> 24 ^ inCh;
if (temp < 0) {
temp = 256 + temp;
@@ -70,7 +70,7 @@ final class CRC {
globalCrc = globalCrc << 8 ^ CRC.crc32Table[temp];
}
- void updateCRC(final int inCh, int repeat) {
+ void update(final int inCh, int repeat) {
int globalCrcShadow = this.globalCrc;
while (repeat-- > 0) {
final int temp = globalCrcShadow >> 24 ^ inCh;