Index: src/org/aspectj/weaver/bcel/BcelWeaver.java =================================================================== RCS file: /home/technology/org.aspectj/modules/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java,v retrieving revision 1.53 diff -u -r1.53 BcelWeaver.java --- src/org/aspectj/weaver/bcel/BcelWeaver.java 17 May 2005 08:29:18 -0000 1.53 +++ src/org/aspectj/weaver/bcel/BcelWeaver.java 6 Jun 2005 09:45:56 -0000 @@ -974,6 +974,18 @@ UnwovenClassFile clf = (UnwovenClassFile) iter.next(); typesToProcess.add(clf.getClassName()); } + + String duplicate = containsDuplicates(typesToProcess); + if (duplicate != null){ + System.err.println("Error: duplicate type \"" + duplicate + "\""); + System.err.println(); + System.err.println("This may be caused by bug 98120 in jdt."); + System.err.println("If so the workaround is to not put dollar signs in type names, " + + "If there wasn't\na dollar sign in the duplicate type please report this as a bug in AspectJ" + + " and\ninclude this message in the bug report."); + return new ArrayList(); + } + while (typesToProcess.size()>0) { weaveParentsFor(typesToProcess,(String)typesToProcess.get(0)); } @@ -1489,4 +1501,20 @@ public World getWorld() { return world; } + + public static String containsDuplicates(List l){ + // this method should be somewhere else + // returns the first duplicate object in l + for (int i = 0; i < l.size(); i++){ + String s1 = (String)l.get(i); + for (int j = i+1; j < l.size(); j++){ + String s2 = (String)l.get(j); + if (s1.equals(s2)){ + return s1; + } + } + } + return null; + } + }