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 2020/08/15 13:42:24 UTC

[commons-jcs] branch master updated (a7484f0 -> 30d719c)

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

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


    from a7484f0  Add --no-transfer-progress to CI builds.
     new 1d14f71  Fix test
     new bac49e8  Some simplifications
     new 30d719c  Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/commons-jcs.git

The 3 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:
 .../jcs3/auxiliary/AbstractAuxiliaryCacheFactory.java  | 18 ------------------
 .../commons/jcs3/auxiliary/AuxiliaryCacheFactory.java  |  4 ++--
 .../lateral/socket/tcp/LateralTCPCacheFactory.java     |  8 +++-----
 .../commons/jcs3/engine/behavior/ICacheObserver.java   |  2 --
 .../disk/jdbc/mysql/MySQLDiskCacheUnitTest.java        |  4 +---
 5 files changed, 6 insertions(+), 30 deletions(-)


[commons-jcs] 01/03: Fix test

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

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

commit 1d14f71d8c4e440d13670f7f9a05eb8390b376f7
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Fri Aug 14 19:44:58 2020 +0200

    Fix test
---
 .../jcs3/auxiliary/disk/jdbc/mysql/MySQLDiskCacheUnitTest.java        | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/commons-jcs-core/src/test/java/org/apache/commons/jcs3/auxiliary/disk/jdbc/mysql/MySQLDiskCacheUnitTest.java b/commons-jcs-core/src/test/java/org/apache/commons/jcs3/auxiliary/disk/jdbc/mysql/MySQLDiskCacheUnitTest.java
index 4a54786..6b317be 100644
--- a/commons-jcs-core/src/test/java/org/apache/commons/jcs3/auxiliary/disk/jdbc/mysql/MySQLDiskCacheUnitTest.java
+++ b/commons-jcs-core/src/test/java/org/apache/commons/jcs3/auxiliary/disk/jdbc/mysql/MySQLDiskCacheUnitTest.java
@@ -23,7 +23,6 @@ import java.sql.SQLException;
 
 import org.apache.commons.jcs3.auxiliary.disk.jdbc.TableState;
 import org.apache.commons.jcs3.auxiliary.disk.jdbc.dsfactory.SharedPoolDataSourceFactory;
-import org.apache.commons.jcs3.engine.control.CompositeCacheManager;
 
 import junit.framework.TestCase;
 
@@ -60,8 +59,7 @@ public class MySQLDiskCacheUnitTest
         TableState tableState = new TableState( tableName );
         tableState.setState( TableState.OPTIMIZATION_RUNNING );
 
-        MySQLDiskCache<String, String> cache = new MySQLDiskCache<>( attributes, dsFactory, tableState,
-        		CompositeCacheManager.getUnconfiguredInstance() );
+        MySQLDiskCache<String, String> cache = new MySQLDiskCache<>(attributes, dsFactory, tableState);
 
         // DO WORK
         Object result = cache.processGet( "myKey" );


[commons-jcs] 03/03: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/commons-jcs.git

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

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

commit 30d719ceb5ad930937b1cc57f85d3d728e0434f6
Merge: bac49e8 a7484f0
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Sat Aug 15 15:41:47 2020 +0200

    Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/commons-jcs.git

 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[commons-jcs] 02/03: Some simplifications

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

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

commit bac49e83f44440ed4eadde6c3871d5d7ce4387cc
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Fri Aug 14 21:40:36 2020 +0200

    Some simplifications
---
 .../jcs3/auxiliary/AbstractAuxiliaryCacheFactory.java  | 18 ------------------
 .../commons/jcs3/auxiliary/AuxiliaryCacheFactory.java  |  4 ++--
 .../lateral/socket/tcp/LateralTCPCacheFactory.java     |  8 +++-----
 .../commons/jcs3/engine/behavior/ICacheObserver.java   |  2 --
 4 files changed, 5 insertions(+), 27 deletions(-)

diff --git a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/AbstractAuxiliaryCacheFactory.java b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/AbstractAuxiliaryCacheFactory.java
index 5702ffe..bca907f 100644
--- a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/AbstractAuxiliaryCacheFactory.java
+++ b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/AbstractAuxiliaryCacheFactory.java
@@ -29,24 +29,6 @@ public abstract class AbstractAuxiliaryCacheFactory
     private String name = this.getClass().getSimpleName();
 
     /**
-     * Initialize this factory
-     */
-    @Override
-    public void initialize()
-    {
-        // empty
-    }
-
-    /**
-     * Dispose of this factory, clean up shared resources
-     */
-    @Override
-    public void dispose()
-    {
-        // empty
-    }
-
-    /**
      * Gets the name attribute of the DiskCacheFactory object
      * <p>
      * @return The name value
diff --git a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/AuxiliaryCacheFactory.java b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/AuxiliaryCacheFactory.java
index ffaf2ae..52bffcd 100644
--- a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/AuxiliaryCacheFactory.java
+++ b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/AuxiliaryCacheFactory.java
@@ -48,12 +48,12 @@ public interface AuxiliaryCacheFactory
     /**
      * Initialize this factory
      */
-    void initialize();
+    default void initialize() { /* empty */ }
 
     /**
      * Dispose of this factory, clean up shared resources
      */
-    void dispose();
+    default void dispose()  { /* empty */ }
 
     /**
      * Sets the name attribute of the AuxiliaryCacheFactory object
diff --git a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/lateral/socket/tcp/LateralTCPCacheFactory.java b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/lateral/socket/tcp/LateralTCPCacheFactory.java
index ce7d98d..e75936a 100644
--- a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/lateral/socket/tcp/LateralTCPCacheFactory.java
+++ b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/lateral/socket/tcp/LateralTCPCacheFactory.java
@@ -21,7 +21,6 @@ package org.apache.commons.jcs3.auxiliary.lateral.socket.tcp;
 
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.StringTokenizer;
 import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCacheFactory;
@@ -96,12 +95,11 @@ public class LateralTCPCacheFactory
         // no servers are required.
         if ( lac.getTcpServers() != null )
         {
-            StringTokenizer it = new StringTokenizer( lac.getTcpServers(), "," );
-            log.debug( "Configured for [{0}] servers.", () -> it.countTokens() );
+            String servers[] = lac.getTcpServers().split("\\s*,\\s*");
+            log.debug( "Configured for [{0}] servers.", servers.length );
 
-            while ( it.hasMoreElements() )
+            for (String server : servers)
             {
-                String server = (String) it.nextElement();
                 log.debug( "tcp server = {0}", server );
                 ITCPLateralCacheAttributes lacC = (ITCPLateralCacheAttributes) lac.clone();
                 lacC.setTcpServer( server );
diff --git a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/engine/behavior/ICacheObserver.java b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/engine/behavior/ICacheObserver.java
index dfb85ff..8fffb6b 100644
--- a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/engine/behavior/ICacheObserver.java
+++ b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/engine/behavior/ICacheObserver.java
@@ -43,8 +43,6 @@ public interface ICacheObserver
     <K, V> void addCacheListener( String cacheName, ICacheListener<K, V> obj )
         throws IOException;
 
-    //, CacheNotFoundException;
-
     /**
      * Subscribes to all caches.
      *