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/07/10 01:23:14 UTC
(commons-jcs) 12/31: Use final
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-jcs.git
commit 21bcd17183a95ac9a53bc03a2441610f4d16b156
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 9 19:30:06 2024 -0400
Use final
Remove redundant keywords
---
.../commons/jcs3/auxiliary/disk/block/BlockDiskKeyStore.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/commons-jcs3-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/block/BlockDiskKeyStore.java b/commons-jcs3-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/block/BlockDiskKeyStore.java
index 9e64063e..59f866a5 100644
--- a/commons-jcs3-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/block/BlockDiskKeyStore.java
+++ b/commons-jcs3-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/block/BlockDiskKeyStore.java
@@ -199,7 +199,7 @@ public class BlockDiskKeyStore<K>
@Override
protected boolean shouldRemove()
{
- return maxSize > 0 && contentSize.get() > maxSize && this.size() > 1;
+ return maxSize > 0 && contentSize.get() > maxSize && size() > 1;
}
// keep the content size in kB, so 2^31 kB is reasonable value
@@ -419,7 +419,7 @@ public class BlockDiskKeyStore<K>
keys.put(descriptor.getKey(), descriptor.getBlocks());
}
}
- catch (EOFException e)
+ catch (final EOFException e)
{
break;
}
@@ -529,7 +529,7 @@ public class BlockDiskKeyStore<K>
}
// Write signature to distinguish old format from new one
- ByteBuffer signature = ByteBuffer.allocate(4);
+ final ByteBuffer signature = ByteBuffer.allocate(4);
signature.putInt(KEY_FILE_SIGNATURE).flip();
bc.write(signature);
@@ -577,7 +577,7 @@ public class BlockDiskKeyStore<K>
{
for (final int block : e.getValue())
{
- Set<K> keys = blockAllocationMap.computeIfAbsent(block, s -> new HashSet<>());
+ final Set<K> keys = blockAllocationMap.computeIfAbsent(block, s -> new HashSet<>());
if (!keys.isEmpty() && !log.isTraceEnabled())
{
// keys are not null, and no debug - fail fast