jbertram commented on code in PR #5487:
URL: https://github.com/apache/activemq-artemis/pull/5487#discussion_r1952034684


##########
artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java:
##########
@@ -1380,16 +1380,16 @@ public CompositeData toCompositeData(int fieldsLimit, 
int deliveryCount) throws
       CompositeType ct;
       Map<String, Object> fields;
       byte type = getType();
-      switch (type) {
-         case Message.TEXT_TYPE:
+      fields = switch (type) {

Review Comment:
   Fixed.



##########
artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ChannelImpl.java:
##########
@@ -171,34 +171,21 @@ public boolean supports(final byte packetType) {
 
    @Override
    public boolean supports(final byte packetType, int version) {
-      switch (packetType) {
-         case PacketImpl.CLUSTER_TOPOLOGY_V2:
-            return version >= 122;
-         case PacketImpl.DISCONNECT_CONSUMER:
-            return version >= 124;
-         case PacketImpl.CLUSTER_TOPOLOGY_V3:
-            return version >= 125;
-         case PacketImpl.DISCONNECT_V2:
-            return version >= 125;
-         case PacketImpl.SESS_QUEUEQUERY_RESP_V2:
-            return version >= 126;
-         case PacketImpl.SESS_BINDINGQUERY_RESP_V2:
-            return version >= 126;
-         case PacketImpl.SESS_BINDINGQUERY_RESP_V3:
-            return version >= 127;
-         case PacketImpl.SESS_QUEUEQUERY_RESP_V3:
-            return version >= 129;
-         case PacketImpl.SESS_BINDINGQUERY_RESP_V4:
-            return version >= 129;
-         case PacketImpl.CLUSTER_TOPOLOGY_V4:
-         case PacketImpl.CREATESESSION_V2:
-         case PacketImpl.DISCONNECT_V3:
-            return version >= PacketImpl.ARTEMIS_2_18_0_VERSION;
-         case PacketImpl.SESS_BINDINGQUERY_RESP_V5:
-            return version >= PacketImpl.ARTEMIS_2_29_0_VERSION;
-         default:
-            return true;
-      }
+      return switch (packetType) {
+         case PacketImpl.CLUSTER_TOPOLOGY_V2 -> version >= 122;
+         case PacketImpl.DISCONNECT_CONSUMER -> version >= 124;
+         case PacketImpl.CLUSTER_TOPOLOGY_V3 -> version >= 125;
+         case PacketImpl.DISCONNECT_V2 -> version >= 125;
+         case PacketImpl.SESS_QUEUEQUERY_RESP_V2 -> version >= 126;
+         case PacketImpl.SESS_BINDINGQUERY_RESP_V2 -> version >= 126;
+         case PacketImpl.SESS_BINDINGQUERY_RESP_V3 -> version >= 127;
+         case PacketImpl.SESS_QUEUEQUERY_RESP_V3 -> version >= 129;
+         case PacketImpl.SESS_BINDINGQUERY_RESP_V4 -> version >= 129;
+         case PacketImpl.CLUSTER_TOPOLOGY_V4, PacketImpl.CREATESESSION_V2, 
PacketImpl.DISCONNECT_V3 ->
+            version >= PacketImpl.ARTEMIS_2_18_0_VERSION;

Review Comment:
   Fixed.



-- 
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: gitbox-unsubscr...@activemq.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org
For additional commands, e-mail: gitbox-h...@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact


Reply via email to