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/06 01:43:26 UTC
svn commit: r1733779 -
/webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomSourcedElementSupport.aj
Author: veithen
Date: Sun Mar 6 00:43:26 2016
New Revision: 1733779
URL: http://svn.apache.org/viewvc?rev=1733779&view=rev
Log:
Some tweaks to make Axis2 happy.
Modified:
webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomSourcedElementSupport.aj
Modified: webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomSourcedElementSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomSourcedElementSupport.aj?rev=1733779&r1=1733778&r2=1733779&view=diff
==============================================================================
--- webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomSourcedElementSupport.aj (original)
+++ webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomSourcedElementSupport.aj Sun Mar 6 00:43:26 2016
@@ -404,19 +404,31 @@ public aspect AxiomSourcedElementSupport
}
public final XmlInput AxiomSourcedElement.getXmlInput(boolean cache, boolean incremental) throws StreamException {
- if (isExpanded() || (cache && OMDataSourceUtil.isDestructiveWrite(dataSource))) {
+ if (isExpanded()) {
return null;
}
- if (OMDataSourceUtil.isPullDataSource(dataSource) || (incremental && !OMDataSourceUtil.isPushDataSource(dataSource))) {
+ boolean pull;
+ if (OMDataSourceUtil.isPullDataSource(dataSource)) {
+ pull = true;
+ } else if (OMDataSourceUtil.isPushDataSource(dataSource)) {
+ if (incremental) {
+ return null;
+ }
+ pull = false;
+ } else {
+ pull = incremental;
+ }
+ if (cache && (pull && OMDataSourceUtil.isDestructiveRead(dataSource) || !pull && OMDataSourceUtil.isDestructiveWrite(dataSource))) {
+ return null;
+ }
+ if (pull) {
try {
return new StAXPullInput(dataSource.getReader());
} catch (XMLStreamException ex) {
throw new StreamException(ex);
}
- } else if (!incremental) {
- return new PushOMDataSourceInput(this, dataSource);
} else {
- return null;
+ return new PushOMDataSourceInput(this, dataSource);
}
}