You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Greg Dritschler (JIRA)" <de...@tuscany.apache.org> on 2008/07/07 16:27:31 UTC

[jira] Updated: (TUSCANY-2464) PolicyValidationException Policy set does not apply to extension type

     [ https://issues.apache.org/jira/browse/TUSCANY-2464?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Greg Dritschler updated TUSCANY-2464:
-------------------------------------

    Attachment: jira.patch

I am attaching a fix for this issue.  It moves the prefix generation into declareNamespace().

> PolicyValidationException Policy set does not apply to extension type
> ---------------------------------------------------------------------
>
>                 Key: TUSCANY-2464
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2464
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Assembly Model
>            Reporter: Greg Dritschler
>         Attachments: jira.patch
>
>
> There is a bug in the applicable policy set processing in PolicyComputationUtils which may cause a PolicyValidationException.  Method addApplicablePolicySets(PolicySet, Document, int) has the following code:
>                 String policySetPrefix = POLICYSET_PREFIX + prefixCount++;
>                 String appPolicyAttrPrefix = APPLICABLE_POLICYSET_ATTR_PREFIX;
>                 policySetPrefix =
>                     declareNamespace((Element)aResultNode, policySetPrefix, policySet.getName()
>                         .getNamespaceURI());
> This code calls declareNamespace() to handle binding a prefix to the policy set's namespace.  It generates the prefix though it has no idea whether the prefix is needed (it isn't needed if there is an existing prefix bound to the namespace).  It generates the prefix using a counter which recycles to 1 each time an applicable policy set is added to the document.  This means there is a possibility of reusing the same prefix for two different namespaces.  If that happens, some of the applicable policy sets will have the wrong namespace.  This may cause references to the policy set within the composite to fail validation due to the namespace mismatch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.