Buggy code:
public final class OldSaveService { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; static final String PRESERVE = "preserve" ; static final String XML_SPACE = "xml:space" ; private static final String ASSERTION_RESULT_TAG_NAME = "assertionResult" ; private static final String BINARY = "binary" ; private static final String DATA_TYPE = "dataType" ; private static final String ERROR = "error" ; private static final String FAILURE = "failure" ; 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 SAMPLE_RESULT_TAG_NAME = "sampleResult" ; private static final String SUCCESSFUL = "success" ; private static final String THREAD_NAME = "threadName" ; private static final String TIME = "time" ; 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_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 SampleSaveConfiguration _saveConfig = SampleSaveConfiguration . staticConfig ( ) ; private static DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder ( ) ; private OldSaveService ( ) { } public static SampleResult makeResultFromDelimitedString ( String inputLine ) { } public static SampleResult makeResultFromDelimitedString ( String inputLine , SampleSaveConfiguration saveConfig ) { } public static String printableFieldNamesToString ( ) { } public static String printableFieldNamesToString ( SampleSaveConfiguration saveConfig ) { StringBuffer text = new StringBuffer ( ) ; String delim = saveConfig . getDelimiter ( ) ; <START_BUG> if ( ( saveConfig . saveTimestamp ( ) ) || ( ( saveConfig . formatter ( ) ) != null ) ) { <END_BUG> text . append ( OldSaveService . TIME_STAMP ) ; text . append ( delim ) ; } if ( saveConfig . saveTime ( ) ) { text . append ( OldSaveService . CSV_ELAPSED ) ; text . append ( delim ) ; } if ( saveConfig . saveLabel ( ) ) { text . append ( OldSaveService . LABEL ) ; text . append ( delim ) ; } if ( saveConfig . saveCode ( ) ) { text . append ( OldSaveService . RESPONSE_CODE ) ; text . append ( delim ) ; } if ( saveConfig . saveMessage ( ) ) { text . append ( OldSaveService . RESPONSE_MESSAGE ) ; text . append ( delim ) ; } if ( saveConfig . saveThreadName ( ) ) { text . append ( OldSaveService . THREAD_NAME ) ; text . append ( delim ) ; } if ( saveConfig . saveDataType ( ) ) { text . append ( OldSaveService . DATA_TYPE ) ; text . append ( delim ) ; } if ( saveConfig . saveSuccess ( ) ) { text . append ( OldSaveService . SUCCESSFUL ) ; text . append ( delim ) ; } if ( saveConfig . saveAssertionResultsFailureMessage ( ) ) { text . append ( OldSaveService . FAILURE_MESSAGE ) ; text . append ( delim ) ; } if ( saveConfig . saveBytes ( ) ) { text . append ( OldSaveService . CSV_BYTES ) ; text . append ( delim ) ; } if ( saveConfig . saveThreadCounts ( ) ) { text . append ( OldSaveService . CSV_THREAD_COUNT1 ) ; text . append ( delim ) ; text . append ( OldSaveService . CSV_THREAD_COUNT2 ) ; text . append ( delim ) ; } if ( saveConfig . saveUrl ( ) ) { text . append ( OldSaveService . CSV_URL ) ; text . append ( delim ) ; } if ( saveConfig . saveFileName ( ) ) { text . append ( OldSaveService . CSV_FILENAME ) ; text . append ( delim ) ; } if ( saveConfig . saveLatency ( ) ) { text . append ( OldSaveService . CSV_LATENCY ) ; text . append ( delim ) ; } if ( saveConfig . saveEncoding ( ) ) { text . append ( OldSaveService . CSV_ENCODING ) ; text . append ( delim ) ; } String resultString = null ; int size = text . length ( ) ; int delSize = delim . length ( ) ; if ( size >= delSize ) { resultString = text . substring ( 0 , ( size - delSize ) ) ; } else { resultString = text . toString ( ) ; } return resultString ; } public static void saveCSVStats ( Vector data , FileWriter writer ) throws IOException { } public static String resultToDelimitedString ( SampleResult sample ) { } public static String resultToDelimitedString ( SampleResult sample , String delimiter ) { } public static void saveSubTree ( HashTree subTree , OutputStream writer ) throws IOException { } public static SampleResult getSampleResult ( Configuration config ) { } private static List getConfigsFromTree ( HashTree subTree ) { } public static Configuration getConfiguration ( byte [ ] bin ) { } public static byte [ ] getBinaryData ( Configuration config ) { } public static AssertionResult getAssertionResult ( Configuration config ) { } public static Configuration getConfiguration ( AssertionResult assResult ) { } public static Configuration getConfiguration ( SampleResult result , SampleSaveConfiguration saveConfig ) { } public static Configuration getConfigForTestElement ( String named , TestElement item ) { } private static Configuration createConfigForString ( String name , String value ) { } public static synchronized HashTree loadSubTree ( InputStream in ) throws IOException { } public static TestElement createTestElement ( Configuration config ) throws ClassNotFoundException , IllegalAccessException , InstantiationException , ConfigurationException { } private static Collection createCollection ( Configuration config , String testClass ) throws ClassNotFoundException , IllegalAccessException , InstantiationException , ConfigurationException { }

Fix:
if ( saveConfig . saveTimestamp ( ) ) {