You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by tv...@apache.org on 2022/01/03 11:20:02 UTC

[commons-jcs] branch release-3.1 updated (ee1ef74 -> 9c41ebc)

This is an automated email from the ASF dual-hosted git repository.

tv pushed a change to branch release-3.1
in repository https://gitbox.apache.org/repos/asf/commons-jcs.git.


    from ee1ef74  Add paragraph about SecureRandom
     new d643259  Modernize
     new 9c41ebc  Prepare RC2

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:
 .../auxiliary/disk/block/BlockDiskKeyStore.java    | 24 +++++++++-------------
 pom.xml                                            |  2 +-
 2 files changed, 11 insertions(+), 15 deletions(-)

[commons-jcs] 01/02: Modernize

Posted by tv...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tv pushed a commit to branch release-3.1
in repository https://gitbox.apache.org/repos/asf/commons-jcs.git

commit d64325921e8d74296ebc0c04c83db5f20a19ddc0
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Mon Jan 3 12:19:43 2022 +0100

    Modernize
---
 .../auxiliary/disk/block/BlockDiskKeyStore.java    | 24 +++++++++-------------
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/block/BlockDiskKeyStore.java b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/block/BlockDiskKeyStore.java
index 75f33ac..9ca5ea1 100644
--- a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/block/BlockDiskKeyStore.java
+++ b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/block/BlockDiskKeyStore.java
@@ -466,9 +466,9 @@ public class BlockDiskKeyStore<K>
         {
             keyHash.putAll(keys);
 
-            log.debug("{0}: Found {1} in keys file.", logCacheName, keys.size());
+            log.debug("{0}: Found {1} in keys file.", () -> logCacheName, keys::size);
             log.info("{0}: Loaded keys from [{1}], key count: {2}; up to {3} will be available.",
-                    () -> logCacheName, () -> fileName, () -> keyHash.size(),
+                    () -> logCacheName, () -> fileName, this::size,
                     () -> maxKeySize);
         }
     }
@@ -517,7 +517,7 @@ public class BlockDiskKeyStore<K>
     {
         final ElapsedTimer timer = new ElapsedTimer();
         log.info("{0}: Saving keys to [{1}], key count [{2}]", () -> logCacheName,
-                this.keyFile::getAbsolutePath, () -> keyHash.size());
+                this.keyFile::getAbsolutePath, this::size);
 
         synchronized (keyFile)
         {
@@ -553,7 +553,7 @@ public class BlockDiskKeyStore<K>
         }
 
         log.info("{0}: Finished saving keys. It took {1} to store {2} keys. Key file length [{3}]",
-                () -> logCacheName, timer::getElapsedTimeString, () -> keyHash.size(),
+                () -> logCacheName, timer::getElapsedTimeString, this::size,
                 keyFile::length);
     }
 
@@ -580,13 +580,8 @@ public class BlockDiskKeyStore<K>
         {
             for (final int block : e.getValue())
             {
-                Set<K> keys = blockAllocationMap.get(block);
-                if (keys == null)
-                {
-                    keys = new HashSet<>();
-                    blockAllocationMap.put(block, keys);
-                }
-                else if (!log.isTraceEnabled())
+                Set<K> keys = blockAllocationMap.computeIfAbsent(block, HashSet::new);
+                if (!keys.isEmpty() && !log.isTraceEnabled())
                 {
                     // keys are not null, and no debug - fail fast
                     return false;
@@ -594,13 +589,14 @@ public class BlockDiskKeyStore<K>
                 keys.add(e.getKey());
             }
         }
-        boolean ok = true;
-        if (!log.isTraceEnabled()) {
+        if (!log.isTraceEnabled())
+        {
             return true;
         }
+        boolean ok = true;
         for (final Entry<Integer, Set<K>> e : blockAllocationMap.entrySet())
         {
-            log.trace("Block {0}: {1}", e.getKey(), e.getValue());
+            log.trace("Block {0}: {1}", e::getKey, e::getValue);
             if (e.getValue().size() > 1)
             {
                 ok = false;

[commons-jcs] 02/02: Prepare RC2

Posted by tv...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tv pushed a commit to branch release-3.1
in repository https://gitbox.apache.org/repos/asf/commons-jcs.git

commit 9c41ebc05caf243265d346525022ca97d31afa25
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Mon Jan 3 12:19:58 2022 +0100

    Prepare RC2
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 367e1a4..f6713f3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -553,7 +553,7 @@
     <commons.releaseManagerName>tv</commons.releaseManagerName>
     <commons.releaseManagerKey>88817402</commons.releaseManagerKey>
     <!-- The RC version used in the staging repository URL. -->
-    <commons.rc.version>RC1</commons.rc.version>
+    <commons.rc.version>rc2</commons.rc.version>
     <commons.jira.id>JCS</commons.jira.id>
     <commons.site.path>commons-jcs</commons.site.path>
     <commons.scmPubUrl>