Author: veithen
Date: Tue May 14 17:16:28 2013
New Revision: 1482472
URL: http://svn.apache.org/r1482472
Log:
Fixed a potential NullPointerException when debug logs are enabled.
Modified:
webservices/axiom/trunk/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java
Modified:
webservices/axiom/trunk/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java?rev=1482472&r1=1482471&r2=1482472&view=diff
==============================================================================
---
webservices/axiom/trunk/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java
(original)
+++
webservices/axiom/trunk/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java
Tue May 14 17:16:28 2013
@@ -198,10 +198,11 @@ public class StAXOMBuilder extends StAXB
return token;
}
- // The current token should be the same as the
- // one just obtained. This bit of code is used to
- // detect invalid parser state.
- if (doTrace) {
+ // Note: if autoClose is enabled, then the parser may be null at
this point
+ if (doTrace && parser != null) {
+ // The current token should be the same as the
+ // one just obtained. This bit of code is used to
+ // detect invalid parser state.
int currentParserToken = parser.getEventType();
if (currentParserToken != token) {
@@ -218,10 +219,8 @@ public class StAXOMBuilder extends StAXB
"The parser is " + parser);
*/
}
- }
- // Now log the current state of the parser
- if (doTrace) {
+ // Now log the current state of the parser
logParserState();
}