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 2012/05/01 19:54:45 UTC
svn commit: r1332763 -
/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
Author: veithen
Date: Tue May 1 17:54:45 2012
New Revision: 1332763
URL: http://svn.apache.org/viewvc?rev=1332763&view=rev
Log:
Removed dead code: getDirectReader was never called with isExpanded == true.
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java?rev=1332763&r1=1332762&r2=1332763&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java Tue May 1 17:54:45 2012
@@ -227,25 +227,6 @@ public class OMSourcedElementImpl extend
}
/**
- * Get parser from data source. Note that getDataReader may consume the underlying data source.
- *
- * @return parser
- */
- private XMLStreamReader getDirectReader() {
- try {
- // If expansion has occurred, then the reader from the datasource is consumed or stale.
- // In such cases use the stream reader from the OMElementImpl
- if (isExpanded()) {
- return super.getXMLStreamReader();
- } else {
- return dataSource.getReader();
- }
- } catch (XMLStreamException ex) {
- throw new OMException("Error obtaining parser from data source for element " + getPrintableName(), ex);
- }
- }
-
- /**
* Set parser for OM, if not previously set. Since the builder is what actually constructs the
* tree on demand, this first creates a builder
*/
@@ -267,7 +248,11 @@ public class OMSourcedElementImpl extend
}
// Get the XMLStreamReader
- readerFromDS = getDirectReader();
+ try {
+ readerFromDS = dataSource.getReader();
+ } catch (XMLStreamException ex) {
+ throw new OMException("Error obtaining parser from data source for element " + getPrintableName(), ex);
+ }
// Advance past the START_DOCUMENT to the start tag.
// Remember the character encoding.
@@ -453,8 +438,13 @@ public class OMSourcedElementImpl extend
if (cache && isDestructiveRead()) {
forceExpand();
return super.getXMLStreamReader(true, configuration);
+ } else {
+ try {
+ return dataSource.getReader();
+ } catch (XMLStreamException ex) {
+ throw new OMException("Error obtaining parser from data source for element " + getPrintableName(), ex);
+ }
}
- return getDirectReader();
}
}