aboutsummaryrefslogtreecommitdiffstats
path: root/loadtime
diff options
context:
space:
mode:
Diffstat (limited to 'loadtime')
-rw-r--r--loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java b/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
index 45fb96d8a..3f4ad5729 100644
--- a/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
+++ b/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
@@ -21,9 +21,11 @@ import java.net.URL;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
+import java.util.Set;
import java.util.StringTokenizer;
import org.aspectj.asm.IRelationship;
@@ -193,10 +195,18 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor {
Enumeration xmls = weavingContext.getResources(st.nextToken());
// System.out.println("? registerDefinitions: found-aop.xml=" + xmls.hasMoreElements() + ", loader=" + loader);
+ Set seenBefore = new HashSet();
while (xmls.hasMoreElements()) {
URL xml = (URL) xmls.nextElement();
- info("using configuration " + weavingContext.getFile(xml));
- definitions.add(DocumentParser.parse(xml));
+ trace.event("parseDefinitions",this,xml);
+ if (!seenBefore.contains(xml)) {
+ info("using configuration " + weavingContext.getFile(xml));
+ definitions.add(DocumentParser.parse(xml));
+ seenBefore.add(xml);
+ }
+ else {
+ warn("ignoring duplicate definition: " + xml);
+ }
}
}
if (definitions.isEmpty()) {