Buggy code:
public class MailReaderSampler extends AbstractSampler { private static Logger log = LoggingManager . getLoggerForClass ( ) ; private static final String SERVER_TYPE = "host_type" ; private static final String SERVER = "host" ; private static final String USERNAME = "username" ; private static final String PASSWORD = "password" ; private static final String FOLDER = "folder" ; private static final String DELETE = "delete" ; private static final String NUM_MESSAGES = "num_messages" ; public static final String TYPE_POP3 = "pop3" ; public static final String TYPE_IMAP = "imap" ; public MailReaderSampler ( ) { } public SampleResult sample ( Entry e ) { SampleResult res = new SampleResult ( ) ; boolean isOK = false ; res . setSampleLabel ( getName ( ) ) ; res . sampleStart ( ) ; try { Properties props = new Properties ( ) ; Session session = Session . getDefaultInstance ( props , null ) ; Store store = session . getStore ( getServerType ( ) ) ; store . connect ( getServer ( ) , getUserName ( ) , getPassword ( ) ) ; Folder folder = store . getFolder ( getFolder ( ) ) ; folder . open ( READ_WRITE ) ; Message [ ] messages = folder . getMessages ( ) ; Message message ; StringBuffer data = new StringBuffer ( ) ; data . append ( ( ( messages . length ) + "<seq2seq4repair_space>new<seq2seq4repair_space>messages\n" ) ) ; int n = getNumMessages ( ) ; if ( ( n == ( - 1 ) ) || ( n > ( messages . length ) ) ) n = messages . length ; for ( int i = 0 ; i < n ; i ++ ) { message = messages [ i ] ; if ( i == 0 ) res . setContentType ( message . getContentType ( ) ) ; data . append ( ( ( "Message<seq2seq4repair_space>" + ( message . getMessageNumber ( ) ) ) + ":\n" ) ) ; data . append ( ( ( "Date:<seq2seq4repair_space>" + ( message . getSentDate ( ) ) ) + "\n" ) ) ; data . append ( "To:<seq2seq4repair_space>" ) ; Address [ ] recips = message . getAllRecipients ( ) ; for ( int j = 0 ; j < ( recips . length ) ; j ++ ) { data . append ( recips [ j ] . toString ( ) ) ; if ( j < ( ( recips . length ) - 1 ) ) data . append ( ";<seq2seq4repair_space>" ) ; } data . append ( "\n" ) ; data . append ( "From:<seq2seq4repair_space>" ) ; Address [ ] from = message . getFrom ( ) ; for ( int j = 0 ; j < ( from . length ) ; j ++ ) { data . append ( from [ j ] . toString ( ) ) ; if ( j < ( ( from . length ) - 1 ) ) data . append ( ";<seq2seq4repair_space>" ) ; } data . append ( "\n" ) ; data . append ( ( ( "Subject:<seq2seq4repair_space>" + ( message . getSubject ( ) ) ) + "\n" ) ) ; data . append ( ( "\n" + ( message . getContent ( ) ) ) ) ; if ( getDeleteMessages ( ) ) { message . setFlag ( DELETED , true ) ; } } folder . close ( true ) ; store . close ( ) ; res . setSamplerData ( ( ( ( ( ( getServerType ( ) ) + ":////" ) + ( getUserName ( ) ) ) + "@" ) + ( getServer ( ) ) ) ) ; res . setResponseData ( data . toString ( ) . getBytes ( ) ) ; res . setDataType ( TEXT ) ; <START_BUG> res . setResponseCodeOK ( ) ; <END_BUG> res . setResponseMessage ( "OK" ) ; isOK = true ; } catch ( Exception ex ) { MailReaderSampler . log . debug ( "" , ex ) ; res . setResponseCode ( "500" ) ; res . setResponseMessage ( ex . toString ( ) ) ; } res . sampleEnd ( ) ; res . setSuccessful ( isOK ) ; return res ; } public void setServerType ( String serverType ) { } public String getServerType ( ) { } public void setServer ( String server ) { } public String getServer ( ) { } public void setUserName ( String username ) { } public String getUserName ( ) { } public void setPassword ( String password ) { } public String getPassword ( ) { } public void setFolder ( String folder ) { } public String getFolder ( ) { } public void setNumMessages ( int num_messages ) { } public int getNumMessages ( ) { } public void setDeleteMessages ( boolean delete ) { } public boolean getDeleteMessages ( ) { } }

Fix:
res . setResponseCode ( "200" ) ;