forked from I2P_Developers/i2p.i2p
* Fix log NPE when saveConfig() fails at startup, thx kytv (backport from jetty6 branch)
This commit is contained in:
@ -1,3 +1,10 @@
|
||||
2011-12-31 zzz
|
||||
* Fix log NPE when saveConfig() fails at startup, thx kytv
|
||||
(backport from jetty6 branch)
|
||||
|
||||
2011-12-30 zzz
|
||||
* New Estonian translation thanks ajutine
|
||||
|
||||
2011-12-27 kytv
|
||||
* Spanish and Swedish translation updates from Transifex
|
||||
|
||||
|
@ -426,7 +426,11 @@ public class Router implements RouterClock.ClockShiftListener {
|
||||
foo.putAll(config);
|
||||
}
|
||||
|
||||
/** this does not use ctx.getConfigDir(), must provide a full path in filename */
|
||||
/**
|
||||
* this does not use ctx.getConfigDir(), must provide a full path in filename
|
||||
*
|
||||
* @param ctx will be null at startup when called from constructor
|
||||
*/
|
||||
private static Properties getConfig(RouterContext ctx, String filename) {
|
||||
Log log = null;
|
||||
if (ctx != null) {
|
||||
@ -444,10 +448,15 @@ public class Router implements RouterClock.ClockShiftListener {
|
||||
} else {
|
||||
if (log != null)
|
||||
log.warn("Configuration file " + filename + " does not exist");
|
||||
// normal not to exist at first install
|
||||
//else
|
||||
// System.err.println("WARNING: Configuration file " + filename + " does not exist");
|
||||
}
|
||||
} catch (Exception ioe) {
|
||||
if (log != null)
|
||||
log.error("Error loading the router configuration from " + filename, ioe);
|
||||
else
|
||||
System.err.println("Error loading the router configuration from " + filename + ": " + ioe);
|
||||
}
|
||||
return props;
|
||||
}
|
||||
@ -1193,8 +1202,11 @@ public class Router implements RouterClock.ClockShiftListener {
|
||||
}
|
||||
fos.write(buf.toString().getBytes("UTF-8"));
|
||||
} catch (IOException ioe) {
|
||||
if (_log.shouldLog(Log.ERROR))
|
||||
// warning, _log will be null when called from constructor
|
||||
if (_log != null)
|
||||
_log.error("Error saving the config to " + _configFilename, ioe);
|
||||
else
|
||||
System.err.println("Error saving the config to " + _configFilename + ": " + ioe);
|
||||
return false;
|
||||
} finally {
|
||||
if (fos != null) try { fos.close(); } catch (IOException ioe) {}
|
||||
|
@ -18,7 +18,7 @@ public class RouterVersion {
|
||||
/** deprecated */
|
||||
public final static String ID = "Monotone";
|
||||
public final static String VERSION = CoreVersion.VERSION;
|
||||
public final static long BUILD = 25;
|
||||
public final static long BUILD = 26;
|
||||
|
||||
/** for example "-test" */
|
||||
public final static String EXTRA = "-rc";
|
||||
|
Reference in New Issue
Block a user