2005-10-20 jrandom

* Workaround a bug in GCJ's Calendar implementation
    * Propery throw an exception in the streaming lib if we try to write to a
      closed stream.  This will hopefully help clear some I2Phex bugs (thanks
      GregorK!)
This commit is contained in:
jrandom
2005-10-20 08:56:39 +00:00
committed by zzz
parent aa5f1cb18d
commit ea22c73a73
5 changed files with 19 additions and 6 deletions

View File

@ -460,6 +460,8 @@ public class Router {
private long getTimeTillMidnight() {
long now = Router.this._context.clock().now();
_cal.setTime(new Date(now));
_cal.set(Calendar.YEAR, _cal.get(Calendar.YEAR)); // gcj <= 4.0 workaround
_cal.set(Calendar.DAY_OF_YEAR, _cal.get(Calendar.DAY_OF_YEAR)); // gcj <= 4.0 workaround
_cal.add(Calendar.DATE, 1);
_cal.set(Calendar.HOUR_OF_DAY, 0);
_cal.set(Calendar.MINUTE, 0);
@ -468,7 +470,7 @@ public class Router {
long then = _cal.getTime().getTime();
long howLong = then - now;
if (howLong < 0) // hi kaffe
howLong = 24*60*60*1000 + howLong;
howLong = 24*60*60*1000l + howLong;
if (_log.shouldLog(Log.DEBUG))
_log.debug("Time till midnight: " + howLong + "ms");
return howLong;

View File

@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
*
*/
public class RouterVersion {
public final static String ID = "$Revision: 1.272 $ $Date: 2005/10/19 00:15:15 $";
public final static String ID = "$Revision: 1.273 $ $Date: 2005/10/19 17:38:45 $";
public final static String VERSION = "0.6.1.3";
public final static long BUILD = 3;
public final static long BUILD = 4;
public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
System.out.println("Router ID: " + RouterVersion.ID);