You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2016/03/05 15:42:31 UTC

svn commit: r1733723 - in /webservices/axiom/branches/stax-stream: ./ aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/ aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/ aspects/om-aspects/src/main/java/o...

Author: veithen
Date: Sat Mar  5 14:42:31 2016
New Revision: 1733723

URL: http://svn.apache.org/viewvc?rev=1733723&view=rev
Log:
Merge latest changes from trunk.

Removed:
    webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/OMXMLStreamReaderExAdapter.java
    webservices/axiom/branches/stax-stream/axiom-api/src/main/java/org/apache/axiom/om/OMAttachmentAccessor.java
    webservices/axiom/branches/stax-stream/axiom-api/src/main/java/org/apache/axiom/om/OMXMLStreamReader.java
    webservices/axiom/branches/stax-stream/axiom-api/src/main/java/org/apache/axiom/om/util/OMXMLStreamReaderValidator.java
Modified:
    webservices/axiom/branches/stax-stream/   (props changed)
    webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/NamespaceURIInterningXMLStreamReaderWrapper.java
    webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomContainerSupport.aj
    webservices/axiom/branches/stax-stream/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java
    webservices/axiom/branches/stax-stream/axiom-api/src/main/java/org/apache/axiom/om/OMContainer.java
    webservices/axiom/branches/stax-stream/axiom-api/src/main/java/org/apache/axiom/om/ds/custombuilder/CustomBuilder.java
    webservices/axiom/branches/stax-stream/axiom-api/src/main/java/org/apache/axiom/om/impl/OMXMLStreamReaderEx.java
    webservices/axiom/branches/stax-stream/src/site/markdown/release-notes/1.3.0.md
    webservices/axiom/branches/stax-stream/systests/old-tests/src/test/java/org/apache/axiom/om/impl/mtom/MTOMStAXSOAPModelBuilderTest.java

Propchange: webservices/axiom/branches/stax-stream/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Mar  5 14:42:31 2016
@@ -14,4 +14,4 @@
 /webservices/axiom/branches/maven-site-plugin-3.5:1731125-1732708
 /webservices/axiom/branches/namespaceURIInterning:1293148-1293587
 /webservices/axiom/branches/osgi-redesign:1180368-1180596
-/webservices/axiom/trunk:1733528-1733695
+/webservices/axiom/trunk:1733528-1733722

Modified: webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/NamespaceURIInterningXMLStreamReaderWrapper.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/NamespaceURIInterningXMLStreamReaderWrapper.java?rev=1733723&r1=1733722&r2=1733723&view=diff
==============================================================================
--- webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/NamespaceURIInterningXMLStreamReaderWrapper.java (original)
+++ webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/NamespaceURIInterningXMLStreamReaderWrapper.java Sat Mar  5 14:42:31 2016
@@ -18,11 +18,9 @@
  */
 package org.apache.axiom.om.impl.common;
 
-import javax.activation.DataHandler;
 import javax.xml.namespace.NamespaceContext;
 import javax.xml.stream.XMLStreamReader;
 
-import org.apache.axiom.om.OMXMLStreamReader;
 import org.apache.axiom.om.OMXMLStreamReaderConfiguration;
 import org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper;
 
