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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact