From 2fe313d51f7161bb90a44d8cd3f32b57345859a0 Mon Sep 17 00:00:00 2001 From: antelder Date: Mon, 4 Apr 2011 14:39:15 +0000 Subject: Validate the Spring beans xml service names are unique git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1088641 13f79535-47bb-0310-9956-ffa450edef68 --- .../spring/introspect/SpringXMLComponentTypeLoader.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany') diff --git a/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java b/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java index 8c58ef0cf9..35543a87fe 100644 --- a/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java +++ b/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java @@ -708,6 +708,16 @@ public class SpringXMLComponentTypeLoader { List scaproperties, Monitor monitor) throws ContributionReadException { + // The value of the @name attribute of an subelement of a element + // MUST be unique amongst the subelements of the element. + for (SpringSCAServiceElement serviceElement : services) { + for (SpringSCAServiceElement x : services) { + if (serviceElement != x && serviceElement.getName().equals(x.getName())) { + error(monitor, "ScaServiceNameNotUnique", beans); + } + } + } + // The @target attribute of a subelement of a element // MUST have the value of the @name attribute of one of the // subelements of the element. -- cgit v1.2.3