Skip to content

[5.19.x] Replace active temp dests map with set (#2113)#2115

Merged
cshannon merged 1 commit into
apache:activemq-5.19.xfrom
cshannon:backport-2113-5.19.x
Jun 15, 2026
Merged

[5.19.x] Replace active temp dests map with set (#2113)#2115
cshannon merged 1 commit into
apache:activemq-5.19.xfrom
cshannon:backport-2113-5.19.x

Conversation

@cshannon

Copy link
Copy Markdown
Contributor

For some reason ActiveMQConnection was using a map instead of a set to store the destinations, and just stored the exact same thing as the key and value. Furthermore, when checking if the map contained the destination a call was being made to containsValue() which requires iterating over the entire map.

This commit replaced the Map with a Set which simplifies things and makes the contains() check constant. Also, the scope of the set was changed from public to package because it makes no sense to have the scope as public and should be limited to only classes in the same package.

(cherry picked from commit b20a4c7)

For some reason ActiveMQConnection was using a map instead of a set to
store the destinations, and just stored the exact same thing as the key
and value. Furthermore, when checking if the map contained the
destination a call was being made to containsValue() which requires
iterating over the entire map.

This commit replaced the Map with a Set which simplifies things and
makes the contains() check constant. Also, the scope of the set was
changed from public to package because it makes no sense to have the
scope as public and should be limited to only classes in the same
package.

(cherry picked from commit b20a4c7)
@cshannon cshannon self-assigned this Jun 15, 2026
@cshannon cshannon merged commit 4e541f6 into apache:activemq-5.19.x Jun 15, 2026
3 of 4 checks passed
@cshannon cshannon deleted the backport-2113-5.19.x branch June 15, 2026 16:28
@github-project-automation github-project-automation Bot moved this from Todo to Done in Apache ActiveMQ v5.19.8 Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant