Skip to content

Commit

Permalink
Make org.apache.commons.compress.archivers.sevenz.BindPair ivars final
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Feb 2, 2024
1 parent 391eba2 commit 436f337
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@

final class BindPair {

long inIndex;
long outIndex;
final long inIndex;
final long outIndex;

BindPair(final long inIndex, final long outIndex) {
this.inIndex = inIndex;
this.outIndex = outIndex;
}

@Override
public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1406,9 +1406,7 @@ private Folder readFolder(final ByteBuffer header) throws IOException {
final long numBindPairs = totalOutStreams - 1;
final BindPair[] bindPairs = new BindPair[(int) numBindPairs];
for (int i = 0; i < bindPairs.length; i++) {
bindPairs[i] = new BindPair();
bindPairs[i].inIndex = readUint64(header);
bindPairs[i].outIndex = readUint64(header);
bindPairs[i] = new BindPair(readUint64(header), readUint64(header));
}
folder.bindPairs = bindPairs;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void testFindBindPairForInStream() {

final Folder folder = new Folder();
final BindPair[] bindPairArray = new BindPair[1];
final BindPair bindPair = new BindPair();
final BindPair bindPair = new BindPair(0, 0);
bindPairArray[0] = bindPair;
folder.bindPairs = bindPairArray;

Expand All @@ -60,7 +60,7 @@ public void testGetUnpackSizeOne() {
final Folder folder = new Folder();
folder.totalOutputStreams = 266L;
final BindPair[] bindPairArray = new BindPair[1];
final BindPair bindPair = new BindPair();
final BindPair bindPair = new BindPair(0, 0);
bindPairArray[0] = bindPair;
folder.bindPairs = bindPairArray;
folder.totalOutputStreams = 1L;
Expand Down

0 comments on commit 436f337

Please sign in to comment.