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 LEVEL_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 ) { } protected String extractOption ( ) { } protected 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 ) { } } 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 ) { } } private static class DatePatternConverter extends PatternConverter { private DateFormat df ; private Date date ; DatePatternConverter ( FormattingInfo formattingInfo , DateFormat df ) { } public String convert ( LoggingEvent event ) { } } private static class MDCPatternConverter extends PatternConverter { private String key ; MDCPatternConverter ( FormattingInfo formattingInfo , String key ) { } public String convert ( LoggingEvent event ) { } } private class LocationPatternConverter extends PatternConverter { int type ; LocationPatternConverter ( FormattingInfo formattingInfo , int type ) { } public String convert ( LoggingEvent event ) { } } private abstract static class NamedPatternConverter extends PatternConverter { int precision ; NamedPatternConverter ( FormattingInfo formattingInfo , int precision ) { } abstract String getFullyQualifiedName ( LoggingEvent event ) ; public String convert ( LoggingEvent event ) { } } private class ClassNamePatternConverter extends PatternParser . NamedPatternConverter { ClassNamePatternConverter ( FormattingInfo formattingInfo , int precision ) { } String getFullyQualifiedName ( LoggingEvent event ) { return event . getLocationInformation ( ) . getClassName ( ) ; } } private class CategoryPatternConverter extends PatternParser . NamedPatternConverter { CategoryPatternConverter ( FormattingInfo formattingInfo , int precision ) { } String getFullyQualifiedName ( LoggingEvent event ) { <START_BUG> return event . categoryName ; <END_BUG> } } }

Fix:
return event . loggerName ;