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/06/04 15:49:50 UTC
[commons-codec] 02/02: Fix PMD violations
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-codec.git
commit a79f046459b8a2061a4d38f53e99418af5afa36a
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Jun 4 11:49:38 2023 -0400
Fix PMD violations
---
.../org/apache/commons/codec/digest/Blake3.java | 24 +++++++++++-----------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/main/java/org/apache/commons/codec/digest/Blake3.java b/src/main/java/org/apache/commons/codec/digest/Blake3.java
index b0c8fd5c..7af24a4e 100644
--- a/src/main/java/org/apache/commons/codec/digest/Blake3.java
+++ b/src/main/java/org/apache/commons/codec/digest/Blake3.java
@@ -364,7 +364,7 @@ public final class Blake3 {
private final int blockLength;
private final int flags;
- Output(
+ private Output(
final int[] inputChainingValue, final int[] blockWords, final long counter, final int blockLength,
final int flags) {
this.inputChainingValue = inputChainingValue;
@@ -374,12 +374,12 @@ public final class Blake3 {
this.flags = flags;
}
- int[] chainingValue() {
+ private int[] chainingValue() {
return Arrays
.copyOf(compress(inputChainingValue, blockWords, blockLength, counter, flags), CHAINING_VALUE_INTS);
}
- void rootOutputBytes(final byte[] out, int offset, int length) {
+ private void rootOutputBytes(final byte[] out, int offset, int length) {
int outputBlockCounter = 0;
while (length > 0) {
int chunkLength = Math.min(OUT_LEN * 2, length);
@@ -406,21 +406,21 @@ public final class Blake3 {
private int blockLength;
private int blocksCompressed;
- ChunkState(final int[] key, final long chunkCounter, final int flags) {
+ private ChunkState(final int[] key, final long chunkCounter, final int flags) {
chainingValue = key;
this.chunkCounter = chunkCounter;
this.flags = flags;
}
- int length() {
+ private int length() {
return BLOCK_LEN * blocksCompressed + blockLength;
}
- int startFlag() {
+ private int startFlag() {
return blocksCompressed == 0 ? CHUNK_START : 0;
}
- void update(final byte[] input, int offset, int length) {
+ private void update(final byte[] input, int offset, int length) {
while (length > 0) {
if (blockLength == BLOCK_LEN) {
// If the block buffer is full, compress it and clear it. More
@@ -443,7 +443,7 @@ public final class Blake3 {
}
}
- Output output() {
+ private Output output() {
final int[] blockWords = unpackInts(block, BLOCK_INTS);
final int outputFlags = flags | startFlag() | CHUNK_END;
return new Output(chainingValue, blockWords, chunkCounter, blockLength, outputFlags);
@@ -461,13 +461,13 @@ public final class Blake3 {
private int stackLen;
private ChunkState state;
- EngineState(final int[] key, final int flags) {
+ private EngineState(final int[] key, final int flags) {
this.key = key;
this.flags = flags;
state = new ChunkState(key, 0, flags);
}
- void inputData(final byte[] in, int offset, int length) {
+ private void inputData(final byte[] in, int offset, int length) {
while (length > 0) {
// If the current chunk is complete, finalize it and reset the
// chunk state. More input is coming, so this chunk is not ROOT.
@@ -487,7 +487,7 @@ public final class Blake3 {
}
}
- void outputHash(final byte[] out, final int offset, final int length) {
+ private void outputHash(final byte[] out, final int offset, final int length) {
// Starting with the Output from the current chunk, compute all the
// parent chaining values along the right edge of the tree, until we
// have the root Output.
@@ -500,7 +500,7 @@ public final class Blake3 {
output.rootOutputBytes(out, offset, length);
}
- void reset() {
+ private void reset() {
stackLen = 0;
Arrays.fill(cvStack, null);
state = new ChunkState(key, 0, flags);