Buggy code:
public class LogFactoryImpl implements Configurable , GenericConfigurable , LogFactory { private static Localizer _loc = Localizer . forPackage ( LogFactoryImpl . class ) ; private static Localizer _locEn = Localizer . forPackage ( LogFactoryImpl . class , Locale . ENGLISH ) ; public static final String TRACE_STR = LogFactoryImpl . _locEn . get ( "log-trace" ) . getMessage ( ) ; public static final String INFO_STR = LogFactoryImpl . _locEn . get ( "log-info" ) . getMessage ( ) ; public static final String WARN_STR = LogFactoryImpl . _locEn . get ( "log-warn" ) . getMessage ( ) ; public static final String ERROR_STR = LogFactoryImpl . _locEn . get ( "log-error" ) . getMessage ( ) ; public static final String FATAL_STR = LogFactoryImpl . _locEn . get ( "log-fatal" ) . getMessage ( ) ; public static final String STDOUT = "stdout" ; public static final String STDERR = "stderr" ; private static final String NEWLINE = J2DoPrivHelper . getLineSeparator ( ) ; protected final long initializationMillis ; private Map _logs = new ConcurrentHashMap ( ) ; private short _defaultLogLevel = Log . INFO ; private Map _configuredLevels = new HashMap ( ) ; private PrintStream _out = System . err ; private String _diagContext = null ; private boolean _diagContextComputed = false ; private Configuration _conf ; public LogFactoryImpl ( ) { } public Log getLog ( String channel ) { } protected LogFactoryImpl . LogImpl newLogImpl ( ) { } public void setDefaultLevel ( String level ) { } public short getDefaultLevel ( ) { } public void setDefaultLevel ( short level ) { } public void setDiagnosticContext ( String val ) { } public String getDiagnosticContext ( ) { } public void setFile ( String file ) { } public PrintStream getStream ( ) { } public void setStream ( PrintStream stream ) { } public static String getLevelName ( short level ) { } public static short getLevel ( String str ) { <START_BUG> str = str . toUpperCase ( ) . trim ( ) ; <END_BUG> short val = ( LogFactoryImpl . TRACE_STR . equals ( str ) ) ? Log . TRACE : LogFactoryImpl . INFO_STR . equals ( str ) ? Log . INFO : LogFactoryImpl . WARN_STR . equals ( str ) ? Log . WARN : LogFactoryImpl . ERROR_STR . equals ( str ) ? Log . ERROR : LogFactoryImpl . FATAL_STR . equals ( str ) ? Log . FATAL : - 1 ; if ( val == ( - 1 ) ) throw new IllegalArgumentException ( LogFactoryImpl . _loc . get ( "log-bad-constant" , str ) . getMessage ( ) ) ; return val ; } public void setConfiguration ( Configuration conf ) { } public void startConfiguration ( ) { } public void endConfiguration ( ) { } public void setInto ( Options opts ) { } private static String shorten ( String channel ) { } public class LogImpl extends AbstractLog { private short _level = INFO ; private String _channel ; protected boolean isEnabled ( short level ) { } protected void log ( short level , String message , Throwable t ) { } protected String formatMessage ( short level , String message , Throwable t ) { } private long getOffset ( ) { } public void setChannel ( String val ) { } public String getChannel ( ) { } public void setLevel ( short val ) { } public short getLevel ( ) { } } }

Fix:
str = str . toUpperCase ( Locale . ENGLISH ) . trim ( ) ;