michaelandrepearce commented on a change in pull request #2553: NO-JIRA Fix a 
"Inefficient Map Iterator" SpotBugs warning
URL: https://github.com/apache/activemq-artemis/pull/2553#discussion_r281450967
 
 

 ##########
 File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AbstractControl.java
 ##########
 @@ -106,8 +106,8 @@ protected String sendMessage(SimpleString address,
       try {
          CoreMessage message = new CoreMessage(storageManager.generateID(), 
50);
          if (headers != null) {
-            for (String header : headers.keySet()) {
-               message.putStringProperty(new SimpleString(header), new 
SimpleString(headers.get(header)));
+            for (Map.Entry<String, String> header : headers.entrySet()) {
+               message.putStringProperty(new SimpleString(header.getKey()), 
new SimpleString(headers.get(header.getValue())));
 
 Review comment:
   Do you even need "new SimpleString" on the values? The underlying message 
will convert to simplestring if 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