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 <t...@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. *