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 2021/06/26 21:06:57 UTC
[commons-jcs] branch master updated: No need to init to default
value.
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
The following commit(s) were added to refs/heads/master by this push:
new 90de829 No need to init to default value.
90de829 is described below
commit 90de82936843b95deeef595cfba9584a37786e26
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Jun 26 17:06:53 2021 -0400
No need to init to default value.
---
.../apache/commons/jcs3/auxiliary/disk/block/BlockDisk.java | 4 ++--
.../jcs3/auxiliary/disk/indexed/IndexedDiskCache.java | 2 +-
.../apache/commons/jcs3/engine/control/CompositeCache.java | 12 ++++++------
.../commons/jcs3/engine/memory/AbstractMemoryCache.java | 6 +++---
4 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/block/BlockDisk.java b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/block/BlockDisk.java
index 93854ad..bf5e280 100644
--- a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/block/BlockDisk.java
+++ b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/block/BlockDisk.java
@@ -73,10 +73,10 @@ public class BlockDisk implements AutoCloseable
private final FileChannel fc;
/** How many bytes have we put to disk */
- private final AtomicLong putBytes = new AtomicLong(0);
+ private final AtomicLong putBytes = new AtomicLong();
/** How many items have we put to disk */
- private final AtomicLong putCount = new AtomicLong(0);
+ private final AtomicLong putCount = new AtomicLong();
/**
* Constructor for the Disk object
diff --git a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/indexed/IndexedDiskCache.java b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/indexed/IndexedDiskCache.java
index c93928e..3d4d030 100644
--- a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/indexed/IndexedDiskCache.java
+++ b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/indexed/IndexedDiskCache.java
@@ -127,7 +127,7 @@ public class IndexedDiskCache<K, V> extends AbstractDiskCache<K, V>
private int startupSize;
/** the number of bytes free on disk. */
- private final AtomicLong bytesFree = new AtomicLong(0);
+ private final AtomicLong bytesFree = new AtomicLong();
/** mode we are working on (size or count limited **/
private DiskLimitType diskLimitType = DiskLimitType.COUNT;
diff --git a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/engine/control/CompositeCache.java b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/engine/control/CompositeCache.java
index c77e0d8..965fda3 100644
--- a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/engine/control/CompositeCache.java
+++ b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/engine/control/CompositeCache.java
@@ -141,12 +141,12 @@ public class CompositeCache<K, V>
this.attr = attr;
this.cacheAttr = cattr;
this.alive = new AtomicBoolean(true);
- this.updateCount = new AtomicLong(0);
- this.removeCount = new AtomicLong(0);
- this.hitCountRam = new AtomicLong(0);
- this.hitCountAux = new AtomicLong(0);
- this.missCountNotFound = new AtomicLong(0);
- this.missCountExpired = new AtomicLong(0);
+ this.updateCount = new AtomicLong();
+ this.removeCount = new AtomicLong();
+ this.hitCountRam = new AtomicLong();
+ this.hitCountAux = new AtomicLong();
+ this.missCountNotFound = new AtomicLong();
+ this.missCountExpired = new AtomicLong();
createMemoryCache(cattr);
diff --git a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/engine/memory/AbstractMemoryCache.java b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/engine/memory/AbstractMemoryCache.java
index 322a0c3..5cc78c0 100644
--- a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/engine/memory/AbstractMemoryCache.java
+++ b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/engine/memory/AbstractMemoryCache.java
@@ -86,9 +86,9 @@ public abstract class AbstractMemoryCache<K, V>
@Override
public void initialize( final CompositeCache<K, V> hub )
{
- hitCnt = new AtomicLong(0);
- missCnt = new AtomicLong(0);
- putCnt = new AtomicLong(0);
+ hitCnt = new AtomicLong();
+ missCnt = new AtomicLong();
+ putCnt = new AtomicLong();
this.cacheAttributes = hub.getCacheAttributes();
this.chunkSize = cacheAttributes.getSpoolChunkSize();