Buggy code:
public class PatternParser { private static final char ESCAPE_CHAR = '%' ; private static final int LITERAL_STATE = 0 ; private static final int CONVERTER_STATE = 1 ; private static final int MINUS_STATE = 2 ; private static final int DOT_STATE = 3 ; private static final int MIN_STATE = 4 ; private static final int MAX_STATE = 5 ; static final int FULL_LOCATION_CONVERTER = 1000 ; static final int METHOD_LOCATION_CONVERTER = 1001 ; static final int CLASS_LOCATION_CONVERTER = 1002 ; static final int LINE_LOCATION_CONVERTER = 1003 ; static final int FILE_LOCATION_CONVERTER = 1004 ; static final int RELATIVE_TIME_CONVERTER = 2000 ; static final int THREAD_CONVERTER = 2001 ; static final int PRIORITY_CONVERTER = 2002 ; static final int NDC_CONVERTER = 2003 ; static final int MESSAGE_CONVERTER = 2004 ; int state ; protected StringBuffer currentLiteral = new StringBuffer ( 32 ) ; protected int patternLength ; protected int i ; PatternConverter head ; PatternConverter tail ; protected FormattingInfo formattingInfo = new FormattingInfo ( ) ; protected String pattern ; public PatternParser ( String pattern ) { } private void addToList ( PatternConverter pc ) { } private String extractOption ( ) { } private int extractPrecisionOption ( ) { } public PatternConverter parse ( ) { } protected void finalizeConverter ( char c ) { } protected void addConverter ( PatternConverter pc ) { } private static class BasicPatternConverter extends PatternConverter { int type ; BasicPatternConverter ( FormattingInfo formattingInfo , int type ) { } public String convert ( LoggingEvent event ) { switch ( type ) { case PatternParser . RELATIVE_TIME_CONVERTER : return Long . toString ( ( ( event . timeStamp ) - ( LoggingEvent . getStartTime ( ) ) ) ) ; case PatternParser . THREAD_CONVERTER : return event . getThreadName ( ) ; case PatternParser . PRIORITY_CONVERTER : return event . priority . toString ( ) ; case PatternParser . NDC_CONVERTER : return event . getNDC ( ) ; case PatternParser . MESSAGE_CONVERTER : { return event . getRenderedMessage ( ) ; } default : return null ; } } } private static class LiteralPatternConverter extends PatternConverter { private String literal ; LiteralPatternConverter ( String value ) { } public final void format ( StringBuffer sbuf , LoggingEvent event ) { } public String convert ( LoggingEvent event ) { return literal ; } } private static class DatePatternConverter extends PatternConverter { private DateFormat df ; private Date date ; DatePatternConverter ( FormattingInfo formattingInfo , DateFormat df ) { } public String convert ( LoggingEvent event ) { date . setTime ( event . timeStamp ) ; String converted = null ; try { converted = df . format ( date ) ; } catch ( Exception ex ) { <START_BUG> LogLog . error ( ( ( "Error<seq2seq4repair_space>occured<seq2seq4repair_space>while<seq2seq4repair_space>converting<seq2seq4repair_space>date.<seq2seq4repair_space>Exception<seq2seq4repair_space>message:<seq2seq4repair_space>" + ( ex . getMessage ( ) ) ) + "." ) ) ; <END_BUG> } return converted ; } } private class LocationPatternConverter extends PatternConverter { int type ; LocationPatternConverter ( FormattingInfo formattingInfo , int type ) { } public String convert ( LoggingEvent event ) { LocationInfo locationInfo = event . getLocationInformation ( ) ; switch ( type ) { case PatternParser . FULL_LOCATION_CONVERTER : return locationInfo . fullInfo ; case PatternParser . METHOD_LOCATION_CONVERTER : return locationInfo . getMethodName ( ) ; case PatternParser . LINE_LOCATION_CONVERTER : return locationInfo . getLineNumber ( ) ; case PatternParser . FILE_LOCATION_CONVERTER : return locationInfo . getFileName ( ) ; default : return null ; } } } private abstract static class NamedPatternConverter extends PatternConverter { int precision ; NamedPatternConverter ( FormattingInfo formattingInfo , int precision ) { } abstract String getFullyQualifiedName ( LoggingEvent event ) { } public String convert ( LoggingEvent event ) { String n = getFullyQualifiedName ( event ) ; if ( ( precision ) <= 0 ) return n ; else { int len = n . length ( ) ; int end = len - 1 ; for ( int i = precision ; i > 0 ; i -- ) { end = n . lastIndexOf ( '.' , ( end - 1 ) ) ; if ( end == ( - 1 ) ) return n ; } return n . substring ( ( end + 1 ) , len ) ; } } } private class ClassNamePatternConverter extends PatternParser . NamedPatternConverter { ClassNamePatternConverter ( FormattingInfo formattingInfo , int precision ) { } String getFullyQualifiedName ( LoggingEvent event ) { } } private class CategoryPatternConverter extends PatternParser . NamedPatternConverter { CategoryPatternConverter ( FormattingInfo formattingInfo , int precision ) { } String getFullyQualifiedName ( LoggingEvent event ) { } } }

Fix:
LogLog . error ( "Error<seq2seq4repair_space>occured<seq2seq4repair_space>while<seq2seq4repair_space>converting<seq2seq4repair_space>date." , ex ) ;