From 8020246860aa8ff999acf40f199a8522d4496d93 Mon Sep 17 00:00:00 2001 From: rfeng Date: Fri, 9 Oct 2009 22:52:54 +0000 Subject: 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 --- .../sca/definitions/xml/DefaultDefinitionsExtensionPoint.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'java/sca/modules') 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 documents = new ArrayList(); + private Set documents = new HashSet(); private List definitions = new ArrayList(); 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); } -- cgit v1.2.3