diff options
author | ehilsdal <ehilsdal> | 2003-08-20 22:25:01 +0000 |
---|---|---|
committer | ehilsdal <ehilsdal> | 2003-08-20 22:25:01 +0000 |
commit | 1c2077ea4994f8d268f89a1c85d482d82f97f876 (patch) | |
tree | c9b41873145139ffb3f4fc80240687056add0fb9 | |
parent | a082a84bda0002618f48590e0f6a593b3de7ae7c (diff) | |
download | aspectj-1c2077ea4994f8d268f89a1c85d482d82f97f876.tar.gz aspectj-1c2077ea4994f8d268f89a1c85d482d82f97f876.zip |
Still patching for bug 39470 (patch devised by Andy, vetted by me).
Sorting the local variables so we can deal with the fact that BCEL
generates extra local variables and doesn't bother to make them
hashable.
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java b/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java index dd011f6c3..0d9db5bdf 100644 --- a/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java +++ b/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java @@ -17,6 +17,8 @@ import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.lang.reflect.Modifier; import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -871,7 +873,15 @@ public final class LazyMethodGen { Map duplicatedLocalMap = new HashMap(); - for (Iterator iter = localVariableStarts.keySet().iterator(); iter.hasNext(); ) { + List keys = new ArrayList(); + keys.addAll(localVariableStarts.keySet()); + Collections.sort(keys,new Comparator() { + public int compare(Object a,Object b) { + LocalVariableTag taga = (LocalVariableTag)a; + LocalVariableTag tagb = (LocalVariableTag)b; + return taga.getName().compareTo(tagb.getName()); + }}); + for (Iterator iter = keys.iterator(); iter.hasNext(); ) { LocalVariableTag tag = (LocalVariableTag) iter.next(); // have we already added one with the same slot number and start location? // if so, just continue. |