diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-10-09 22:52:54 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-10-09 22:52:54 +0000 |
commit | 8020246860aa8ff999acf40f199a8522d4496d93 (patch) | |
tree | 3f19f8025761086bb08da59201fc3bd647431b83 /java/sca/modules | |
parent | 33d23ef98d773ca21c98a4a297a890677ad5cfff (diff) |
Use a Set to avoid duplicate definitions.xml resources
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@823727 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefaultDefinitionsExtensionPoint.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefaultDefinitionsExtensionPoint.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefaultDefinitionsExtensionPoint.java index 01bf8ceb2c..cf2d0ea5e3 100644 --- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefaultDefinitionsExtensionPoint.java +++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefaultDefinitionsExtensionPoint.java @@ -19,13 +19,14 @@ package org.apache.tuscany.sca.definitions.xml; -import java.io.FileNotFoundException; import java.io.IOException; import java.net.URI; import java.net.URL; import java.util.ArrayList; import java.util.Collection; +import java.util.HashSet; import java.util.List; +import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; @@ -46,7 +47,7 @@ public class DefaultDefinitionsExtensionPoint implements DefinitionsExtensionPoi private static final Logger logger = Logger.getLogger(DefaultDefinitionsExtensionPoint.class.getName()); private static final URI DEFINITIONS_URI = URI.create("META-INF/definitions.xml"); private ExtensionPointRegistry registry; - private List<URL> documents = new ArrayList<URL>(); + private Set<URL> documents = new HashSet<URL>(); private List<Definitions> definitions = new ArrayList<Definitions>(); private boolean documentsLoaded; private boolean loaded; @@ -83,7 +84,7 @@ public class DefaultDefinitionsExtensionPoint implements DefinitionsExtensionPoi for (ServiceDeclaration definitionsDeclaration : definitionsDeclarations) { URL url = definitionsDeclaration.getResource(definitionsDeclaration.getClassName()); if (url == null) { - throw new IllegalArgumentException(new FileNotFoundException(definitionsDeclaration.getClassName())); + throw new IllegalArgumentException(definitionsDeclaration.getClassName() + " cannot be found"); } documents.add(url); } |