[ https://issues.apache.org/jira/browse/QPID-8706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18010614#comment-18010614 ]
Daniil Kirilyuk commented on QPID-8706: --------------------------------------- Hi Robert, Thank you for the feedback. The main goal of this change was the improvement of the code readability. Currently some Symbols are inlined in the code while other are declared as constants, e.g. in org.apache.qpid.server.protocol.v1_0.AMQPConnection_1_0: {code:java} Symbol ANONYMOUS_RELAY = Symbol.valueOf("ANONYMOUS-RELAY"); Symbol SHARED_SUBSCRIPTIONS = Symbol.valueOf("SHARED-SUBS");{code} in org.apache.qpid.server.protocol.v1_0.AMQPConnection_1_0Impl: {code:java} if (remoteProperties.containsKey(Symbol.valueOf("product"))) { setClientProduct(remoteProperties.get(Symbol.valueOf("product")).toString()); } if (remoteProperties.containsKey(Symbol.valueOf("version"))) { setClientVersion(remoteProperties.get(Symbol.valueOf("version")).toString()); }{code} {code:java} error.setInfo(Map.of(Symbol.valueOf("sole-connection-enforcement"), true));{code} in org.apache.qpid.server.protocol.v1_0.StandardReceivingLinkEndpoint {code:java} private static final Symbol DELIVERY_TAG = Symbol.valueOf("delivery-tag");{code} {code:java} if (desiredCapabilities.contains(Symbol.valueOf("temporary-topic"))) { targetCapabilities.add(Symbol.valueOf("temporary-topic")); } if (desiredCapabilities.contains(Symbol.valueOf("temporary-queue"))) { targetCapabilities.add(Symbol.valueOf("temporary-queue")); } if (desiredCapabilities.contains(Symbol.valueOf("topic"))) { targetCapabilities.add(Symbol.valueOf("topic")); }{code} org.apache.qpid.server.protocol.v1_0.MessageMetaData_1_0 even has a comment stating a need of change: {code:java} // TODO move to somewhere more useful private static final Symbol DELIVERY_TIME = Symbol.valueOf("x-opt-delivery-time"); private static final Symbol NOT_VALID_BEFORE = Symbol.valueOf("x-qpid-not-valid-before");{code} We'd like to unify the approach and to organize the the Symbol constants in the amqp-1-0-protocol plugin. What would be the preferred way to achieve that from your perspective? Kind regards, Daniil > Move AMQP-1.0 symbols declarations to a utility class > ----------------------------------------------------- > > Key: QPID-8706 > URL: https://issues.apache.org/jira/browse/QPID-8706 > Project: Qpid > Issue Type: Improvement > Components: Broker-J > Affects Versions: qpid-java-broker-9.2.1 > Reporter: Daniil Kirilyuk > Priority: Minor > Fix For: qpid-java-broker-10.0.0 > > > Currently in qpid-broker-plugins-amqp-1-0-protocol all Symbol instance are > created via Symbol.valueOf(). Although they are cached internally, to improve > the code readability it would be beneficial to move all constant Symbols to > the utility class as public static final constants. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org