Author: mattmann
Date: Sun May 29 19:21:57 2011
New Revision: 1128940
URL: http://svn.apache.org/viewvc?rev=1128940&view=rev
Log:
- fix for OODT-195 XMLValidationLayer: Elements Map and ProductType to Element
Map can become inconsistent
Modified:
oodt/trunk/CHANGES.txt
oodt/trunk/filemgr/src/main/java/org/apache/oodt/cas/filemgr/validation/XMLValidationLayer.java
oodt/trunk/filemgr/src/test/org/apache/oodt/cas/filemgr/validation/TestXMLValidationLayer.java
Modified: oodt/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/oodt/trunk/CHANGES.txt?rev=1128940&r1=1128939&r2=1128940&view=diff
==============================================================================
--- oodt/trunk/CHANGES.txt (original)
+++ oodt/trunk/CHANGES.txt Sun May 29 19:21:57 2011
@@ -4,6 +4,9 @@ Apache OODT Change Log
Release 0.3-SNAPSHOT (in progress)
--------------------------------------------
+* OODT-195 XMLValidationLayer: Elements Map and ProductType to Element
+ Map can become inconsistent (Michael Starch, mattmann, bfoster)
+
* OODT-197 Null descriptions from elements.xml cause NPE when writing
elements.xml file back out (mattmann, Michael Starch)
Modified:
oodt/trunk/filemgr/src/main/java/org/apache/oodt/cas/filemgr/validation/XMLValidationLayer.java
URL:
http://svn.apache.org/viewvc/oodt/trunk/filemgr/src/main/java/org/apache/oodt/cas/filemgr/validation/XMLValidationLayer.java?rev=1128940&r1=1128939&r2=1128940&view=diff
==============================================================================
---
oodt/trunk/filemgr/src/main/java/org/apache/oodt/cas/filemgr/validation/XMLValidationLayer.java
(original)
+++
oodt/trunk/filemgr/src/main/java/org/apache/oodt/cas/filemgr/validation/XMLValidationLayer.java
Sun May 29 19:21:57 2011
@@ -101,7 +101,13 @@ public class XMLValidationLayer implemen
* @see
org.apache.oodt.cas.filemgr.validation.ValidationLayer#modifyElement(org.apache.oodt.cas.filemgr.structs.Element)
*/
public void modifyElement(Element element) throws ValidationLayerException
{
- elementMap.put(element.getElementId(), element);
+ for(Element elem: elementMap.values()){
+ if(elem.getElementId().equals(element.getElementId())){
+ elem.setElementName(element.getElementName());
+ elem.setDescription(elem.getDescription());
+ elem.setDCElement(element.getDCElement());
+ }
+ }
saveElementsAndMappings();
}
Modified:
oodt/trunk/filemgr/src/test/org/apache/oodt/cas/filemgr/validation/TestXMLValidationLayer.java
URL:
http://svn.apache.org/viewvc/oodt/trunk/filemgr/src/test/org/apache/oodt/cas/filemgr/validation/TestXMLValidationLayer.java?rev=1128940&r1=1128939&r2=1128940&view=diff
==============================================================================
---
oodt/trunk/filemgr/src/test/org/apache/oodt/cas/filemgr/validation/TestXMLValidationLayer.java
(original)
+++
oodt/trunk/filemgr/src/test/org/apache/oodt/cas/filemgr/validation/TestXMLValidationLayer.java
Sun May 29 19:21:57 2011
@@ -82,7 +82,7 @@ public class TestXMLValidationLayer exte
}
ProductType type = new ProductType();
- type.setName("urn:oodt:GenericFile");
+ type.setProductTypeId("urn:oodt:GenericFile");
List<Element> retrievedElems = null;
try {
retrievedElems = validationLayer.getElements(type);