From 5f660e23d932d83e676e9760bc0ff4552e2a64fb Mon Sep 17 00:00:00 2001 From: rfeng Date: Tue, 18 Aug 2009 18:40:59 +0000 Subject: Add contribution to the error message git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@805535 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/sca/assembly/xml/CompositeModelResolver.java | 16 ++++++++-------- .../assembly-xml-validation-messages.properties | 3 ++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeModelResolver.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeModelResolver.java index 1f8fbd2d21..b9c6516a68 100644 --- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeModelResolver.java +++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeModelResolver.java @@ -50,14 +50,14 @@ public class CompositeModelResolver implements ModelResolver { public void addModel(Object resolved) { Composite composite = (Composite)resolved; - if (map.containsKey(composite.getName())){ - Monitor.error(monitor, - this, - "assembly-validation-messages", - "DuplicateCompositeName", - composite.getName().toString()); - } else { - map.put(composite.getName(), composite); + Composite old = map.put(composite.getName(), composite); + if (old != null) { + Monitor.error(monitor, + this, + "assembly-xml-validation-messages", + "DuplicateCompositeName", + composite.getName().toString(), + contribution.getLocation()); } } diff --git a/java/sca/modules/assembly-xml/src/main/resources/assembly-xml-validation-messages.properties b/java/sca/modules/assembly-xml/src/main/resources/assembly-xml-validation-messages.properties index 8e80fd8231..94e462fc96 100644 --- a/java/sca/modules/assembly-xml/src/main/resources/assembly-xml-validation-messages.properties +++ b/java/sca/modules/assembly-xml/src/main/resources/assembly-xml-validation-messages.properties @@ -27,4 +27,5 @@ PolicyServiceValidationException = PolicyValidation exceptions when processing s ContributionReadException = ContributionReadException occured due to : {0} ContributionWriteException = ContributionWriteException occured due to : {0} XMLStreamException = XMLStreamException occured due to : {0} -DuplicateCompositeName = Found more than one composite with the name : {0} +DuplicateCompositeName = [ASM_6001] More than one composite with the same name {0} found in contribution {1} + -- cgit v1.2.3