Buggy code:
public class DatePickerSettings implements Serializable { private static final long serialVersionUID = 1L ; private static Log log = LogFactory . getLog ( DatePickerSettings . class ) ; private static Properties dateformats = new Properties ( ) ; private String ifFormat = null ; private boolean mode = true ; private int firstDay = 0 ; private boolean weekNumbers = true ; private String align = null ; private boolean showsTime = false ; private String timeFormat = null ; private boolean electric = true ; private boolean showOthers = false ; private ResourceReference style = null ; private ResourceReference icon = null ; private ResourceReference language = null ; public DatePickerSettings ( ) { } public String toScript ( Locale locale , String format ) { if ( format != null ) { boolean showTime = false ; String timeFormat = "24" ; char prev = 0 ; StringBuffer sb = new StringBuffer ( ) ; for ( int i = 0 ; i < ( format . length ( ) ) ; i ++ ) { char ch = format . charAt ( i ) ; if ( ch == 'd' ) { if ( prev != 'd' ) { sb . append ( "%d" ) ; } prev = ch ; } else if ( ch == 'M' ) { if ( prev != 'M' ) { sb . append ( "%m" ) ; } prev = ch ; } else if ( ch == 'y' ) { if ( prev != 'y' ) { sb . append ( "%Y" ) ; } prev = ch ; } else if ( ch == 'H' ) { showTime = true ; if ( prev != 'H' ) { sb . append ( "%H" ) ; } prev = ch ; } else if ( ch == 'h' ) { timeFormat = "12" ; showTime = true ; if ( prev != 'h' ) { sb . append ( "%I" ) ; } prev = ch ; } else if ( ch == 'm' ) { showTime = true ; if ( prev != 'm' ) { sb . append ( "%M" ) ; } prev = ch ; } else if ( ch == 's' ) { showTime = true ; if ( prev != 's' ) { sb . append ( "%S" ) ; } prev = ch ; } else if ( ch == 'a' ) { if ( prev != 'a' ) { sb . append ( "%P" ) ; } prev = ch ; } else if ( ( "GwWDFEkKSzZ" . indexOf ( ch ) ) != ( - 1 ) ) { prev = 0 ; } else if ( prev != 0 ) { sb . append ( ch ) ; } } setIfFormat ( sb . toString ( ) . trim ( ) ) ; setShowsTime ( showTime ) ; setTimeFormat ( timeFormat ) ; } StringBuffer b = new StringBuffer ( ) ; if ( ! ( isMode ( ) ) ) { b . append ( "\n\tmode<seq2seq4repair_space>:<seq2seq4repair_space>false," ) ; } if ( ( getFirstDay ( ) ) != 0 ) { <START_BUG> b . append ( "\n\tfistDay<seq2seq4repair_space>:<seq2seq4repair_space>" ) . append ( getFirstDay ( ) ) . append ( "," ) ; <END_BUG> } if ( ! ( isWeekNumbers ( ) ) ) { b . append ( "\n\tweekNumbers<seq2seq4repair_space>:<seq2seq4repair_space>false," ) ; } if ( ( getAlign ( ) ) != null ) { b . append ( "\n\talign<seq2seq4repair_space>:<seq2seq4repair_space>" ) . append ( getAlign ( ) ) . append ( "," ) ; } if ( isShowsTime ( ) ) { b . append ( "\n\tshowsTime<seq2seq4repair_space>:<seq2seq4repair_space>true," ) ; } if ( ( getTimeFormat ( ) ) != null ) { b . append ( "\n\ttimeFormat<seq2seq4repair_space>:<seq2seq4repair_space>" ) . append ( getTimeFormat ( ) ) . append ( "," ) ; } if ( ! ( isElectric ( ) ) ) { b . append ( "\n\telectric<seq2seq4repair_space>:<seq2seq4repair_space>false," ) ; } if ( isShowOthers ( ) ) { b . append ( "\n\tshowOthers<seq2seq4repair_space>:<seq2seq4repair_space>true," ) ; } String ifFormat = getIfFormat ( locale ) ; if ( ifFormat != null ) { b . append ( "\n\t\tifFormat<seq2seq4repair_space>:<seq2seq4repair_space>\"" ) . append ( ifFormat ) . append ( "\"" ) ; } return b . toString ( ) ; } public final PackageResourceReference newButtonIconRed ( ) { } public final PackageResourceReference newButtonIconPlain ( ) { } public final PackageResourceReference newButtonIconBlue ( ) { } public final PackageResourceReference newStyleAqua ( ) { } public final PackageResourceReference newStyleWinter ( ) { } public final PackageResourceReference newStyleBlue ( ) { } public final PackageResourceReference newStyleSummer ( ) { } public final PackageResourceReference newStyleGreen ( ) { } public final PackageResourceReference newStyleSystem ( ) { } public final PackageResourceReference newStyleTas ( ) { } public final PackageResourceReference newStyleWin2k1 ( ) { } public final PackageResourceReference newStyleWin2k2 ( ) { } public final PackageResourceReference newStyleWin2kCold1 ( ) { } public final PackageResourceReference newStyleWin2kCold2 ( ) { } public String getAlign ( ) { } public void setAlign ( String align ) { } public boolean isElectric ( ) { } public void setElectric ( boolean electric ) { } public int getFirstDay ( ) { } public void setFirstDay ( int firstDay ) { } public String getIfFormat ( Locale locale ) { } public void setIfFormat ( String ifFormat ) { } public boolean isMode ( ) { } public void setMode ( boolean mode ) { } public boolean isShowOthers ( ) { } public void setShowOthers ( boolean showOthers ) { } public boolean isShowsTime ( ) { } public void setShowsTime ( boolean showsTime ) { } public String getTimeFormat ( ) { } public void setTimeFormat ( String timeFormat ) { } public boolean isWeekNumbers ( ) { } public void setWeekNumbers ( boolean weekNumbers ) { } public ResourceReference getIcon ( ) { } public void setIcon ( ResourceReference icon ) { }

Fix:
b . append ( "\n\tfirstDay<seq2seq4repair_space>:<seq2seq4repair_space>" ) . append ( getFirstDay ( ) ) . append ( "," ) ;