You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrf-dev@ws.apache.org by ip...@apache.org on 2005/02/24 22:01:24 UTC

svn commit: r155245 - in incubator/apollo/trunk/src: java/org/apache/ws/resource/properties/impl/XmlBeansResourcePropertySet.java test/org/apache/ws/resource/properties/SushiCallback.java test/org/apache/ws/resource/properties/v1_2_draft01/porttype/impl/QueryResourcePropertiesProviderTestCase.java

Author: ips
Date: Thu Feb 24 13:01:21 2005
New Revision: 155245

URL: http://svn.apache.org/viewcvs?view=rev&rev=155245
Log:
XmlBeansResourcePropertySet#toElement() no longer caches the DOM representation of the RP doc; this ensures the returned DOM element accurately reflects the current content of the RP doc

Modified:
    incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/impl/XmlBeansResourcePropertySet.java
    incubator/apollo/trunk/src/test/org/apache/ws/resource/properties/SushiCallback.java
    incubator/apollo/trunk/src/test/org/apache/ws/resource/properties/v1_2_draft01/porttype/impl/QueryResourcePropertiesProviderTestCase.java

Modified: incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/impl/XmlBeansResourcePropertySet.java
URL: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/impl/XmlBeansResourcePropertySet.java?view=diff&r1=155244&r2=155245
==============================================================================
--- incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/impl/XmlBeansResourcePropertySet.java (original)
+++ incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/impl/XmlBeansResourcePropertySet.java Thu Feb 24 13:01:21 2005
@@ -55,7 +55,6 @@
 
     private XmlObject m_propsDocXBean;
     private XmlObject m_propsXBean;
-    private Document m_propsDocDOM;
     private Map m_propsMap = new HashMap();
     private ResourcePropertySetMetaData m_metaData;
 
@@ -243,16 +242,9 @@
     public Element toElement()
             throws SerializationException
     {
-        // TODO: should this method return a Document instead of an Element?
-        synchronized ( this )
-        {
-            if ( m_propsDocDOM == null )
-            {
-                m_propsDocDOM = (Document) m_propsDocXBean.newDomNode(); // create and cache
-            }
-        }
-
-        return m_propsDocDOM.getDocumentElement();
+        // TODO: shouldn't this method return a Document instead of an Element?
+        Document doc = (Document) m_propsDocXBean.newDomNode();
+        return doc.getDocumentElement();
     }
 
     /**

Modified: incubator/apollo/trunk/src/test/org/apache/ws/resource/properties/SushiCallback.java
URL: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/test/org/apache/ws/resource/properties/SushiCallback.java?view=diff&r1=155244&r2=155245
==============================================================================
--- incubator/apollo/trunk/src/test/org/apache/ws/resource/properties/SushiCallback.java (original)
+++ incubator/apollo/trunk/src/test/org/apache/ws/resource/properties/SushiCallback.java Thu Feb 24 13:01:21 2005
@@ -2,7 +2,7 @@
 
 import org.apache.ws.util.XmlBeanUtils;
 import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.impl.values.XmlIntImpl;
+import org.apache.xmlbeans.XmlInt;
 
 import javax.xml.namespace.QName;
 
@@ -34,7 +34,7 @@
             String pieces = ebi.getNumberOfPieces();
             try
             {
-                XmlIntImpl ebiElem = (XmlIntImpl) prop.get( 0 );
+                XmlInt ebiElem = (XmlInt) prop.get( 0 );
                 XmlBeanUtils.setValue( ebiElem, pieces );
             }
             catch ( Exception e )

Modified: incubator/apollo/trunk/src/test/org/apache/ws/resource/properties/v1_2_draft01/porttype/impl/QueryResourcePropertiesProviderTestCase.java
URL: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/test/org/apache/ws/resource/properties/v1_2_draft01/porttype/impl/QueryResourcePropertiesProviderTestCase.java?view=diff&r1=155244&r2=155245
==============================================================================
--- incubator/apollo/trunk/src/test/org/apache/ws/resource/properties/v1_2_draft01/porttype/impl/QueryResourcePropertiesProviderTestCase.java (original)
+++ incubator/apollo/trunk/src/test/org/apache/ws/resource/properties/v1_2_draft01/porttype/impl/QueryResourcePropertiesProviderTestCase.java Thu Feb 24 13:01:21 2005
@@ -98,7 +98,7 @@
         QueryResourcePropertiesResponseDocument.QueryResourcePropertiesResponse queryResourcePropertiesResponse = queryResourceProperties( "*" );
         XmlObject[] allPropElems = XmlBeanUtils.getChildElements( queryResourcePropertiesResponse );
         assertNotNull( allPropElems );
-        assertTrue( allPropElems.length == 9 );
+        assertEquals( 9, allPropElems.length );
         XmlObject[] fuguPropElems = XmlBeanUtils.getChildElements( queryResourcePropertiesResponse, SushiPropertyQNames.FUGU );
         assertNotNull( fuguPropElems );
         assertEquals( 1, fuguPropElems.length );



---------------------------------------------------------------------
To unsubscribe, e-mail: apollo-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: apollo-dev-help@ws.apache.org