Buggy code:
public final class CSVSaveService { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final String DATA_TYPE = "dataType" ; private static final String FAILURE_MESSAGE = "failureMessage" ; private static final String LABEL = "label" ; private static final String RESPONSE_CODE = "responseCode" ; private static final String RESPONSE_MESSAGE = "responseMessage" ; private static final String SUCCESSFUL = "success" ; private static final String THREAD_NAME = "threadName" ; private static final String TIME_STAMP = "timeStamp" ; private static final String CSV_ELAPSED = "elapsed" ; private static final String CSV_BYTES = "bytes" ; private static final String CSV_THREAD_COUNT1 = "grpThreads" ; private static final String CSV_THREAD_COUNT2 = "allThreads" ; private static final String CSV_SAMPLE_COUNT = "SampleCount" ; private static final String CSV_ERROR_COUNT = "ErrorCount" ; private static final String CSV_URL = "URL" ; private static final String CSV_FILENAME = "Filename" ; private static final String CSV_LATENCY = "Latency" ; private static final String CSV_ENCODING = "Encoding" ; private static final String CSV_HOSTNAME = "Hostname" ; private static final String VARIABLE_NAME_QUOTE_CHAR = "\"" ; private static final SampleSaveConfiguration _saveConfig = SampleSaveConfiguration . staticConfig ( ) ; private static final String DEFAULT_DATE_FORMAT_STRING = "MM//dd//yy<seq2seq4repair_space>HH:mm:ss" ; private static final DateFormat DEFAULT_DATE_FORMAT = new SimpleDateFormat ( CSVSaveService . DEFAULT_DATE_FORMAT_STRING ) ; private CSVSaveService ( ) { } public static void processSamples ( String filename , Visualizer visualizer , ResultCollector resultCollector ) throws IOException { BufferedReader dataReader = null ; final boolean errorsOnly = resultCollector . isErrorLogging ( ) ; final boolean successOnly = resultCollector . isSuccessOnlyLogging ( ) ; try { dataReader = new BufferedReader ( new FileReader ( filename ) ) ; dataReader . mark ( 400 ) ; String line = dataReader . readLine ( ) ; if ( line == null ) { throw new IOException ( ( filename + ":<seq2seq4repair_space>unable<seq2seq4repair_space>to<seq2seq4repair_space>read<seq2seq4repair_space>header<seq2seq4repair_space>line" ) ) ; } long lineNumber = 1 ; SampleSaveConfiguration saveConfig = CSVSaveService . getSampleSaveConfiguration ( line , filename ) ; if ( saveConfig == null ) { CSVSaveService . log . info ( ( filename + "<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>appear<seq2seq4repair_space>to<seq2seq4repair_space>have<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>header.<seq2seq4repair_space>Using<seq2seq4repair_space>default<seq2seq4repair_space>configuration." ) ) ; saveConfig = ( ( SampleSaveConfiguration ) ( resultCollector . getSaveConfig ( ) . clone ( ) ) ) ; dataReader . reset ( ) ; lineNumber = 0 ; } String [ ] parts ; while ( ( ( parts = CSVSaveService . csvReadFile ( dataReader , saveConfig . getDelimiter ( ) . charAt ( 0 ) ) ) . length ) != 0 ) { lineNumber ++ ; SampleEvent event = CSVSaveService . makeResultFromDelimitedString ( parts , saveConfig , lineNumber ) ; if ( event != null ) { final SampleResult result = event . getResult ( ) ; <START_BUG> if ( resultCollector . isSampleWanted ( result . isSuccessful ( ) , errorsOnly , successOnly ) ) { <END_BUG> visualizer . add ( result ) ; } } } } finally { JOrphanUtils . closeQuietly ( dataReader ) ; } } public static SampleEvent makeResultFromDelimitedString ( final String inputLine , final SampleSaveConfiguration saveConfig , final long lineNumber ) { } private static SampleEvent makeResultFromDelimitedString ( final String [ ] parts , final SampleSaveConfiguration saveConfig , final long lineNumber ) { } public static String printableFieldNamesToString ( ) { } public static String printableFieldNamesToString ( SampleSaveConfiguration saveConfig ) { } private static final LinkedMap headerLabelMethods = new LinkedMap ( ) ; public static SampleSaveConfiguration getSampleSaveConfiguration ( String headerLine , String filename ) { } private static String [ ] splitHeader ( String headerLine , String delim ) { } private static boolean isVariableName ( final String label ) { } public static void saveCSVStats ( Vector data , FileWriter writer ) throws IOException { } public static void saveCSVStats ( Vector data , FileWriter writer , String [ ] headers ) throws IOException { } public static void saveCSVStats ( DefaultTableModel model , FileWriter writer ) throws IOException { } public static String resultToDelimitedString ( SampleEvent event ) { } public static String resultToDelimitedString ( SampleEvent event , final String delimiter ) { } private static String quoteDelimiters ( String input , char [ ] specialChars ) { } private static final int INITIAL = 0 ; private static final int PLAIN = 1 ; private static final int QUOTED = 2 ; private static final int EMBEDDEDQUOTE = 3 ; public static final char QUOTING_CHAR = '"' ; public static String [ ] csvReadFile ( BufferedReader infile , char delim ) throws IOException { } private static boolean isDelimOrEOL ( char delim , int ch ) { } public static String [ ] csvSplitString ( String line , char delim ) throws IOException { } }

Fix:
if ( ResultCollector . isSampleWanted ( result . isSuccessful ( ) , errorsOnly , successOnly ) ) {