aboutsummaryrefslogtreecommitdiffstats
path: root/bcel-builder/src
diff options
context:
space:
mode:
authorLars Grefer <eclipse@larsgrefer.de>2020-08-08 03:09:01 +0200
committerLars Grefer <eclipse@larsgrefer.de>2020-08-08 03:09:01 +0200
commita508fd5315c6330f2057c219aebc35b15d0ea497 (patch)
treec0ec3cef4e3411f22e5124ae36eba542a35a495a /bcel-builder/src
parent72194b7982ddfa8e9864d0a9934905bb76b90f33 (diff)
downloadaspectj-a508fd5315c6330f2057c219aebc35b15d0ea497.tar.gz
aspectj-a508fd5315c6330f2057c219aebc35b15d0ea497.zip
'while' loop replaceable with enhanced 'for' loop
Reports while loops which iterate over collections, and can be replaced with an enhanced for loop (i.e. foreach iteration syntax). Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
Diffstat (limited to 'bcel-builder/src')
-rw-r--r--bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionList.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionList.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionList.java
index dbdfb7fdb..dd010b758 100644
--- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionList.java
+++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionList.java
@@ -703,9 +703,7 @@ public class InstructionList implements Serializable {
Set<InstructionTargeter> targeters = ih.getTargeters();
boolean isOK = false;
- Iterator<InstructionTargeter> tIter = targeters.iterator();
- while (tIter.hasNext()) {
- InstructionTargeter instructionTargeter = tIter.next();
+ for (InstructionTargeter instructionTargeter : targeters) {
if (instructionTargeter.getClass().getName().endsWith("ShadowRange")
|| instructionTargeter.getClass().getName().endsWith("ExceptionRange")
|| instructionTargeter.getClass().getName().endsWith("LineNumberTag")) {