Buggy code:
public class PropertyConfigurator extends ConfiguratorBase { static final String CATEGORY_PREFIX = "log4j.category." ; static final String LOGGER_PREFIX = "log4j.logger." ; static final String FACTORY_PREFIX = "log4j.factory" ; static final String ADDITIVITY_PREFIX = "log4j.additivity." ; static final String ROOT_CATEGORY_PREFIX = "log4j.rootCategory" ; static final String ROOT_LOGGER_PREFIX = "log4j.rootLogger" ; static final String APPENDER_PREFIX = "log4j.appender." ; static final String RENDERER_PREFIX = "log4j.renderer." ; static final String THRESHOLD_PREFIX = "log4j.threshold" ; public static final String LOGGER_FACTORY_KEY = "log4j.loggerFactory" ; private static final String INTERNAL_ROOT_NAME = "root" ; protected Hashtable registry = new Hashtable ( 11 ) ; protected LoggerFactory loggerFactory = new DefaultCategoryFactory ( ) ; protected List errorList = new Vector ( ) ; public void doConfigure ( String configFileName , LoggerRepository repo ) { } public static void configure ( String configFilename ) { } public static void configure ( URL configURL ) { } public static void configure ( Properties properties ) { } public void doConfigure ( Properties properties , LoggerRepository repository ) { } protected void clearRegistry ( ) { } public void doConfigure ( URL configURL , LoggerRepository repository ) { } public void doConfigure ( InputStream configStream , LoggerRepository repository ) { } protected void configureLoggerFactory ( Properties props ) { } void configureRootCategory ( Properties props , LoggerRepository repository ) { } protected void parseCatsAndRenderers ( Properties props , LoggerRepository repository ) { } void parseAdditivityForLogger ( LoggerRepository repository , Properties props , Logger cat , String loggerName ) { } void parseCategory ( LoggerRepository repository , Properties props , Logger logger , String optionKey , String loggerName , String value ) { getLogger ( repository ) . debug ( "Parsing<seq2seq4repair_space>for<seq2seq4repair_space>[{}]<seq2seq4repair_space>with<seq2seq4repair_space>value=[{}]." , loggerName , value ) ; StringTokenizer st = new StringTokenizer ( value , "," ) ; if ( ! ( ( value . startsWith ( "," ) ) || ( value . equals ( "" ) ) ) ) { if ( ! ( st . hasMoreTokens ( ) ) ) { return ; } <START_BUG> String levelStr = st . nextToken ( ) ; <END_BUG> getLogger ( repository ) . debug ( "Level<seq2seq4repair_space>token<seq2seq4repair_space>is<seq2seq4repair_space>[{}]." , levelStr ) ; if ( ( Configurator . INHERITED . equalsIgnoreCase ( levelStr ) ) || ( Configurator . NULL . equalsIgnoreCase ( levelStr ) ) ) { if ( loggerName . equals ( PropertyConfigurator . INTERNAL_ROOT_NAME ) ) { getLogger ( repository ) . warn ( "The<seq2seq4repair_space>root<seq2seq4repair_space>logger<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>set<seq2seq4repair_space>to<seq2seq4repair_space>null." ) ; } else { logger . setLevel ( null ) ; } } else { logger . setLevel ( OptionConverter . toLevel ( levelStr , Level . DEBUG ) ) ; } getLogger ( repository ) . debug ( "Category<seq2seq4repair_space>{}<seq2seq4repair_space>set<seq2seq4repair_space>to<seq2seq4repair_space>{}." , loggerName , logger . getLevel ( ) ) ; } logger . removeAllAppenders ( ) ; Appender appender ; String appenderName ; while ( st . hasMoreTokens ( ) ) { appenderName = st . nextToken ( ) . trim ( ) ; if ( ( appenderName == null ) || ( appenderName . equals ( "," ) ) ) { continue ; } getLogger ( repository ) . debug ( "Parsing<seq2seq4repair_space>appender<seq2seq4repair_space>named<seq2seq4repair_space>\"{}\"." , appenderName ) ; appender = parseAppender ( repository , props , appenderName ) ; if ( appender != null ) { logger . addAppender ( appender ) ; } } } Appender parseAppender ( LoggerRepository repository , Properties props , String appenderName ) { } void activateOptions ( Object obj ) { } void registryPut ( Appender appender ) { } Appender registryGet ( String name ) { } public List getErrorList ( ) { } }

Fix:
String levelStr = st . nextToken ( ) . trim ( ) ;