michaelandrepearce commented on a change in pull request #2592: ARTEMIS-2285 
Sorting by user column in connections view not working
URL: https://github.com/apache/activemq-artemis/pull/2592#discussion_r273719449
 
 

 ##########
 File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/view/ConnectionView.java
 ##########
 @@ -83,12 +83,12 @@ public Object getField(RemotingConnection connection, 
String fieldName) {
          case "remoteAddress":
             return connection.getRemoteAddress();
          case "users":
-            Set<String> users = new HashSet<>();
+            Set<String> users = new TreeSet<>();
             for (ServerSession session : sessions) {
                String username = session.getUsername() == null ? "" : 
session.getUsername();
                users.add(username);
             }
-            return users;
+            return StringUtil.joinStringList(users, ",");
 
 Review comment:
   Whilst i understand change from HashSet to TreeSet to give ordering, the 
return shouldn't change the type, e.g just return users still. Or im missing 
something.... i guess a test may help to describe/show why its needed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to