From 72194b7982ddfa8e9864d0a9934905bb76b90f33 Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Sat, 8 Aug 2020 03:06:37 +0200 Subject: 'for' loop replaceable with enhanced 'for' loop Reports for loops which iterate over collections or arrays, and can be replaced with an enhanced for loop (i.e. the foreach iteration syntax). Signed-off-by: Lars Grefer --- org.aspectj.matcher/src/main/java/org/aspectj/weaver/Lint.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'org.aspectj.matcher/src/main/java/org/aspectj/weaver/Lint.java') diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Lint.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Lint.java index aab34b8f6..7307ab93c 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Lint.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Lint.java @@ -234,8 +234,8 @@ public class Lint { @SuppressWarnings("rawtypes") public void setFromProperties(Properties properties) { - for (Iterator i = properties.entrySet().iterator(); i.hasNext();) { - Map.Entry entry = (Map.Entry) i.next(); + for (Map.Entry objectObjectEntry : properties.entrySet()) { + Map.Entry entry = (Map.Entry) objectObjectEntry; Kind kind = kinds.get(entry.getKey()); if (kind == null) { MessageUtil.error(world.getMessageHandler(), WeaverMessages.format(WeaverMessages.XLINT_KEY_ERROR, entry.getKey())); -- cgit v1.2.3