Author: antelder
Date: Mon Apr 4 14:39:15 2011
New Revision: 1088641
URL: http://svn.apache.org/viewvc?rev=1088641&view=rev
Log:
Validate the Spring beans xml service names are unique
Modified:
tuscany/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java
Modified:
tuscany/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java?rev=1088641&r1=1088640&r2=1088641&view=diff
==============================================================================
---
tuscany/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java
(original)
+++
tuscany/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java
Mon Apr 4 14:39:15 2011
@@ -708,6 +708,16 @@ public class SpringXMLComponentTypeLoade
List<SpringSCAPropertyElement> scaproperties,
Monitor monitor) throws
ContributionReadException {
+ // The value of the @name attribute of an <sca:service/> subelement of
a <beans/> element
+ // MUST be unique amongst the <service/> subelements of the <beans/>
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 <service/> subelement of a <beans/>
element
// MUST have the value of the @name attribute of one of the <bean/>
// subelements of the <beans/> element.