summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/builder/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/trunk/modules/builder/src/main/java')
-rw-r--r--sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentPolicyBuilderImpl.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentPolicyBuilderImpl.java b/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentPolicyBuilderImpl.java
index e908122861..5db7ca78a3 100644
--- a/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentPolicyBuilderImpl.java
+++ b/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentPolicyBuilderImpl.java
@@ -110,7 +110,7 @@ public class ComponentPolicyBuilderImpl {
// The intents are merged and the exclusion check will be done after
for (Intent intent : subject.getRequiredIntents()) {
if (!policySubject.getRequiredIntents().contains(intent)){
- if (intentType != null) {
+ if ((intent.getType() != null) && (intentType != null) ) {
if (intent.getType().equals(intentType)){
policySubject.getRequiredIntents().add(intent);
}
@@ -392,7 +392,7 @@ public class ComponentPolicyBuilderImpl {
subject.getRequiredIntents().remove(i);
subject.getRequiredIntents().add(i.getDefaultQualifiedIntent());
}
- }
+ }
}
protected void resolveAndNormalize(PolicySubject subject, BuilderContext context) {
Definitions definitions = context.getDefinitions();
@@ -469,7 +469,11 @@ public class ComponentPolicyBuilderImpl {
if(extensionType != null){
List<Intent> copy = new ArrayList<Intent>(intents);
for (Intent i : copy) {
- if (i.getConstrainedTypes().size() > 0){
+ List<ExtensionType> constrainedTypes = i.getConstrainedTypes();
+ if (( constrainedTypes.size() == 0 ) && ( i.getQualifiableIntent() != null ) )
+ constrainedTypes = i.getQualifiableIntent().getConstrainedTypes();
+
+ if (constrainedTypes.size() > 0){
boolean constraintFound = false;
for (ExtensionType constrainedType : i.getConstrainedTypes()){
if (constrainedType.getType().equals(extensionType.getType()) ||