ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1484239 - in /webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common: OMContainerHelper.java serializer/pull/Navigator.java serializer/pull/PullSerializer.java
Date Sun, 19 May 2013 08:06:22 GMT
Author: veithen
Date: Sun May 19 08:06:21 2013
New Revision: 1484239

URL: http://svn.apache.org/r1484239
Log:
Different parts of an OM tree may be built (or may have been built) by different builders.
Therefore, it's incorrect to retrieve the builder once when the Navigator is constructed.

Modified:
    webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerHelper.java
    webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/Navigator.java
    webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/PullSerializer.java

Modified: webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerHelper.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerHelper.java?rev=1484239&r1=1484238&r2=1484239&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerHelper.java
(original)
+++ webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerHelper.java
Sun May 19 08:06:21 2013
@@ -61,7 +61,7 @@ public final class OMContainerHelper {
         if (builder != null && builder.isCompleted() && !cache &&
!container.isComplete()) {
             throw new UnsupportedOperationException("The parser is already consumed!");
         }
-        OMXMLStreamReader reader = new OMXMLStreamReaderExAdapter(new PullSerializer(builder,
container, cache, configuration.isPreserveNamespaceContext()));
+        OMXMLStreamReader reader = new OMXMLStreamReaderExAdapter(new PullSerializer(container,
cache, configuration.isPreserveNamespaceContext()));
         
         if (configuration.isNamespaceURIInterning()) {
             reader = new NamespaceURIInterningXMLStreamReaderWrapper(reader);

Modified: webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/Navigator.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/Navigator.java?rev=1484239&r1=1484238&r2=1484239&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/Navigator.java
(original)
+++ webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/Navigator.java
Sun May 19 08:06:21 2013
@@ -88,9 +88,6 @@ final class Navigator extends PullSerial
      */
     private boolean visited;
 
-    /** Field builder */
-    private OMXMLParserWrapper builder;
-    
     /**
      * The root node, i.e. the node from which the {@link XMLStreamReader} has been requested.
      */
@@ -130,10 +127,9 @@ final class Navigator extends PullSerial
      * @param cache
      * @param preserveNamespaceContext
      */
-    Navigator(PullSerializer serializer, OMXMLParserWrapper builder, OMContainer startNode,
+    Navigator(PullSerializer serializer, OMContainer startNode,
                             boolean cache, boolean preserveNamespaceContext) {
         this.serializer = serializer;
-        this.builder = builder;
         this.rootNode = startNode;
         this.cache = cache;
         this.preserveNamespaceContext = preserveNamespaceContext;
@@ -685,6 +681,15 @@ final class Navigator extends PullSerial
     }
 
     Object getProperty(String s) throws IllegalArgumentException {
+        OMContainer container;
+        if (node == null) {
+            container = rootNode;
+        } else if (node instanceof OMContainer) {
+            container = (OMContainer)node;
+        } else {
+            container = ((OMNode)node).getParent();
+        }
+        OMXMLParserWrapper builder = container.getBuilder();
         // Delegate to the builder's parser.
         if (builder != null && builder instanceof StAXBuilder) {
             StAXBuilder staxBuilder = (StAXBuilder) builder;

Modified: webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/PullSerializer.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/PullSerializer.java?rev=1484239&r1=1484238&r2=1484239&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/PullSerializer.java
(original)
+++ webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/PullSerializer.java
Sun May 19 08:06:21 2013
@@ -33,7 +33,6 @@ import org.apache.axiom.ext.stax.datahan
 import org.apache.axiom.ext.stax.datahandler.DataHandlerReader;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMDataSource;
-import org.apache.axiom.om.OMXMLParserWrapper;
 import org.apache.axiom.util.stax.AbstractXMLStreamReader;
 import org.apache.axiom.util.stax.XMLStreamReaderUtils;
 
@@ -57,9 +56,8 @@ public final class PullSerializer extend
      */
     private boolean isDataSourceALeaf;
 
-    public PullSerializer(OMXMLParserWrapper builder, OMContainer startNode,
-            boolean cache, boolean preserveNamespaceContext) {
-        state = new Navigator(this, builder, startNode, cache, preserveNamespaceContext);
+    public PullSerializer(OMContainer startNode, boolean cache, boolean preserveNamespaceContext)
{
+        state = new Navigator(this, startNode, cache, preserveNamespaceContext);
     }
     
     /**



Mime
View raw message