summaryrefslogtreecommitdiffstats
path: root/java/sca
diff options
context:
space:
mode:
Diffstat (limited to 'java/sca')
-rw-r--r--java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentProcessor.java10
-rw-r--r--java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/policy/xml/policy-xml-validation-messages.properties1
2 files changed, 10 insertions, 1 deletions
diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentProcessor.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentProcessor.java
index ac4f81d5a9..49960cf6e8 100644
--- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentProcessor.java
+++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentProcessor.java
@@ -149,7 +149,15 @@ public class IntentProcessor extends BaseStAXArtifactProcessor implements StAXAr
qualified.setType(intent.getType());
qualified.setName(new QName(qualifiedIntentName));
if (isDefault) {
- intent.setDefaultQualifiedIntent(qualified);
+ if (intent.getDefaultQualifiedIntent() == null){
+ intent.setDefaultQualifiedIntent(qualified);
+ } else {
+ Monitor.error(context.getMonitor(),
+ this,
+ Messages.RESOURCE_BUNDLE,
+ "MultipleDefaultQualifiers",
+ intent.getName().toString());
+ }
}
intent.getQualifiedIntents().add(qualified);
qualified.setQualifiableIntent(intent);
diff --git a/java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/policy/xml/policy-xml-validation-messages.properties b/java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/policy/xml/policy-xml-validation-messages.properties
index d092b5959a..6fb369f73f 100644
--- a/java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/policy/xml/policy-xml-validation-messages.properties
+++ b/java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/policy/xml/policy-xml-validation-messages.properties
@@ -42,4 +42,5 @@ PolicySetAppliesToMissing = Required attribute "appliesTo" missing for PolicySet
IntentMapProvidesMissing = Required attribute "provides" missing for IntentMap in PolicySet : {0}
QualifierNameMissing = Required attribute "name" missing for qualifier definition in PolicySet : {0}
ConstrainedTypeNotFound = Unable to find the extension type {0} constrained by intent: {1}
+MultipleDefaultQualifiers = [POL30004] Intent {0} has more than one qualifier marked as the default qualifier