Author: veithen Date: Wed Dec 10 11:38:32 2008 New Revision: 725399 URL: http://svn.apache.org/viewvc?rev=725399&view=rev Log: WSCOMMONS-182: Added a sanity check to SAXOMBuilder#getRootElement to avoid returning an incompletely built element/tree.
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/SAXOMBuilder.java Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/SAXOMBuilder.java URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/SAXOMBuilder.java?rev=725399&r1=725398&r2=725399&view=diff ============================================================================== --- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/SAXOMBuilder.java (original) +++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/SAXOMBuilder.java Wed Dec 10 11:38:32 2008 @@ -223,8 +223,17 @@ public void endEntity(String name) throws SAXException { } - /** @return Returns the root. */ + /** + * Get the root element of the Axiom tree built by this content handler. + * + * @return the root element of the tree + * @throws OMException if the tree is not complete + */ public OMElement getRootElement() { - return root; + if (root != null && root.isComplete()) { + return root; + } else { + throw new OMException("Tree not complete"); + } } }