jbertram 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_r281343967
 
 

 ##########
 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:
   I realized it was broken when 
[ARTEMIS-2332](https://issues.apache.org/jira/browse/ARTEMIS-2332) was opened 
and I took a look to see what the problem might be. I've got a fix for it, but 
not yet a test. Will send a PR when it's all ready.

----------------------------------------------------------------
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