summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-08-18 18:40:59 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-08-18 18:40:59 +0000
commit5f660e23d932d83e676e9760bc0ff4552e2a64fb (patch)
treec79b30d44175c582eab3fd7163db4435a60058df
parenta72c2bf1b530456e1f467c64044cc3c2174e4408 (diff)
Add contribution to the error message
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@805535 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeModelResolver.java16
-rw-r--r--java/sca/modules/assembly-xml/src/main/resources/assembly-xml-validation-messages.properties3
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}
+