From 99e39f5f1c59d0dc5baa0405b143b17a71e8119f Mon Sep 17 00:00:00 2001 From: Jiri Danek Date: Thu, 14 Feb 2019 15:43:52 +0100 Subject: [PATCH] NO-JIRA Fix a "Inefficient Map Iterator" SpotBugs warning https://spotbugs.readthedocs.io/en/stable/bugDescriptions.html#wmi-inefficient-use-of-keyset-iterator-instead-of-entryset-iterator-wmi-wrong-map-iterator --- .../artemis/core/management/impl/AbstractControl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AbstractControl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AbstractControl.java index a6d531a978..fe09a39a94 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AbstractControl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AbstractControl.java @@ -106,8 +106,8 @@ public abstract class AbstractControl extends StandardMBean { 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 header : headers.entrySet()) { + message.putStringProperty(new SimpleString(header.getKey()), new SimpleString(headers.get(header.getValue()))); } } message.setType((byte) type);