You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@artemis.apache.org by cl...@apache.org on 2026/10/08 00:59:01 UTC

(artemis) branch main updated: ARTEMIS-6285 Document deprecation and what to use instead

This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/artemis.git


The following commit(s) were added to refs/heads/main by this push:
     new 3356dacf36 ARTEMIS-6285 Document deprecation and what to use instead
3356dacf36 is described below

commit 3356dacf3604bbb9bbd8c9c91353714bea8045d3
Author: Clebert Suconic <cl...@apache.org>
AuthorDate: Wed Oct 7 18:21:53 2026 -0400

    ARTEMIS-6285 Document deprecation and what to use instead
---
 .../activemq/artemis/utils/collections/ConcurrentHashSet.java       | 6 ++++++
 .../apache/activemq/artemis/utils/collections/ConcurrentSet.java    | 1 +
 2 files changed, 7 insertions(+)

diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentHashSet.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentHashSet.java
index 663225199c..7aa9a3958d 100644
--- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentHashSet.java
+++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentHashSet.java
@@ -25,6 +25,12 @@ import java.util.concurrent.ConcurrentMap;
  * A ConcurrentHashSet.
  * <p>
  * Offers same concurrency as ConcurrentHashMap but for a Set
+ *
+ * @deprecated Use {@link java.util.concurrent.ConcurrentHashMap#newKeySet()} instead.
+ * For example, replace:
+ * <pre>{@code Set<String> set = new ConcurrentHashSet<>();}</pre>
+ * with:
+ * <pre>{@code Set<String> set = ConcurrentHashMap.newKeySet();}</pre>
  */
 @Deprecated(forRemoval = true)
 public class ConcurrentHashSet<E> extends AbstractSet<E> implements ConcurrentSet<E> {
diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentSet.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentSet.java
index 3ff6f6f74a..526a40bc63 100644
--- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentSet.java
+++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentSet.java
@@ -22,6 +22,7 @@ import java.util.Set;
  * A ConcurrentSet
  *
  * @param <E> The generic class
+ * @deprecated Use {@link java.util.Set} with {@link java.util.concurrent.ConcurrentHashMap#newKeySet()} instead.
  */
 @Deprecated(forRemoval = true)
 public interface ConcurrentSet<E> extends Set<E> {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@artemis.apache.org
For additional commands, e-mail: commits-help@artemis.apache.org