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


The following commit(s) were added to refs/heads/master by this push:
     new 65a20416 Merge back changes from branch release-3.2
65a20416 is described below

commit 65a2041632303f32e666fcddc750f45609335e20
Author: Thomas Vandahl <t...@apache.org>
AuthorDate: Tue Aug 22 16:54:58 2023 +0200

    Merge back changes from branch release-3.2
---
 .../jcs3/auxiliary/disk/PurgatoryElement.java      | 43 +++++++++++++++++++---
 .../jcs3/engine/CacheElementSerialized.java        | 28 ++++++++++++--
 .../jcs3/utils/discovery/UDPDiscoveryReceiver.java |  2 +-
 pom.xml                                            | 19 ++++++++++
 4 files changed, 81 insertions(+), 11 deletions(-)

diff --git 
a/commons-jcs3-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/PurgatoryElement.java
 
b/commons-jcs3-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/PurgatoryElement.java
index 593356eb..d334e1c6 100644
--- 
a/commons-jcs3-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/PurgatoryElement.java
+++ 
b/commons-jcs3-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/PurgatoryElement.java
@@ -1,5 +1,7 @@
 package org.apache.commons.jcs3.auxiliary.disk;
 
+import java.util.Objects;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -135,6 +137,35 @@ public class PurgatoryElement<K, V>
         cacheElement.setElementAttributes( attr );
     }
 
+    /**
+     * @param obj other object
+     * @return true if this object key equals the key of obj
+     */
+    @Override
+    public boolean equals(final Object obj)
+    {
+        if (this == obj)
+        {
+            return true;
+        }
+        if (!(obj instanceof PurgatoryElement))
+        {
+            return false;
+        }
+        final PurgatoryElement<?,?> other = (PurgatoryElement<?,?>) obj;
+        return Objects.equals(getKey(), other.getKey());
+    }
+
+    /**
+     * @return a hash of the key only
+     */
+    @Override
+    public int hashCode()
+    {
+        return getKey().hashCode();
+    }
+
+
     /**
      * @return debug string
      */
@@ -143,12 +174,12 @@ public class PurgatoryElement<K, V>
     {
         final StringBuilder buf = new StringBuilder();
         buf.append( "[PurgatoryElement: " );
-        buf.append( " isSpoolable = " + isSpoolable() );
-        buf.append( " CacheElement = " + getCacheElement() );
-        buf.append( " CacheName = " + getCacheName() );
-        buf.append( " Key = " + getKey() );
-        buf.append( " Value = " + getVal() );
-        buf.append( " ElementAttributes = " + getElementAttributes() );
+        buf.append( " isSpoolable = ").append(isSpoolable());
+        buf.append( " CacheElement = ").append(getCacheElement());
+        buf.append( " CacheName = ").append(getCacheName());
+        buf.append( " Key = ").append(getKey());
+        buf.append( " Value = ").append(getVal());
+        buf.append( " ElementAttributes = ").append(getElementAttributes());
         buf.append( "]" );
         return buf.toString();
     }
diff --git 
a/commons-jcs3-core/src/main/java/org/apache/commons/jcs3/engine/CacheElementSerialized.java
 
b/commons-jcs3-core/src/main/java/org/apache/commons/jcs3/engine/CacheElementSerialized.java
index 17788ba1..f7a5dfb9 100644
--- 
a/commons-jcs3-core/src/main/java/org/apache/commons/jcs3/engine/CacheElementSerialized.java
+++ 
b/commons-jcs3-core/src/main/java/org/apache/commons/jcs3/engine/CacheElementSerialized.java
@@ -20,6 +20,7 @@ package org.apache.commons.jcs3.engine;
  */
 
 import java.util.Arrays;
+import java.util.Objects;
 
 import org.apache.commons.jcs3.engine.behavior.ICacheElementSerialized;
 import org.apache.commons.jcs3.engine.behavior.IElementAttributes;
@@ -57,6 +58,25 @@ public class CacheElementSerialized<K, V>
         return this.serializedValue;
     }
 
+    /**
+     * @param obj other object
+     * @return true if this object key equals the key of obj
+     */
+    @Override
+    public boolean equals(final Object obj)
+    {
+        if (this == obj)
+        {
+            return true;
+        }
+        if (!(obj instanceof CacheElementSerialized))
+        {
+            return false;
+        }
+        final CacheElementSerialized<?,?> other = 
(CacheElementSerialized<?,?>) obj;
+        return Objects.equals(getKey(), other.getKey());
+    }
+
     /**
      * For debugging only.
      * <p>
@@ -67,10 +87,10 @@ public class CacheElementSerialized<K, V>
     {
         final StringBuilder buf = new StringBuilder();
         buf.append( "\n CacheElementSerialized: " );
-        buf.append( "\n CacheName = [" + getCacheName() + "]" );
-        buf.append( "\n Key = [" + getKey() + "]" );
-        buf.append( "\n SerializedValue = " + 
Arrays.toString(getSerializedValue()) );
-        buf.append( "\n ElementAttributes = " + getElementAttributes() );
+        buf.append( "\n CacheName = [").append(getCacheName()).append("]");
+        buf.append( "\n Key = [").append(getKey()).append("]");
+        buf.append( "\n SerializedValue = 
").append(Arrays.toString(getSerializedValue()));
+        buf.append( "\n ElementAttributes = ").append(getElementAttributes());
         return buf.toString();
     }
 
diff --git 
a/commons-jcs3-core/src/main/java/org/apache/commons/jcs3/utils/discovery/UDPDiscoveryReceiver.java
 
b/commons-jcs3-core/src/main/java/org/apache/commons/jcs3/utils/discovery/UDPDiscoveryReceiver.java
index ca025ce7..573197e9 100644
--- 
a/commons-jcs3-core/src/main/java/org/apache/commons/jcs3/utils/discovery/UDPDiscoveryReceiver.java
+++ 
b/commons-jcs3-core/src/main/java/org/apache/commons/jcs3/utils/discovery/UDPDiscoveryReceiver.java
@@ -87,7 +87,7 @@ public class UDPDiscoveryReceiver
     /**
      * Constructor for the UDPDiscoveryReceiver object.
      * <p>
-     * We determine out own host using InetAddress
+     * We determine our own host using InetAddress
      *<p>
      * @param service
      * @param multicastInterfaceString
diff --git a/pom.xml b/pom.xml
index 2162efe7..318e858e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -531,6 +531,25 @@
               <releaseProfiles>release</releaseProfiles>
             </configuration>
           </plugin>
+          <!-- Disable commons-release-plugin -->
+          <plugin>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-release-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>clean-staging</id>
+                <phase>none</phase>
+              </execution>
+              <execution>
+                <id>detatch-distributions</id>
+                <phase>none</phase>
+              </execution>
+              <execution>
+                <id>stage-distributions</id>
+                <phase>none</phase>
+              </execution>
+            </executions>
+          </plugin>
         </plugins>
       </build>
     </profile>

Reply via email to