@@ -30,10 +28,10 @@ import org.apache.axiom.util.stax.wrappe
  * {@link XMLStreamReader} wrapper that interns namespace URIs. It is used to implement the
  * {@link OMXMLStreamReaderConfiguration#isNamespaceURIInterning()} option.
  */
-public final class NamespaceURIInterningXMLStreamReaderWrapper extends XMLStreamReaderWrapper implements OMXMLStreamReader {
+public final class NamespaceURIInterningXMLStreamReaderWrapper extends XMLStreamReaderWrapper {
     private NamespaceURIInterningNamespaceContextWrapper namespaceContextWrapper;
     
-    public NamespaceURIInterningXMLStreamReaderWrapper(OMXMLStreamReader parent) {
+    public NamespaceURIInterningXMLStreamReaderWrapper(XMLStreamReader parent) {
         super(parent);
     }
 
@@ -57,10 +55,6 @@ public final class NamespaceURIInterning
         return intern(super.getNamespaceURI(prefix));
     }
 
-    public DataHandler getDataHandler(String blobcid) {
-        return ((OMXMLStreamReader)getParent()).getDataHandler(blobcid);
-    }
-
     public NamespaceContext getNamespaceContext() {
         NamespaceContext namespaceContext = super.getNamespaceContext();
         if (namespaceContextWrapper == null || namespaceContextWrapper.getParent() != namespaceContext) {
@@ -68,13 +62,4 @@ public final class NamespaceURIInterning
         }
         return namespaceContextWrapper;
     }
-
-    public boolean isInlineMTOM() {
-        return ((OMXMLStreamReader)getParent()).isInlineMTOM();
-    }
-
-
-    public void setInlineMTOM(boolean value) {
-        ((OMXMLStreamReader)getParent()).setInlineMTOM(value);
-    }
 }

Modified: webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomContainerSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomContainerSupport.aj?rev=1733723&r1=1733722&r2=1733723&view=diff
==============================================================================
--- webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomContainerSupport.aj (original)
+++ webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomContainerSupport.aj Sat Mar  5 14:42:31 2016
@@ -52,7 +52,6 @@ import org.apache.axiom.om.OMOutputForma
 import org.apache.axiom.om.OMSerializable;
 import org.apache.axiom.om.OMSourcedElement;
 import org.apache.axiom.om.OMXMLParserWrapper;
-import org.apache.axiom.om.OMXMLStreamReader;
 import org.apache.axiom.om.OMXMLStreamReaderConfiguration;
 import org.apache.axiom.om.impl.MTOMXMLStreamWriter;
 import org.apache.axiom.om.impl.common.AxiomExceptionTranslator;
@@ -60,7 +59,6 @@ import org.apache.axiom.om.impl.common.A
 import org.apache.axiom.om.impl.common.NamespaceURIInterningXMLStreamReaderWrapper;
 import org.apache.axiom.om.impl.common.OMChildrenQNameIterator;
 import org.apache.axiom.om.impl.common.SAXResultContentHandler;
-import org.apache.axiom.om.impl.common.serializer.pull.OMXMLStreamReaderExAdapter;
 import org.apache.axiom.om.impl.common.serializer.pull.PullSerializer;
 import org.apache.axiom.om.impl.common.serializer.push.NamespaceContextPreservationFilterHandler;
 import org.apache.axiom.om.impl.common.serializer.push.XmlDeclarationRewriterHandler;
@@ -71,8 +69,8 @@ import org.apache.axiom.om.impl.intf.Axi
 import org.apache.axiom.om.impl.intf.AxiomContainer;
 import org.apache.axiom.om.impl.intf.OMFactoryEx;
 import org.apache.axiom.om.impl.stream.stax.AxiomXMLStreamReaderExtensionFactory;
-import org.apache.axiom.om.util.OMXMLStreamReaderValidator;
 import org.apache.axiom.om.util.StAXUtils;
+import org.apache.axiom.util.stax.debug.XMLStreamReaderValidator;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.xml.sax.InputSource;

Modified: webservices/axiom/branches/stax-stream/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/stax-stream/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java?rev=1733723&r1=1733722&r2=1733723&view=diff
==============================================================================
--- webservices/axiom/branches/stax-stream/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java (original)
+++ webservices/axiom/branches/stax-stream/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java Sat Mar  5 14:42:31 2016
@@ -27,7 +27,6 @@ import org.apache.axiom.blob.WritableBlo
 import org.apache.axiom.blob.WritableBlobFactory;
 import org.apache.axiom.ext.activation.SizeAwareDataSource;
 import org.apache.axiom.mime.ContentType;
-import org.apache.axiom.om.OMAttachmentAccessor;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.impl.MTOMConstants;
 
@@ -41,7 +40,7 @@ import java.util.List;
 import java.util.Set;
 import java.util.Map;
 
-public class Attachments implements OMAttachmentAccessor {
+public class Attachments {
     private final AttachmentsDelegate delegate;
    
     /**

Modified: webservices/axiom/branches/stax-stream/axiom-api/src/main/java/org/apache/axiom/om/OMContainer.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/stax-stream/axiom-api/src/main/java/org/apache/axiom/om/OMContainer.java?rev=1733723&r1=1733722&r2=1733723&view=diff
==============================================================================
--- webservices/axiom/branches/stax-stream/axiom-api/src/main/java/org/apache/axiom/om/OMContainer.java (original)
+++ webservices/axiom/branches/stax-stream/axiom-api/src/main/java/org/apache/axiom/om/OMContainer.java Sat Mar  5 14:42:31 2016
@@ -27,7 +27,6 @@ import javax.xml.transform.sax.SAXResult
 import javax.xml.transform.sax.SAXSource;
 
 import org.apache.axiom.ext.stax.datahandler.DataHandlerReader;
-import org.apache.axiom.util.stax.xop.XOPEncodingStreamReader;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.DTDHandler;
 import org.xml.sax.ext.DeclHandler;
@@ -327,40 +326,6 @@ public interface OMContainer extends OMS
      * <p>
      * The caller MUST NOT make any other assumption about the returned reader, in particular about
      * its runtime type.
-     * <p>
-     * <b>Note</b> (non normative): For various reasons, existing code based on Axiom versions
-     * prior to 1.2.9 makes assumptions on the returned reader that should no longer be considered
-     * valid:
-     * <ul>
-     * <li>Some code uses the {@link OMXMLStreamReader} interface of the returned reader to switch
-     * off MTOM inlining using {@link OMXMLStreamReader#setInlineMTOM(boolean)}. This has now been
-     * deprecated and it is recommended to use
-     * {@link XOPEncodingStreamReader} instead.</li>
-     * <li>Some existing code uses the {@link OMAttachmentAccessor} interface of the returned
-     * reader to fetch attachments using {@link OMAttachmentAccessor#getDataHandler(String)}. There
-     * is no reason anymore to do so:
-     * <ul>
-     * <li>When {@link OMXMLStreamReader#setInlineMTOM(boolean)} is used to disable MTOM inlining,
-     * {@link OMAttachmentAccessor#getDataHandler(String)} must be used to retrieve the binary
-     * content. The fact that this method is deprecated removes the need for this.</li>
-     * <li>In Axiom versions prior to 1.2.9, the sequence of events was inconsistent if the
-     * underlying stream is XOP encoded and caching is disabled (see AXIOM-255). This made it
-     * necessary for the caller to (partially) handle the XOP processing and to use
-     * {@link OMAttachmentAccessor#getDataHandler(String)} to retrieve the binary content. Starting
-     * with 1.2.9 this is no longer be the case: as specified above, the sequence of events is
-     * independent of the state of the object model and the value of the <code>cache</code>
-     * parameter, and all binary content is reported through the
-     * {@link DataHandlerReader} extension.</li>
-     * <li>Finally, it should be noted that {@link OMAttachmentAccessor#getDataHandler(String)}
-     * doesn't give access to the attachments in the SwA case (neither in 1.2.9 nor in previous
-     * versions).</li>
-     * </ul>
-     * </li>
-     * </ul>
-     * <p>
-     * Code making any of these assumptions should be fixed, so that only {@link XMLStreamReader}
-     * and {@link DataHandlerReader} are used (and if
-     * necessary, {@link XOPEncodingStreamReader}).
      * 
      * @param cache
      *            indicates if caching should be enabled

Modified: webservices/axiom/branches/stax-stream/axiom-api/src/main/java/org/apache/axiom/om/ds/custombuilder/CustomBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/stax-stream/axiom-api/src/main/java/org/apache/axiom/om/ds/custombuilder/CustomBuilder.java?rev=1733723&r1=1733722&r2=1733723&view=diff
==============================================================================
--- webservices/axiom/branches/stax-stream/axiom-api/src/main/java/org/apache/axiom/om/ds/custombuilder/CustomBuilder.java (original)
+++ webservices/axiom/branches/stax-stream/axiom-api/src/main/java/org/apache/axiom/om/ds/custombuilder/CustomBuilder.java Sat Mar  5 14:42:31 2016
@@ -97,16 +97,7 @@ public interface CustomBuilder {
      *            library that supports XOP, it may want to use that encoding
      *            to optimize the transfer of binary data. To do so, the
      *            custom builder MUST use {@link org.apache.axiom.util.stax.xop.XOPUtils#getXOPEncodedStream(XMLStreamReader)}
-     *            to get an XOP encoded stream. This guarantees that the original
-     *            reader is wrapped or unwrapped properly and also that
-     *            the custom builder correctly gets access to the attachments,
-     *            regardless of the type of the original reader. In particular,
-     *            the custom builder MUST NOT attempt to retrieve attachments
-     *            through the {@link org.apache.axiom.om.OMAttachmentAccessor}
-     *            that may be implemented by the builder (because this wouldn't
-     *            work if the builder was created from an {@link XMLStreamReader}
-     *            implementing the {@link org.apache.axiom.ext.stax.datahandler.DataHandlerReader}
-     *            extension).
+     *            to get an XOP encoded stream.
      * @return OMDataSource
      */
     public OMDataSource create(XMLStreamReader reader) throws OMException;

Modified: webservices/axiom/branches/stax-stream/axiom-api/src/main/java/org/apache/axiom/om/impl/OMXMLStreamReaderEx.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/stax-stream/axiom-api/src/main/java/org/apache/axiom/om/impl/OMXMLStreamReaderEx.java?rev=1733723&r1=1733722&r2=1733723&view=diff
==============================================================================
--- webservices/axiom/branches/stax-stream/axiom-api/src/main/java/org/apache/axiom/om/impl/OMXMLStreamReaderEx.java (original)
+++ webservices/axiom/branches/stax-stream/axiom-api/src/main/java/org/apache/axiom/om/impl/OMXMLStreamReaderEx.java Sat Mar  5 14:42:31 2016
@@ -18,14 +18,15 @@
  */
 package org.apache.axiom.om.impl;
 
+import javax.xml.stream.XMLStreamReader;
+
 import org.apache.axiom.om.OMDataSource;
-import org.apache.axiom.om.OMXMLStreamReader;
 
 /**
  * Interface that is used internally by Axiom and that should not be considered being part of the
  * public API.
  */
-public interface OMXMLStreamReaderEx extends OMXMLStreamReader {
+public interface OMXMLStreamReaderEx extends XMLStreamReader {
     // *** Methods used by StreamingOMSerializer
     
     /**

Modified: webservices/axiom/branches/stax-stream/src/site/markdown/release-notes/1.3.0.md
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/stax-stream/src/site/markdown/release-notes/1.3.0.md?rev=1733723&r1=1733722&r2=1733723&view=diff
==============================================================================
--- webservices/axiom/branches/stax-stream/src/site/markdown/release-notes/1.3.0.md (original)
+++ webservices/axiom/branches/stax-stream/src/site/markdown/release-notes/1.3.0.md Sat Mar  5 14:42:31 2016
@@ -145,4 +145,7 @@ Changes in this release
     been processed. That means that after completion, nodes created by a builder
     will be indistinguishable from programmatically created nodes.
 
+*   The `OMAttachmentAccessor` and `OMXMLStreamReader` interfaces have been
+    removed because all if their usages were already deprecated in 1.2.x.
+
 [AXIOM-474]: https://issues.apache.org/jira/browse/AXIOM-474

Modified: webservices/axiom/branches/stax-stream/systests/old-tests/src/test/java/org/apache/axiom/om/impl/mtom/MTOMStAXSOAPModelBuilderTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/stax-stream/systests/old-tests/src/test/java/org/apache/axiom/om/impl/mtom/MTOMStAXSOAPModelBuilderTest.java?rev=1733723&r1=1733722&r2=1733723&view=diff
==============================================================================
--- webservices/axiom/branches/stax-stream/systests/old-tests/src/test/java/org/apache/axiom/om/impl/mtom/MTOMStAXSOAPModelBuilderTest.java (original)
+++ webservices/axiom/branches/stax-stream/systests/old-tests/src/test/java/org/apache/axiom/om/impl/mtom/MTOMStAXSOAPModelBuilderTest.java Sat Mar  5 14:42:31 2016
@@ -26,14 +26,11 @@ import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.OMOutputFormat;
 import org.apache.axiom.om.OMText;
 import org.apache.axiom.om.OMXMLBuilderFactory;
-import org.apache.axiom.om.OMXMLStreamReader;
 import org.apache.axiom.soap.SOAPModelBuilder;
 import org.apache.axiom.ts.soap.MTOMSample;
-import org.apache.axiom.util.stax.XMLStreamReaderUtils;
 import org.apache.axiom.util.stax.xop.XOPUtils;
 
 import javax.activation.DataHandler;
-import javax.xml.stream.XMLStreamReader;
 
 import java.io.BufferedInputStream;
 import java.io.ByteArrayInputStream;
@@ -77,16 +74,6 @@ public class MTOMStAXSOAPModelBuilderTes
         }
     }
     
-    public void testAccessToCachedParser() throws Exception {
-        OMElement root = createTestMTOMMessage();
-        XMLStreamReader reader = root.getXMLStreamReader(true);
-        
-        XMLStreamReader original = XMLStreamReaderUtils.getOriginalXMLStreamReader(reader);
-        
-        // The caching parser will be an OMStaXWrapper.
-        assertTrue(original instanceof OMXMLStreamReader);
-    }
-    
     public void testCreateOMElement() throws Exception {
         OMElement root = createTestMTOMMessage();
         OMElement body = (OMElement) root.getFirstOMChild();