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" ; public static final String DEFAULT_XPATH = "//" ; public AssertionResult getResult ( SampleResult response ) { <START_BUG> AssertionResult result = new AssertionResult ( ) ; <END_BUG> 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 { doc = XPathUtil . makeDocument ( new ByteArrayInputStream ( responseData ) , isValidating ( ) , isWhitespace ( ) , isNamespace ( ) , isTolerant ( ) ) ; } 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 ; } 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 ; try { nodeList = XPathAPI . selectNodeList ( doc , getXPathString ( ) ) ; } catch ( TransformerException e ) { result . setError ( true ) ; result . setFailureMessage ( new StringBuffer ( "TransformerException:<seq2seq4repair_space>" ) . append ( e . getMessage ( ) ) . 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 ( getXPathString ( ) ) . toString ( ) ) ; result . setFailure ( ( ! ( isNegated ( ) ) ) ) ; result . setFailureMessage ( ( "No<seq2seq4repair_space>Nodes<seq2seq4repair_space>Matched<seq2seq4repair_space>" + ( getXPathString ( ) ) ) ) ; 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 ( ) { } }

Fix:
AssertionResult result = new AssertionResult ( getName ( ) ) ;