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/11/22 19:14:19 UTC

[commons-jcs] 06/07: Deprecate String-methods in favor of Enum-methods

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 b743ebbc66308e2d0708b8aef610bd1aab40eeb8
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Mon Nov 22 20:05:10 2021 +0100

    Deprecate String-methods in favor of Enum-methods
---
 .../commons/jcs3/auxiliary/lateral/LateralCacheAttributes.java       | 2 ++
 .../jcs3/auxiliary/lateral/behavior/ILateralCacheAttributes.java     | 4 ++++
 .../lateral/socket/tcp/LateralTCPConcurrentRandomTestUtil.java       | 3 ++-
 .../lateral/socket/tcp/LateralTCPFilterRemoveHashCodeUnitTest.java   | 3 ++-
 .../lateral/socket/tcp/LateralTCPIssueRemoveOnPutUnitTest.java       | 5 +++--
 5 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/lateral/LateralCacheAttributes.java b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/lateral/LateralCacheAttributes.java
index c25655e..9956b07 100644
--- a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/lateral/LateralCacheAttributes.java
+++ b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/lateral/LateralCacheAttributes.java
@@ -191,6 +191,7 @@ public class LateralCacheAttributes
      * @param val The new transmissionTypeName value
      */
     @Override
+    @Deprecated
     public void setTransmissionTypeName( final String val )
     {
         this.transmissionType = Type.valueOf(val);
@@ -201,6 +202,7 @@ public class LateralCacheAttributes
      * @return The transmissionTypeName value
      */
     @Override
+    @Deprecated
     public String getTransmissionTypeName()
     {
         return this.transmissionType.toString();
diff --git a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/lateral/behavior/ILateralCacheAttributes.java b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/lateral/behavior/ILateralCacheAttributes.java
index 02ff5ae..93fece0 100644
--- a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/lateral/behavior/ILateralCacheAttributes.java
+++ b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/lateral/behavior/ILateralCacheAttributes.java
@@ -152,14 +152,18 @@ public interface ILateralCacheAttributes
      * Sets the transmissionTypeName attribute of the ILateralCacheAttributes object
      * <p>
      * @param val The new transmissionTypeName value
+     * @deprecated Use setTransmissionType()
      */
+    @Deprecated
     void setTransmissionTypeName( String val );
 
     /**
      * Gets the transmissionTypeName attribute of the ILateralCacheAttributes object
      * <p>
      * @return The transmissionTypeName value
+     * @deprecated Use getTransmissionType
      */
+    @Deprecated
     String getTransmissionTypeName();
 
     /**
diff --git a/commons-jcs-core/src/test/java/org/apache/commons/jcs3/auxiliary/lateral/socket/tcp/LateralTCPConcurrentRandomTestUtil.java b/commons-jcs-core/src/test/java/org/apache/commons/jcs3/auxiliary/lateral/socket/tcp/LateralTCPConcurrentRandomTestUtil.java
index b6ba254..af6b200 100644
--- a/commons-jcs-core/src/test/java/org/apache/commons/jcs3/auxiliary/lateral/socket/tcp/LateralTCPConcurrentRandomTestUtil.java
+++ b/commons-jcs-core/src/test/java/org/apache/commons/jcs3/auxiliary/lateral/socket/tcp/LateralTCPConcurrentRandomTestUtil.java
@@ -25,6 +25,7 @@ import java.util.Random;
 
 import org.apache.commons.jcs3.JCS;
 import org.apache.commons.jcs3.access.CacheAccess;
+import org.apache.commons.jcs3.auxiliary.lateral.LateralCacheAttributes;
 import org.apache.commons.jcs3.engine.CacheElement;
 import org.apache.commons.jcs3.engine.behavior.ICacheElement;
 
@@ -80,7 +81,7 @@ public class LateralTCPConcurrentRandomTestUtil
 
         final TCPLateralCacheAttributes lattr2 = new TCPLateralCacheAttributes();
         lattr2.setTcpListenerPort( 1103 );
-        lattr2.setTransmissionTypeName( "TCP" );
+        lattr2.setTransmissionType(LateralCacheAttributes.Type.TCP);
         lattr2.setTcpServer( "localhost:1102" );
 
         // this service will put and remove using the lateral to
diff --git a/commons-jcs-core/src/test/java/org/apache/commons/jcs3/auxiliary/lateral/socket/tcp/LateralTCPFilterRemoveHashCodeUnitTest.java b/commons-jcs-core/src/test/java/org/apache/commons/jcs3/auxiliary/lateral/socket/tcp/LateralTCPFilterRemoveHashCodeUnitTest.java
index 4eec002..6e9abd7 100644
--- a/commons-jcs-core/src/test/java/org/apache/commons/jcs3/auxiliary/lateral/socket/tcp/LateralTCPFilterRemoveHashCodeUnitTest.java
+++ b/commons-jcs-core/src/test/java/org/apache/commons/jcs3/auxiliary/lateral/socket/tcp/LateralTCPFilterRemoveHashCodeUnitTest.java
@@ -25,6 +25,7 @@ import java.io.Serializable;
 
 import org.apache.commons.jcs3.JCS;
 import org.apache.commons.jcs3.access.CacheAccess;
+import org.apache.commons.jcs3.auxiliary.lateral.LateralCacheAttributes;
 import org.apache.commons.jcs3.engine.CacheElement;
 import org.apache.commons.jcs3.engine.behavior.ICacheElement;
 
@@ -91,7 +92,7 @@ public class LateralTCPFilterRemoveHashCodeUnitTest
 
         final TCPLateralCacheAttributes lattr2 = new TCPLateralCacheAttributes();
         lattr2.setTcpListenerPort( 1102 );
-        lattr2.setTransmissionTypeName( "TCP" );
+        lattr2.setTransmissionType(LateralCacheAttributes.Type.TCP);
         lattr2.setTcpServer( "localhost:" + serverPort );
         lattr2.setIssueRemoveOnPut( true );
         // should still try to remove
diff --git a/commons-jcs-core/src/test/java/org/apache/commons/jcs3/auxiliary/lateral/socket/tcp/LateralTCPIssueRemoveOnPutUnitTest.java b/commons-jcs-core/src/test/java/org/apache/commons/jcs3/auxiliary/lateral/socket/tcp/LateralTCPIssueRemoveOnPutUnitTest.java
index 88bb9ad..9ae8606 100644
--- a/commons-jcs-core/src/test/java/org/apache/commons/jcs3/auxiliary/lateral/socket/tcp/LateralTCPIssueRemoveOnPutUnitTest.java
+++ b/commons-jcs-core/src/test/java/org/apache/commons/jcs3/auxiliary/lateral/socket/tcp/LateralTCPIssueRemoveOnPutUnitTest.java
@@ -25,6 +25,7 @@ import java.util.Random;
 
 import org.apache.commons.jcs3.JCS;
 import org.apache.commons.jcs3.access.CacheAccess;
+import org.apache.commons.jcs3.auxiliary.lateral.LateralCacheAttributes;
 import org.apache.commons.jcs3.engine.CacheElement;
 import org.apache.commons.jcs3.engine.behavior.ICacheElement;
 
@@ -88,7 +89,7 @@ public class LateralTCPIssueRemoveOnPutUnitTest
 
         final TCPLateralCacheAttributes lattr2 = new TCPLateralCacheAttributes();
         lattr2.setTcpListenerPort( 1102 );
-        lattr2.setTransmissionTypeName( "TCP" );
+        lattr2.setTransmissionType(LateralCacheAttributes.Type.TCP);
         lattr2.setTcpServer( "localhost:" + serverPort );
         lattr2.setIssueRemoveOnPut( false );
         // should still try to remove
@@ -135,7 +136,7 @@ public class LateralTCPIssueRemoveOnPutUnitTest
 
         final TCPLateralCacheAttributes lattr2 = new TCPLateralCacheAttributes();
         lattr2.setTcpListenerPort( 1102 );
-        lattr2.setTransmissionTypeName( "TCP" );
+        lattr2.setTransmissionType(LateralCacheAttributes.Type.TCP);
         lattr2.setTcpServer( "localhost:" + serverPort );
         lattr2.setIssueRemoveOnPut( true );
         // should still try to remove