diff options
author | aclement <aclement> | 2008-08-28 01:46:50 +0000 |
---|---|---|
committer | aclement <aclement> | 2008-08-28 01:46:50 +0000 |
commit | acec9ef0ced82ef699352c250065f9d9b81bdf07 (patch) | |
tree | abb19d7f51917d7c924f5de17005568e7ad7f045 | |
parent | 710fe91de150dd86b7e8a82575b0a4024660ebce (diff) | |
download | aspectj-acec9ef0ced82ef699352c250065f9d9b81bdf07.tar.gz aspectj-acec9ef0ced82ef699352c250065f9d9b81bdf07.zip |
switch to using iterator set
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/Utility.java | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/Utility.java b/weaver/src/org/aspectj/weaver/bcel/Utility.java index 6d2a98f71..1fe85e37d 100644 --- a/weaver/src/org/aspectj/weaver/bcel/Utility.java +++ b/weaver/src/org/aspectj/weaver/bcel/Utility.java @@ -21,6 +21,7 @@ import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Collections; import java.util.Hashtable; +import java.util.Iterator; import java.util.List; import org.aspectj.apache.bcel.Constants; @@ -597,7 +598,7 @@ public class Utility { LazyMethodGen enclosingMethod) { InstructionList il = enclosingMethod.getBody(); - InstructionTargeter[] targeters = ih.getTargeters(); + InstructionTargeter[] targeters = ih.getTargetersArray(); if (targeters != null) { for (int i = targeters.length - 1; i >= 0; i--) { InstructionTargeter targeter = targeters[i]; @@ -669,16 +670,13 @@ public class Utility { // arbitrary rule that we will never lookahead more than 100 instructions for a line # while (lookahead++ < 100) { if (ih == null) return -1; - - InstructionTargeter[] ts = ih.getTargeters(); - if (ts != null) { - for (int j = ts.length - 1; j >= 0; j--) { - InstructionTargeter t = ts[j]; + Iterator tIter = ih.getTargeters().iterator(); + while (tIter.hasNext()) { + InstructionTargeter t = (InstructionTargeter)tIter.next(); if (t instanceof LineNumberTag) { return ((LineNumberTag)t).getLineNumber(); } } - } // if (goforwards) ih=ih.getNext(); else ih=ih.getPrev(); } |