Buggy code:
public class HTMLAssertion extends AbstractTestElement implements Serializable , Assertion { public static final String DEFAULT_DOCTYPE = "omit" ; public static final String DOCTYPE_KEY = "html_assertion_doctype" ; public static final String ERRORS_ONLY_KEY = "html_assertion_errorsonly" ; public static final String ERROR_THRESHOLD_KEY = "html_assertion_error_threshold" ; public static final String WARNING_THRESHOLD_KEY = "html_assertion_warning_threshold" ; public static final String FORMAT_KEY = "html_assertion_format" ; public static final String FILENAME_KEY = "html_assertion_filename" ; private static transient Logger log = LoggingManager . getLoggerForClass ( ) ; public HTMLAssertion ( ) { } public AssertionResult getResult ( SampleResult inResponse ) { HTMLAssertion . log . debug ( "HTMLAssertions.getResult()<seq2seq4repair_space>called" ) ; AssertionResult result = new AssertionResult ( ) ; <START_BUG> if ( ( inResponse . getResponseData ( ) ) == null ) { <END_BUG> return result . setResultForNull ( ) ; } result . setFailure ( false ) ; Tidy tidy = null ; try { HTMLAssertion . log . debug ( "HTMLAssertions.getResult():<seq2seq4repair_space>Setup<seq2seq4repair_space>tidy<seq2seq4repair_space>..." ) ; HTMLAssertion . log . debug ( ( "doctype:<seq2seq4repair_space>" + ( getDoctype ( ) ) ) ) ; HTMLAssertion . log . debug ( ( "errors<seq2seq4repair_space>only:<seq2seq4repair_space>" + ( isErrorsOnly ( ) ) ) ) ; HTMLAssertion . log . debug ( ( "error<seq2seq4repair_space>threshold:<seq2seq4repair_space>" + ( getErrorThreshold ( ) ) ) ) ; HTMLAssertion . log . debug ( ( "warning<seq2seq4repair_space>threshold:<seq2seq4repair_space>" + ( getWarningThreshold ( ) ) ) ) ; HTMLAssertion . log . debug ( ( "html<seq2seq4repair_space>mode:<seq2seq4repair_space>" + ( isHTML ( ) ) ) ) ; HTMLAssertion . log . debug ( ( "xhtml<seq2seq4repair_space>mode:<seq2seq4repair_space>" + ( isXHTML ( ) ) ) ) ; HTMLAssertion . log . debug ( ( "xml<seq2seq4repair_space>mode:<seq2seq4repair_space>" + ( isXML ( ) ) ) ) ; tidy = new Tidy ( ) ; tidy . setCharEncoding ( UTF8 ) ; tidy . setQuiet ( false ) ; tidy . setShowWarnings ( true ) ; tidy . setOnlyErrors ( isErrorsOnly ( ) ) ; tidy . setDocType ( getDoctype ( ) ) ; if ( isXHTML ( ) ) { tidy . setXHTML ( true ) ; } else if ( isXML ( ) ) { tidy . setXmlTags ( true ) ; } HTMLAssertion . log . debug ( ( "err<seq2seq4repair_space>file:<seq2seq4repair_space>" + ( getFilename ( ) ) ) ) ; tidy . setErrfile ( getFilename ( ) ) ; if ( HTMLAssertion . log . isDebugEnabled ( ) ) { HTMLAssertion . log . debug ( ( "getParser<seq2seq4repair_space>:<seq2seq4repair_space>tidy<seq2seq4repair_space>parser<seq2seq4repair_space>created<seq2seq4repair_space>-<seq2seq4repair_space>" + tidy ) ) ; } HTMLAssertion . log . debug ( "HTMLAssertions.getResult():<seq2seq4repair_space>Tidy<seq2seq4repair_space>instance<seq2seq4repair_space>created!" ) ; } catch ( Exception e ) { HTMLAssertion . log . error ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>instantiate<seq2seq4repair_space>tidy<seq2seq4repair_space>parser" , e ) ; result . setFailure ( true ) ; result . setFailureMessage ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>instantiate<seq2seq4repair_space>tidy<seq2seq4repair_space>parser" ) ; return result ; } try { HTMLAssertion . log . debug ( "HTMLAssertions.getResult():<seq2seq4repair_space>start<seq2seq4repair_space>parsing<seq2seq4repair_space>with<seq2seq4repair_space>tidy<seq2seq4repair_space>..." ) ; StringWriter errbuf = new StringWriter ( ) ; tidy . setErrout ( new PrintWriter ( errbuf ) ) ; ByteArrayOutputStream os = new ByteArrayOutputStream ( ) ; HTMLAssertion . log . debug ( "Start<seq2seq4repair_space>:<seq2seq4repair_space>parse" ) ; Node node = tidy . parse ( new ByteArrayInputStream ( inResponse . getResponseData ( ) ) , os ) ; if ( HTMLAssertion . log . isDebugEnabled ( ) ) { HTMLAssertion . log . debug ( ( "node<seq2seq4repair_space>:<seq2seq4repair_space>" + node ) ) ; } HTMLAssertion . log . debug ( "End<seq2seq4repair_space>:<seq2seq4repair_space>parse" ) ; HTMLAssertion . log . debug ( "HTMLAssertions.getResult():<seq2seq4repair_space>parsing<seq2seq4repair_space>with<seq2seq4repair_space>tidy<seq2seq4repair_space>done!" ) ; HTMLAssertion . log . debug ( ( "Output:<seq2seq4repair_space>" + ( os . toString ( ) ) ) ) ; writeOutput ( errbuf . toString ( ) ) ; if ( ( ( tidy . getParseErrors ( ) ) > ( getErrorThreshold ( ) ) ) || ( ( ! ( isErrorsOnly ( ) ) ) && ( ( tidy . getParseWarnings ( ) ) > ( getWarningThreshold ( ) ) ) ) ) { HTMLAssertion . log . debug ( "HTMLAssertions.getResult():<seq2seq4repair_space>errors//warnings<seq2seq4repair_space>detected:" ) ; HTMLAssertion . log . debug ( errbuf . toString ( ) ) ; result . setFailure ( true ) ; result . setFailureMessage ( MessageFormat . format ( ( ( ( ( ( ( ( ( ( "Tidy<seq2seq4repair_space>Parser<seq2seq4repair_space>errors:<seq2seq4repair_space>" + ( tidy . getParseErrors ( ) ) ) + "<seq2seq4repair_space>(allowed<seq2seq4repair_space>" ) + ( getErrorThreshold ( ) ) ) + ")<seq2seq4repair_space>" ) + "Tidy<seq2seq4repair_space>Parser<seq2seq4repair_space>warnings:<seq2seq4repair_space>" ) + ( tidy . getParseWarnings ( ) ) ) + "<seq2seq4repair_space>(allowed<seq2seq4repair_space>" ) + ( getWarningThreshold ( ) ) ) + ")" ) , new Object [ 0 ] ) ) ; } else if ( ( ( tidy . getParseErrors ( ) ) > 0 ) || ( ( tidy . getParseWarnings ( ) ) > 0 ) ) { HTMLAssertion . log . debug ( "HTMLAssertions.getResult():<seq2seq4repair_space>there<seq2seq4repair_space>were<seq2seq4repair_space>errors//warnings<seq2seq4repair_space>but<seq2seq4repair_space>threshold<seq2seq4repair_space>to<seq2seq4repair_space>high" ) ; result . setFailure ( false ) ; } else { HTMLAssertion . log . debug ( "HTMLAssertions.getResult():<seq2seq4repair_space>no<seq2seq4repair_space>errors//warnings<seq2seq4repair_space>detected:" ) ; result . setFailure ( false ) ; } } catch ( Exception e ) { HTMLAssertion . log . warn ( "Cannot<seq2seq4repair_space>parse<seq2seq4repair_space>result<seq2seq4repair_space>content" , e ) ; result . setFailure ( true ) ; result . setFailureMessage ( e . getMessage ( ) ) ; } return result ; } private void writeOutput ( String inOutput ) { } public String getDoctype ( ) { } public boolean isErrorsOnly ( ) { } public long getErrorThreshold ( ) { } public long getWarningThreshold ( ) { } public void setDoctype ( String inDoctype ) { } public void setErrorsOnly ( boolean inErrorsOnly ) { } public void setErrorThreshold ( long inErrorThreshold ) { } public void setWarningThreshold ( long inWarningThreshold ) { } public void setHTML ( ) { } public boolean isHTML ( ) { } public void setXHTML ( ) { } public boolean isXHTML ( ) { } public void setXML ( ) { } public boolean isXML ( ) { } public String getFilename ( ) { } public void setFilename ( String inName ) { } }

Fix:
if ( ( inResponse . getResponseData ( ) . length ) == 0 ) {