summaryrefslogtreecommitdiffstats
path: root/loadtime
diff options
context:
space:
mode:
authormwebster <mwebster>2006-09-15 11:13:14 +0000
committermwebster <mwebster>2006-09-15 11:13:14 +0000
commitd46c28243e5bafd2390f5356f5d77388af046bc1 (patch)
tree9b8f5368e51a67c28d05da909eb544af0f05fe5e /loadtime
parent478d55f8bd604ee7a652c8be5012ec531da04308 (diff)
downloadaspectj-d46c28243e5bafd2390f5356f5d77388af046bc1.tar.gz
aspectj-d46c28243e5bafd2390f5356f5d77388af046bc1.zip
ignore duplicate aop.xml definition
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()) {