[ 
https://issues.apache.org/jira/browse/OODT-195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13040853#comment-13040853
 ] 

Chris A. Mattmann commented on OODT-195:
----------------------------------------

In r1128934, I committed a test case (similar to the attached patch) to expose 
the issue. In doing so, I found a bug in the XMLValidationLayer that I will 
file an issue for -- it has to do with the fact that some of the element 
descriptions in the test policy are null, which causes an XML writing error 
when the elements.xml file is saved out. Michael, thanks, you were correctly 
seeing a bug!


> XMLValidationLayer: Elements Map and ProductType to Element Map can become 
> inconsistent
> ---------------------------------------------------------------------------------------
>
>                 Key: OODT-195
>                 URL: https://issues.apache.org/jira/browse/OODT-195
>             Project: OODT
>          Issue Type: Bug
>          Components: file manager
>            Reporter: Michael Starch
>            Priority: Minor
>         Attachments: OODT-195.unittest.mattmann.052911.patch.txt
>
>
> XMLValidation layer does not update the the product-type-to-element map upon 
> element modification or removal.  Thus the product-type-to-element map can 
> contain elements that have been removed, or modified, leaving it inconsistent 
> with the elements contained in the element map.
> As suggested by Brian Foster:
> The product-type-to-element map can be changed to map ProductType to 
> ElemementId strings.  Then the actual element can be obtained from the 
> element map.  The product-type-to-element map would still need to be updated 
> (see below solution) on removal of an element to ensure that it contains no 
> elements previously removed.
> An alternative solution:
> Update both maps upon modification or removal.  This way allows both modified 
> elements and removed elements are handled in the exact same manner. This fix 
> will fail if the element map is modified outside of the removeElement or 
> modifyElement methods.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to