[
https://issues.apache.org/jira/browse/ARTEMIS-5744?focusedWorklogId=990986&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-990986
]
ASF GitHub Bot logged work on ARTEMIS-5744:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 10/Nov/25 16:28
Start Date: 10/Nov/25 16:28
Worklog Time Spent: 10m
Work Description: brusdev commented on code in PR #6029:
URL: https://github.com/apache/activemq-artemis/pull/6029#discussion_r2511213016
##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AddressInfo.java:
##########
@@ -102,6 +102,17 @@ public void setSwept(boolean swept) {
private AddressInfo() {
}
+ /**
+ * Constructs a new {@code AddressInfo} object by copying the name and
routing types
+ * from another {@code AddressInfo} instance.
+ *
+ * @param other the {@code AddressInfo} instance to copy from. The name and
routing types
+ * from this instance will be used to initialize the new
{@code AddressInfo}.
+ */
+ public AddressInfo(AddressInfo other) {
+ this(other.getName(), EnumSet.copyOf(other.getRoutingTypes()));
+ }
Review Comment:
The partial copy constructor is only used one time, reusing the existing
constructor seems a win-win:
- less code: 3 lines :wink:
- clearer code: checkAutoCreate only needs to clone the name and the
routingTypes
Issue Time Tracking
-------------------
Worklog Id: (was: 990986)
Time Spent: 40m (was: 0.5h)
> Don't modify AddressInfo during auto-create checks
> --------------------------------------------------
>
> Key: ARTEMIS-5744
> URL: https://issues.apache.org/jira/browse/ARTEMIS-5744
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Reporter: Justin Bertram
> Assignee: Justin Bertram
> Priority: Major
> Labels: pull-request-available
> Time Spent: 40m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact