Some tweaks to make Axis2 happy.
diff --git a/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomSourcedElementSupport.aj b/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomSourcedElementSupport.aj
index d6f54a4..a43674d 100644
--- a/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomSourcedElementSupport.aj
+++ b/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomSourcedElementSupport.aj
@@ -404,19 +404,31 @@
}
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);
}
}