You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by di...@apache.org on 2007/06/19 04:14:57 UTC

svn commit: r548558 - /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java

Author: dims
Date: Mon Jun 18 19:14:56 2007
New Revision: 548558

URL: http://svn.apache.org/viewvc?view=rev&rev=548558
Log:
Fix for WSCOMMONS-196 - NPE in StAXOMBuilder when parsing from DOMSource

Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java?view=diff&rev=548558&r1=548557&r2=548558
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java Mon Jun 18 19:14:56 2007
@@ -33,6 +33,7 @@
 import javax.xml.stream.XMLStreamConstants;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.Location;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.InputStream;
@@ -222,7 +223,10 @@
         processNamespaceData(node);
         // fill in the attributes
         processAttributes(node);
-        node.setLineNumber(parser.getLocation().getLineNumber());
+        Location location = parser.getLocation();
+        if(location != null) {
+            node.setLineNumber(location.getLineNumber());
+        }
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org