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 2021/03/28 14:17:04 UTC
[commons-jcs] branch master updated (18a10e6 -> 2c9af34)
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 18a10e6 Make field final
new 2c75cfe Cosmetics
new 1e41dc3 Update year
new fd8c509 Remove obsolete documentation
new 3afca3f Fix docs
new 43670dc Use commons-text StringSubstitutor to fix deprecation
new 22008b2 Ude managed version
new e1db1e5 Try to fix several type safety problems
new e710ec2 Truncate key file on write
new d4e0873 Fix deprecations in Java 9
new 2c9af34 Add profile for Java 9+
The 10 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:
NOTICE.txt | 2 +-
.../auxiliary/disk/block/BlockDiskKeyStore.java | 4 +++-
.../jcs3/engine/control/CompositeCache.java | 3 ++-
.../commons/jcs3/utils/config/OptionConverter.java | 4 ++--
.../jcs3/utils/discovery/UDPDiscoveryReceiver.java | 8 ++++---
commons-jcs-jcache/pom.xml | 5 ++--
.../commons/jcs3/jcache/EvictionListener.java | 4 +++-
.../org/apache/commons/jcs3/jcache/JCSCache.java | 4 ++--
.../commons/jcs3/jcache/JCSCachingManager.java | 2 ++
.../apache/commons/jcs3/jcache/JCSListener.java | 15 ++++++------
.../org/apache/commons/jcs3/jcache/NoLoader.java | 7 +++---
.../org/apache/commons/jcs3/jcache/NoWriter.java | 15 ++++--------
.../commons/jcs3/jcache/lang/Lang3Substitutor.java | 19 ++++++++-------
commons-jcs-tck-tests/pom.xml | 28 +++++++++++++++++++++-
pom.xml | 3 +--
src/site/site.xml | 1 -
xdocs/LateralTCPProperties.xml | 2 +-
17 files changed, 78 insertions(+), 48 deletions(-)
[commons-jcs] 09/10: Fix deprecations in Java 9
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 d4e0873ce681baee7082dc23eccb38fa532d4e42
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Sun Mar 28 16:12:46 2021 +0200
Fix deprecations in Java 9
---
.../java/org/apache/commons/jcs3/engine/control/CompositeCache.java | 3 ++-
.../java/org/apache/commons/jcs3/utils/config/OptionConverter.java | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
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 06e07da..d975a89 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
@@ -1583,7 +1583,8 @@ public class CompositeCache<K, V>
final Class<?> c = Class.forName(cattr.getMemoryCacheName());
@SuppressWarnings("unchecked") // Need cast
final
- IMemoryCache<K, V> newInstance = (IMemoryCache<K, V>) c.newInstance();
+ IMemoryCache<K, V> newInstance =
+ (IMemoryCache<K, V>) c.getDeclaredConstructor().newInstance();
memCache = newInstance;
memCache.initialize(this);
}
diff --git a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/utils/config/OptionConverter.java b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/utils/config/OptionConverter.java
index 1cde26b..816271f 100644
--- a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/utils/config/OptionConverter.java
+++ b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/utils/config/OptionConverter.java
@@ -313,7 +313,7 @@ public class OptionConverter
try
{
final Class<?> classObj = Class.forName( className );
- final Object o = classObj.newInstance();
+ final Object o = classObj.getDeclaredConstructor().newInstance();
try
{
@@ -329,7 +329,7 @@ public class OptionConverter
return defaultValue;
}
}
- catch ( final ClassNotFoundException | InstantiationException | IllegalAccessException e )
+ catch (final Exception e )
{
log.error( "Could not instantiate class [{0}]", className, e );
}
[commons-jcs] 07/10: Try to fix several type safety problems
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 e1db1e56af16fd7526e4ac2967a6ad8cc880597b
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Sat Mar 27 19:07:09 2021 +0100
Try to fix several type safety problems
---
.../org/apache/commons/jcs3/jcache/EvictionListener.java | 4 +++-
.../java/org/apache/commons/jcs3/jcache/JCSCache.java | 4 ++--
.../org/apache/commons/jcs3/jcache/JCSCachingManager.java | 2 ++
.../java/org/apache/commons/jcs3/jcache/JCSListener.java | 15 ++++++++-------
.../java/org/apache/commons/jcs3/jcache/NoLoader.java | 7 ++++---
.../java/org/apache/commons/jcs3/jcache/NoWriter.java | 15 +++++----------
6 files changed, 24 insertions(+), 23 deletions(-)
diff --git a/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/EvictionListener.java b/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/EvictionListener.java
index 111b04c..6a673fc 100644
--- a/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/EvictionListener.java
+++ b/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/EvictionListener.java
@@ -31,7 +31,7 @@ public class EvictionListener implements IElementEventHandler
}
@Override
- public void handleElementEvent(final IElementEvent event)
+ public <T> void handleElementEvent(final IElementEvent<T> event)
{
switch (event.getElementEvent())
{
@@ -41,6 +41,8 @@ public class EvictionListener implements IElementEventHandler
case EXCEEDED_IDLETIME_BACKGROUND:
stats.increaseEvictions(1);
break;
+ default:
+ break;
}
}
}
diff --git a/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/JCSCache.java b/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/JCSCache.java
index e7c3a29..6bde9aa 100644
--- a/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/JCSCache.java
+++ b/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/JCSCache.java
@@ -120,7 +120,7 @@ public class JCSCache<K, V> implements Cache<K, V>
final Factory<CacheLoader<K, V>> cacheLoaderFactory = configuration.getCacheLoaderFactory();
if (cacheLoaderFactory == null)
{
- loader = NoLoader.INSTANCE;
+ loader = (CacheLoader<K, V>) NoLoader.INSTANCE;
}
else
{
@@ -131,7 +131,7 @@ public class JCSCache<K, V> implements Cache<K, V>
final Factory<CacheWriter<? super K, ? super V>> cacheWriterFactory = configuration.getCacheWriterFactory();
if (cacheWriterFactory == null)
{
- writer = NoWriter.INSTANCE;
+ writer = (CacheWriter<K, V>) NoWriter.INSTANCE;
}
else
{
diff --git a/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/JCSCachingManager.java b/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/JCSCachingManager.java
index efa5dc4..62690ed 100644
--- a/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/JCSCachingManager.java
+++ b/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/JCSCachingManager.java
@@ -351,12 +351,14 @@ public class JCSCachingManager implements CacheManager
private <K, V> Cache<K, V> doGetCache(final String cacheName, final Class<K> keyType, final Class<V> valueType)
{
+ @SuppressWarnings("unchecked") // common map for all caches
final Cache<K, V> cache = (Cache<K, V>) caches.get(cacheName);
if (cache == null)
{
return null;
}
+ @SuppressWarnings("unchecked") // don't know how to solve this
final Configuration<K, V> config = cache.getConfiguration(Configuration.class);
if ((keyType != null && !config.getKeyType().isAssignableFrom(keyType))
|| (valueType != null && !config.getValueType().isAssignableFrom(valueType)))
diff --git a/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/JCSListener.java b/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/JCSListener.java
index b0387e4..fd29c8d 100644
--- a/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/JCSListener.java
+++ b/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/JCSListener.java
@@ -18,6 +18,10 @@
*/
package org.apache.commons.jcs3.jcache;
+import java.io.Closeable;
+import java.util.ArrayList;
+import java.util.List;
+
import javax.cache.configuration.CacheEntryListenerConfiguration;
import javax.cache.configuration.Factory;
import javax.cache.event.CacheEntryCreatedListener;
@@ -28,14 +32,11 @@ import javax.cache.event.CacheEntryListener;
import javax.cache.event.CacheEntryListenerException;
import javax.cache.event.CacheEntryRemovedListener;
import javax.cache.event.CacheEntryUpdatedListener;
-import java.io.Closeable;
-import java.util.ArrayList;
-import java.util.List;
public class JCSListener<K, V> implements Closeable
{
- private final boolean oldValue;
- private final boolean synchronous;
+// private final boolean oldValue;
+// private final boolean synchronous;
private final CacheEntryEventFilter<? super K, ? super V> filter;
private final CacheEntryListener<? super K, ? super V> delegate;
private final boolean remove;
@@ -45,8 +46,8 @@ public class JCSListener<K, V> implements Closeable
public JCSListener(final CacheEntryListenerConfiguration<K, V> cacheEntryListenerConfiguration)
{
- oldValue = cacheEntryListenerConfiguration.isOldValueRequired();
- synchronous = cacheEntryListenerConfiguration.isSynchronous();
+// oldValue = cacheEntryListenerConfiguration.isOldValueRequired();
+// synchronous = cacheEntryListenerConfiguration.isSynchronous();
final Factory<CacheEntryEventFilter<? super K, ? super V>> filterFactory = cacheEntryListenerConfiguration
.getCacheEntryEventFilterFactory();
diff --git a/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/NoLoader.java b/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/NoLoader.java
index da0ee3d..091cd31 100644
--- a/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/NoLoader.java
+++ b/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/NoLoader.java
@@ -18,14 +18,15 @@
*/
package org.apache.commons.jcs3.jcache;
-import javax.cache.integration.CacheLoader;
-import javax.cache.integration.CacheLoaderException;
import java.util.HashMap;
import java.util.Map;
+import javax.cache.integration.CacheLoader;
+import javax.cache.integration.CacheLoaderException;
+
public class NoLoader<K, V> implements CacheLoader<K, V>
{
- public static final NoLoader INSTANCE = new NoLoader();
+ public static final NoLoader<?, ?> INSTANCE = new NoLoader<>();
private NoLoader()
{
diff --git a/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/NoWriter.java b/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/NoWriter.java
index 939d3a6..a130e9d 100644
--- a/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/NoWriter.java
+++ b/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/NoWriter.java
@@ -18,14 +18,15 @@
*/
package org.apache.commons.jcs3.jcache;
+import java.util.Collection;
+
import javax.cache.Cache;
import javax.cache.integration.CacheWriter;
import javax.cache.integration.CacheWriterException;
-import java.util.Collection;
public class NoWriter<K, V> implements CacheWriter<K, V>
{
- public static final NoWriter INSTANCE = new NoWriter();
+ public static final NoWriter<?, ?> INSTANCE = new NoWriter<>();
@Override
public void write(final Cache.Entry<? extends K, ? extends V> entry) throws CacheWriterException
@@ -42,18 +43,12 @@ public class NoWriter<K, V> implements CacheWriter<K, V>
@Override
public void writeAll(final Collection<Cache.Entry<? extends K, ? extends V>> entries) throws CacheWriterException
{
- for (final Cache.Entry<? extends K, ? extends V> entry : entries)
- {
- write(entry);
- }
+ entries.forEach(this::write);
}
@Override
public void deleteAll(final Collection<?> keys) throws CacheWriterException
{
- for (final Object k : keys)
- {
- delete(k);
- }
+ keys.forEach(this::delete);
}
}
[commons-jcs] 06/10: Ude managed version
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 22008b29f388b7681385635dcead9348e0fcfbbf
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Sat Mar 27 19:06:48 2021 +0100
Ude managed version
---
commons-jcs-tck-tests/pom.xml | 1 -
1 file changed, 1 deletion(-)
diff --git a/commons-jcs-tck-tests/pom.xml b/commons-jcs-tck-tests/pom.xml
index dad9d8a..899aa35 100644
--- a/commons-jcs-tck-tests/pom.xml
+++ b/commons-jcs-tck-tests/pom.xml
@@ -81,7 +81,6 @@
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
- <version>${hamcrest.version}</version>
<scope>test</scope>
</dependency>
[commons-jcs] 03/10: Remove obsolete documentation
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 fd8c509de6060c4e8ead91ee86fa62aa0270081a
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Sat Mar 27 18:09:19 2021 +0100
Remove obsolete documentation
---
src/site/site.xml | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/site/site.xml b/src/site/site.xml
index d50c1e7..650895b 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -70,7 +70,6 @@
<item name="Lateral TCP Cache" href="/LateralTCPAuxCache.html"/>
<item name="Lateral TCP Properties" href="/LateralTCPProperties.html"/>
<item name="Lateral UDP Discovery" href="/LateralUDPDiscovery.html"/>
- <item name="Lateral JGroups Cache" href="/LateralJavaGroupsAuxCache.html"/>
</item>
</menu>
[commons-jcs] 04/10: Fix docs
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 3afca3f3260f3f5d70231aa0a2156a7bc4392758
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Sat Mar 27 18:13:10 2021 +0100
Fix docs
---
xdocs/LateralTCPProperties.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xdocs/LateralTCPProperties.xml b/xdocs/LateralTCPProperties.xml
index 7213aa8..3da8fa7 100644
--- a/xdocs/LateralTCPProperties.xml
+++ b/xdocs/LateralTCPProperties.xml
@@ -40,7 +40,7 @@
<tr>
<td>TcpListenerHost</td>
<td> This is the host this cache should listen on (for multi-homed hosts).</td>
- <td>Y</td>
+ <td>N</td>
<td>listen on all interfaces</td>
</tr>
<tr>
[commons-jcs] 05/10: Use commons-text StringSubstitutor to fix
deprecation
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 43670dc9a19fed23d7e54ca86399e10b03152a05
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Sat Mar 27 19:06:26 2021 +0100
Use commons-text StringSubstitutor to fix deprecation
---
commons-jcs-jcache/pom.xml | 5 ++---
.../commons/jcs3/jcache/lang/Lang3Substitutor.java | 19 ++++++++++---------
pom.xml | 3 +--
3 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/commons-jcs-jcache/pom.xml b/commons-jcs-jcache/pom.xml
index fdd6839..ede8193 100644
--- a/commons-jcs-jcache/pom.xml
+++ b/commons-jcs-jcache/pom.xml
@@ -67,8 +67,8 @@
<dependency>
<groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- <version>${commons.lang.version}</version>
+ <artifactId>commons-text</artifactId>
+ <version>${commons.text.version}</version>
<optional>true</optional>
</dependency>
@@ -80,7 +80,6 @@
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
- <version>${hamcrest.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
diff --git a/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/lang/Lang3Substitutor.java b/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/lang/Lang3Substitutor.java
index 01965cb..993dad4 100644
--- a/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/lang/Lang3Substitutor.java
+++ b/commons-jcs-jcache/src/main/java/org/apache/commons/jcs3/jcache/lang/Lang3Substitutor.java
@@ -19,22 +19,23 @@
package org.apache.commons.jcs3.jcache.lang;
-import org.apache.commons.lang3.text.StrSubstitutor;
-
import java.util.HashMap;
import java.util.Map;
+import org.apache.commons.text.StringSubstitutor;
+
public class Lang3Substitutor implements Subsitutor
{
- private static final StrSubstitutor SUBSTITUTOR = new StrSubstitutor(new HashMap<String, Object>() {/**
- *
- */
+ private static final StringSubstitutor SUBSTITUTOR = new StringSubstitutor(new HashMap<String, Object>()
+ {
+ /** Serial version id */
private static final long serialVersionUID = 6568870218326105688L;
- {
- putAll(Map.class.cast(System.getProperties()));
- putAll(System.getenv());
- }});
+ {
+ putAll(Map.class.cast(System.getProperties()));
+ putAll(System.getenv());
+ }
+ });
@Override
public String substitute(final String value)
diff --git a/pom.xml b/pom.xml
index c0a4373..0053e16 100644
--- a/pom.xml
+++ b/pom.xml
@@ -547,8 +547,7 @@
<jsr107.api.version>1.0.1</jsr107.api.version>
<commons.collections.version>4.4</commons.collections.version>
- <commons.lang.version>3.12.0</commons.lang.version>
- <commons.clirr.version>2.8</commons.clirr.version>
+ <commons.text.version>1.9</commons.text.version>
<commons.assembly-plugin.version>3.3.0</commons.assembly-plugin.version>
<test.type>Unit</test.type>
[commons-jcs] 10/10: Add profile for Java 9+
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 2c9af34c6b7ccfa064bf56e0015735f107d846fb
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Sun Mar 28 16:16:33 2021 +0200
Add profile for Java 9+
---
commons-jcs-tck-tests/pom.xml | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/commons-jcs-tck-tests/pom.xml b/commons-jcs-tck-tests/pom.xml
index 899aa35..3a0a294 100644
--- a/commons-jcs-tck-tests/pom.xml
+++ b/commons-jcs-tck-tests/pom.xml
@@ -243,6 +243,33 @@
</plugins>
</build>
</profile>
+ <profile>
+ <id>javaNinePlus</id>
+ <activation>
+ <jdk>[9,)</jdk>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemPropertyVariables>
+ <domainJar>${domain-lib-dir}/${domain-jar}</domainJar>
+ <javax.management.builder.initial>${javax.management.builder.initial}</javax.management.builder.initial>
+ <org.jsr107.tck.management.agentId>${org.jsr107.tck.management.agentId}</org.jsr107.tck.management.agentId>
+ <javax.cache.CacheManager>${CacheManagerImpl}</javax.cache.CacheManager>
+ <javax.cache.Cache>${CacheImpl}</javax.cache.Cache>
+ <javax.cache.Cache.Entry>${CacheEntryImpl}</javax.cache.Cache.Entry>
+ <javax.cache.annotation.CacheInvocationContext>${CacheInvocationContextImpl}</javax.cache.annotation.CacheInvocationContext>
+ </systemPropertyVariables>
+ <argLine>--add-opens java.base/java.lang=ALL-UNNAMED</argLine>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+ </profile>
</profiles>
</project>
[commons-jcs] 02/10: Update year
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 1e41dc31fa8b6a7a35b1cd425018ec912631a74d
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Sat Mar 27 18:06:21 2021 +0100
Update year
---
NOTICE.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/NOTICE.txt b/NOTICE.txt
index ed776f5..796ff7e 100644
--- a/NOTICE.txt
+++ b/NOTICE.txt
@@ -1,5 +1,5 @@
Apache Commons JCS
-Copyright 2001-2020 The Apache Software Foundation.
+Copyright 2001-2021 The Apache Software Foundation.
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
[commons-jcs] 01/10: Cosmetics
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 2c75cfe32b4e3487c0735543ddf51bb90050872e
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Sat Mar 27 17:58:57 2021 +0100
Cosmetics
---
.../apache/commons/jcs3/utils/discovery/UDPDiscoveryReceiver.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/utils/discovery/UDPDiscoveryReceiver.java b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/utils/discovery/UDPDiscoveryReceiver.java
index 6e42379..a7855e4 100644
--- a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/utils/discovery/UDPDiscoveryReceiver.java
+++ b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/utils/discovery/UDPDiscoveryReceiver.java
@@ -85,7 +85,7 @@ public class UDPDiscoveryReceiver
private final AtomicBoolean shutdown = new AtomicBoolean(false);
/**
- * Constructor for the LateralUDPReceiver object.
+ * Constructor for the UDPDiscoveryReceiver object.
* <p>
* We determine out own host using InetAddress
*<p>
@@ -95,8 +95,10 @@ public class UDPDiscoveryReceiver
* @param multicastPort
* @throws IOException
*/
- public UDPDiscoveryReceiver( final UDPDiscoveryService service, final String multicastInterfaceString,
- final String multicastAddressString, final int multicastPort )
+ public UDPDiscoveryReceiver( final UDPDiscoveryService service,
+ final String multicastInterfaceString,
+ final String multicastAddressString,
+ final int multicastPort )
throws IOException
{
this.service = service;
[commons-jcs] 08/10: Truncate key file on write
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 e710ec2dd117dd7f742615b49b9bde0a9eca0c67
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Sun Mar 28 13:20:42 2021 +0200
Truncate key file on write
---
.../apache/commons/jcs3/auxiliary/disk/block/BlockDiskKeyStore.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
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 6220a87..97873ce 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
@@ -523,7 +523,9 @@ public class BlockDiskKeyStore<K>
synchronized (keyFile)
{
try (SeekableByteChannel bc = Files.newByteChannel(keyFile.toPath(),
- StandardOpenOption.CREATE, StandardOpenOption.WRITE))
+ StandardOpenOption.CREATE,
+ StandardOpenOption.WRITE,
+ StandardOpenOption.TRUNCATE_EXISTING))
{
if (!verify())
{