From: ehilsdal Date: Wed, 20 Aug 2003 22:25:01 +0000 (+0000) Subject: Still patching for bug 39470 (patch devised by Andy, vetted by me). X-Git-Tag: V1_1_1~71 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1c2077ea4994f8d268f89a1c85d482d82f97f876;p=aspectj.git 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. --- 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.