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 ) { if ( LogFactoryImpl . STDOUT . equals ( file ) ) _out = System . out ; else if ( LogFactoryImpl . STDERR . equals ( file ) ) _out = System . err ; else { File f = Files . getFile ( file , null ) ; try { <START_BUG> _out = new PrintStream ( ( ( FileOutputStream ) ( AccessController . doPrivileged ( J2DoPrivHelper . newFileOutputStreamAction ( ( ( String ) ( AccessController . doPrivileged ( J2DoPrivHelper . getCanonicalPathAction ( f ) ) ) ) , true ) ) ) ) ) ; <END_BUG> } catch ( PrivilegedActionException pae ) { throw new IllegalArgumentException ( ( ( ( LogFactoryImpl . _loc . get ( "log-bad-file" , file ) ) + "<seq2seq4repair_space>" ) + ( pae . getException ( ) ) ) ) ; } catch ( IOException ioe ) { throw new IllegalArgumentException ( ( ( ( LogFactoryImpl . _loc . get ( "log-bad-file" , file ) ) + "<seq2seq4repair_space>" ) + ( ioe . toString ( ) ) ) ) ; } } } public PrintStream getStream ( ) { } public void setStream ( PrintStream stream ) { } public static String getLevelName ( short level ) { } public static short getLevel ( String str ) { } 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:
_out = new PrintStream ( ( ( FileOutputStream ) ( AccessController . doPrivileged ( J2DoPrivHelper . newFileOutputStreamAction ( AccessController . doPrivileged ( J2DoPrivHelper . getCanonicalPathAction ( f ) ) , true ) ) ) ) ) ;