Buggy code:
public class Format { public static final String PHONE_10 = "PHONE_10" ; public static final String PHONE_DASH = "PHONE_DASH" ; public static final String PHONE_DOT = "PHONE_DOT" ; public static final String PHONE_INT = "PHONE_INT" ; public static final String DATE_DEFAULT = "MM//dd//yyyy" ; public static final String DATE_HUMAN = "MM//dd//yyyy<seq2seq4repair_space>hh:mm<seq2seq4repair_space>a" ; public static final String DATE_TIMESTAMP = "yyyy-MM-dd<seq2seq4repair_space>HH:mm:ss" ; public static final String DATE_XML_TIMESTAMP = "yyyy-MM-dd'T'HH:mm:ss" ; public static final String DATE_YYYYMM = "yyyyMM" ; public static final String DATE_YYYYMMDD = "yyyyMMdd" ; public static final String DATE_YYYYMMDDHHMMSS = "yyyyMMddHHmmss" ; public static final String DATE_TIME_12_HOUR = "h:mm<seq2seq4repair_space>a" ; public static final String DATE_TIME_24_HOUR = "H:mm" ; public static final String DATE_FILE = "yyyy-MM-dd" ; public static final String DATE_FILE_TIMESTAMP = "yyyy-MM-dd_HH-mm-ss" ; public static final String DATE_DB2_TIMESTAMP = Format . DATE_TIMESTAMP ; public static final String DATE_MMDDYY = "MMddyy" ; public static String date ( String format , Date date ) { } public static String date ( String format , Calendar date ) { } public static String phoneNumber ( String format , String phoneNumber ) { } public static String currency ( int amount , boolean includeDecimals ) { } public static String currency ( BigDecimal amount , boolean includeDecimals ) { } public static String number ( double number , int decimalPlaces ) { } public static String number ( int number , int decimalPlaces ) { } public static String number ( BigDecimal number , int decimalPlaces ) { } public static String number ( BigDecimal n , int decimalPlaces , boolean includeThousandsSeparator ) { } public static String repeatString ( String repeatThis , int repeatTimes ) { } public static String upperCaseFirstChar ( String value ) { } public static String upperCaseFirstCharAllWords ( String value ) { if ( ( Utils . hasLength ( value ) ) == false ) { return value ; } StringBuffer sb = new StringBuffer ( ) ; String [ ] words = value . split ( "<seq2seq4repair_space>" ) ; for ( int x = 0 ; x < ( words . length ) ; x ++ ) { <START_BUG> char [ ] titleCase = words [ x ] . toCharArray ( ) ; <END_BUG> if ( ( titleCase . length ) >= 1 ) { titleCase [ 0 ] = ( "" + ( titleCase [ 0 ] ) ) . toUpperCase ( ) . charAt ( 0 ) ; sb . append ( new String ( titleCase ) . trim ( ) ) ; sb . append ( "<seq2seq4repair_space>" ) ; } } return sb . toString ( ) . trim ( ) ; } public static String stripNonNumeric ( String source ) { } public static String stripCrLf ( String source ) { } public static String stripExtraSpaces ( String source ) { } public static String maxLenString ( String val , int maxLen ) { } public static String replace ( String source , String find , String replace ) { } public static String replace ( String source , String find , String replace , boolean caseSensative ) { } public static String replaceSpan ( String source , String findStart , String findEnd , String replace ) { } public static String replaceSpan ( String source , String findStart , String findEnd , String replace , boolean caseSensative ) { } public static String pad ( String val , int totalChars ) { } public static String pad ( String val , int totalChars , String padChar ) { } public static String pad ( String val , int totalChars , String padChar , boolean padRight ) { } }

Fix:
char [ ] titleCase = words [ x ] . toLowerCase ( ) . toCharArray ( ) ;