diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-11 16:27:18 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-11 16:27:18 +0000 |
commit | 5dde71c776b02413e8d3bd5b902a04fa8ee98124 (patch) | |
tree | 397d8c2d803ccf7c68489a6ef90e6dc3b166f6ea /sca-java-2.x/trunk/modules/builder/src/main/java | |
parent | 515a2fa0e3b82fdb1ecdfe584c9d19ac33ae80d9 (diff) |
TUSCANY-3483 Add missed comments and remove commented out code
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@921921 13f79535-47bb-0310-9956-ffa450edef68
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.java | 57 |
1 files changed, 29 insertions, 28 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 e7e83757ad..182e0abfd6 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 @@ -220,6 +220,24 @@ public class ComponentPolicyBuilderImpl { } } + /** + * Checks if any qualifiable intents of intents in an excluded intent list match + * with a second intent. looking for the case where + * + * <intent name="intentA" excludes="intentB"/> + * <intent name="intentB" > + * <sca:qualifier name="q1" default="true"/> + * <sca:qualifier name="q2" default="true"/> + * </intent> + * + * And were + * + * requires="intentA intentB.q1" appears on an element + * + * @param excludedIntentList + * @param intent + * @return + */ protected boolean checkQualifiedMutualExclusion(List<Intent> excludedIntentList, Intent intent){ for (Intent excludedIntent : excludedIntentList){ if (intent.getQualifiableIntent() != null && @@ -231,6 +249,14 @@ public class ComponentPolicyBuilderImpl { return false; } + /** + * Check if two intents are mutually exclusive + * + * @param i1 + * @param i2 + * @param context + * @return + */ protected boolean checkMutualExclusion(Intent i1, Intent i2, BuilderContext context){ if ((i1 != i2) && (i1.getExcludedIntents().contains(i2) || @@ -258,17 +284,7 @@ public class ComponentPolicyBuilderImpl { for (Intent i2 : subject1.getRequiredIntents()) { if (checkMutualExclusion(i1, i2, context)){ return true; - } -/* - if ((i1 != i2) && - (i1.getExcludedIntents().contains(i2) || - i2.getExcludedIntents().contains(i1) || - matchQualifiedMutualExclusion(i1.getExcludedIntents(), i2) || - matchQualifiedMutualExclusion(i2.getExcludedIntents(), i1))) { - error(context.getMonitor(), "MutuallyExclusiveIntents", new Object[] {subject1}, i1, i2); - return true; - } -*/ + } } } return false; @@ -289,16 +305,7 @@ public class ComponentPolicyBuilderImpl { for (Intent i2 : subject2.getRequiredIntents()) { if (checkMutualExclusion(i1, i2, context)){ return true; - } -/* - if (i1.getExcludedIntents().contains(i2) || - i2.getExcludedIntents().contains(i1) || - matchQualifiedMutualExclusion(i1.getExcludedIntents(), i2) || - matchQualifiedMutualExclusion(i2.getExcludedIntents(), i1)) { - error(context.getMonitor(), "MutuallyExclusiveIntents", new Object[] {subject1, subject2}, i1, i2); - return true; - } -*/ + } } } return false; @@ -318,13 +325,7 @@ public class ComponentPolicyBuilderImpl { Intent i2 = intents.get(j); if (checkMutualExclusion(i1, i2, context)){ return true; - } -/* - if (i1 != i2 && i1.getExcludedIntents().contains(i2) || i2.getExcludedIntents().contains(i1)) { - error(context.getMonitor(), "MutuallyExclusiveIntents", subject, i1, i2); - return true; - } -*/ + } } } return false; |