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

commit 83db5ac93e00503c5457438bd830dfb71e032cc3
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Tue Jul 9 19:33:26 2024 -0400

    Use diamonds
    
    Use final
---
 .../apache/commons/jcs/yajcache/core/CacheType.java    | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git 
a/commons-jcs3-sandbox/commons-jcs3-yajcache/src/main/java/org/apache/commons/jcs/yajcache/core/CacheType.java
 
b/commons-jcs3-sandbox/commons-jcs3-yajcache/src/main/java/org/apache/commons/jcs/yajcache/core/CacheType.java
index 94ac7db8..709d66a6 100644
--- 
a/commons-jcs3-sandbox/commons-jcs3-yajcache/src/main/java/org/apache/commons/jcs/yajcache/core/CacheType.java
+++ 
b/commons-jcs3-sandbox/commons-jcs3-yajcache/src/main/java/org/apache/commons/jcs/yajcache/core/CacheType.java
@@ -35,28 +35,28 @@ public enum CacheType {
     SOFT_REFERENCE_FILE_SAFE;
 
     /** Instantiates and returns a new instance of cache of the current type. 
*/
-    <V> ICache<V> createCache(String name, @NonNullable Class<V> valueType)
+    <V> ICache<V> createCache(final String name, @NonNullable final Class<V> 
valueType)
     {
         switch(this) {
             case SOFT_REFERENCE:
-                return new SoftRefCache<V>(name, valueType);
+                return new SoftRefCache<>(name, valueType);
             case SOFT_REFERENCE_SAFE:
-                return new SafeCacheWrapper<V>(new SoftRefCache<V>(name, 
valueType));
+                return new SafeCacheWrapper<>(new SoftRefCache<>(name, 
valueType));
             case SOFT_REFERENCE_FILE:
-                return new SoftRefFileCache<V>(name, valueType);
+                return new SoftRefFileCache<>(name, valueType);
             case SOFT_REFERENCE_FILE_SAFE:
-                return new SafeCacheWrapper<V>(new SoftRefFileCache<V>(name, 
valueType));
+                return new SafeCacheWrapper<>(new SoftRefFileCache<>(name, 
valueType));
         }
         throw new AssertionError(this);
     }
     /** Instantiates and returns a new instance of safe cache of the current 
type. */
-    <V> ICacheSafe<V> createSafeCache(String name, @NonNullable Class<V> 
valueType)
+    <V> ICacheSafe<V> createSafeCache(final String name, @NonNullable final 
Class<V> valueType)
     {
         switch(this) {
             case SOFT_REFERENCE_SAFE:
-                return new SafeCacheWrapper<V>(new SoftRefCache<V>(name, 
valueType));
+                return new SafeCacheWrapper<>(new SoftRefCache<>(name, 
valueType));
             case SOFT_REFERENCE_FILE_SAFE:
-                return new SafeCacheWrapper<V>(new SoftRefFileCache<V>(name, 
valueType));
+                return new SafeCacheWrapper<>(new SoftRefFileCache<>(name, 
valueType));
         }
         throw new UnsupportedOperationException("");
     }
@@ -65,7 +65,7 @@ public enum CacheType {
      * cache of the current cache type;
      * false otherwise.
      */
-    public boolean isAsssignableFrom(CacheType from) {
+    public boolean isAsssignableFrom(final CacheType from) {
         switch(this) {
             case SOFT_REFERENCE:
                 return true;

Reply via email to