Buggy code:
public class XPathAssertion extends AbstractTestElement implements Serializable , Assertion { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final String XPATH_KEY = "XPath.xpath" ; private static final String WHITESPACE_KEY = "XPath.whitespace" ; private static final String VALIDATE_KEY = "XPath.validate" ; private static final String TOLERANT_KEY = "XPath.tolerant" ; private static final String NEGATE_KEY = "XPath.negate" ; private static final String NAMESPACE_KEY = "XPath.namespace" ; private static final String QUIET_KEY = "XPath.quiet" ; private static final String REPORT_ERRORS_KEY = "XPath.report_errors" ; private static final String SHOW_WARNINGS_KEY = "XPath.show_warnings" ; public static final String DEFAULT_XPATH = "//" ; public AssertionResult getResult ( SampleResult response ) { AssertionResult result = new AssertionResult ( getName ( ) ) ; byte [ ] responseData = response . getResponseData ( ) ; if ( ( responseData . length ) == 0 ) { return result . setResultForNull ( ) ; } result . setFailure ( false ) ; result . setFailureMessage ( "" ) ; if ( XPathAssertion . log . isDebugEnabled ( ) ) { XPathAssertion . log . debug ( new StringBuffer ( "Validation<seq2seq4repair_space>is<seq2seq4repair_space>set<seq2seq4repair_space>to<seq2seq4repair_space>" ) . append ( isValidating ( ) ) . toString ( ) ) ; XPathAssertion . log . debug ( new StringBuffer ( "Whitespace<seq2seq4repair_space>is<seq2seq4repair_space>set<seq2seq4repair_space>to<seq2seq4repair_space>" ) . append ( isWhitespace ( ) ) . toString ( ) ) ; XPathAssertion . log . debug ( new StringBuffer ( "Tolerant<seq2seq4repair_space>is<seq2seq4repair_space>set<seq2seq4repair_space>to<seq2seq4repair_space>" ) . append ( isTolerant ( ) ) . toString ( ) ) ; } Document doc = null ; try { <START_BUG> doc = XPathUtil . makeDocument ( new ByteArrayInputStream ( responseData ) , isValidating ( ) , isWhitespace ( ) , isNamespace ( ) , isTolerant ( ) , isQuiet ( ) , showWarnings ( ) , reportErrors ( ) ) ; <END_BUG> } catch ( SAXException e ) { XPathAssertion . log . debug ( ( "Caught<seq2seq4repair_space>sax<seq2seq4repair_space>exception:<seq2seq4repair_space>" + e ) ) ; result . setError ( true ) ; result . setFailureMessage ( new StringBuffer ( "SAXException:<seq2seq4repair_space>" ) . append ( e . getMessage ( ) ) . toString ( ) ) ; return result ; } catch ( IOException e ) { XPathAssertion . log . warn ( "Cannot<seq2seq4repair_space>parse<seq2seq4repair_space>result<seq2seq4repair_space>content" , e ) ; result . setError ( true ) ; result . setFailureMessage ( new StringBuffer ( "IOException:<seq2seq4repair_space>" ) . append ( e . getMessage ( ) ) . toString ( ) ) ; return result ; } catch ( ParserConfigurationException e ) { XPathAssertion . log . warn ( "Cannot<seq2seq4repair_space>parse<seq2seq4repair_space>result<seq2seq4repair_space>content" , e ) ; result . setError ( true ) ; result . setFailureMessage ( new StringBuffer ( "ParserConfigurationException:<seq2seq4repair_space>" ) . append ( e . getMessage ( ) ) . toString ( ) ) ; return result ; } catch ( TidyException e ) { result . setError ( true ) ; result . setFailureMessage ( e . getMessage ( ) ) ; return result ; } if ( ( doc == null ) || ( ( doc . getDocumentElement ( ) ) == null ) ) { result . setError ( true ) ; result . setFailureMessage ( "Document<seq2seq4repair_space>is<seq2seq4repair_space>null,<seq2seq4repair_space>probably<seq2seq4repair_space>not<seq2seq4repair_space>parsable" ) ; return result ; } NodeList nodeList = null ; final String pathString = getXPathString ( ) ; try { XObject xObject = XPathAPI . eval ( doc , pathString ) ; switch ( xObject . getType ( ) ) { case XObject . CLASS_NODESET : nodeList = xObject . nodelist ( ) ; break ; case XObject . CLASS_BOOLEAN : if ( ! ( xObject . bool ( ) ) ) { result . setFailure ( ( ! ( isNegated ( ) ) ) ) ; result . setFailureMessage ( ( "No<seq2seq4repair_space>Nodes<seq2seq4repair_space>Matched<seq2seq4repair_space>" + pathString ) ) ; } return result ; default : result . setFailure ( true ) ; result . setFailureMessage ( ( "Cannot<seq2seq4repair_space>understand:<seq2seq4repair_space>" + pathString ) ) ; return result ; } } catch ( TransformerException e ) { result . setError ( true ) ; result . setFailureMessage ( new StringBuffer ( "TransformerException:<seq2seq4repair_space>" ) . append ( e . getMessage ( ) ) . append ( "<seq2seq4repair_space>for:" ) . append ( pathString ) . toString ( ) ) ; return result ; } if ( ( nodeList == null ) || ( ( nodeList . getLength ( ) ) == 0 ) ) { XPathAssertion . log . debug ( new StringBuffer ( "nodeList<seq2seq4repair_space>null<seq2seq4repair_space>no<seq2seq4repair_space>match<seq2seq4repair_space>" ) . append ( pathString ) . toString ( ) ) ; result . setFailure ( ( ! ( isNegated ( ) ) ) ) ; result . setFailureMessage ( ( "No<seq2seq4repair_space>Nodes<seq2seq4repair_space>Matched<seq2seq4repair_space>" + pathString ) ) ; return result ; } XPathAssertion . log . debug ( ( "nodeList<seq2seq4repair_space>length<seq2seq4repair_space>" + ( nodeList . getLength ( ) ) ) ) ; if ( ( XPathAssertion . log . isDebugEnabled ( ) ) & ( ! ( isNegated ( ) ) ) ) { for ( int i = 0 ; i < ( nodeList . getLength ( ) ) ; i ++ ) XPathAssertion . log . debug ( new StringBuffer ( "nodeList[" ) . append ( i ) . append ( "]<seq2seq4repair_space>" ) . append ( nodeList . item ( i ) ) . toString ( ) ) ; } result . setFailure ( isNegated ( ) ) ; if ( isNegated ( ) ) result . setFailureMessage ( "Specified<seq2seq4repair_space>XPath<seq2seq4repair_space>was<seq2seq4repair_space>found...<seq2seq4repair_space>Turn<seq2seq4repair_space>off<seq2seq4repair_space>negate<seq2seq4repair_space>if<seq2seq4repair_space>this<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>desired" ) ; return result ; } public String getXPathString ( ) { } public void setXPathString ( String xpath ) { } public void setWhitespace ( boolean whitespace ) { } public void setValidating ( boolean validate ) { } public void setNamespace ( boolean namespace ) { } public void setTolerant ( boolean tolerant ) { } public void setNegated ( boolean negate ) { } public boolean isWhitespace ( ) { } public boolean isValidating ( ) { } public boolean isNamespace ( ) { } public boolean isTolerant ( ) { } public boolean isNegated ( ) { } public void setReportErrors ( boolean val ) { }

Fix:
doc = XPathUtil . makeDocument ( new ByteArrayInputStream ( responseData ) , isValidating ( ) , isWhitespace ( ) , isNamespace ( ) , isTolerant ( ) , isQuiet ( ) , showWarnings ( ) , reportErrors ( ) , true ) ;