Update of /cvsroot/freenet/freenet/src/freenet/node/rt
In directory sc8-pr-cvs1:/tmp/cvs-serv16225/src/freenet/node/rt
Modified Files:
ResponseTimeEstimator.java
Log Message:
Fix NPE in case we failed to read Estimator from disk
Index: ResponseTimeEstimator.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/rt/ResponseTimeEstimator.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -w -r1.13 -r1.14
--- ResponseTimeEstimator.java 29 Oct 2003 21:53:23 -0000 1.13
+++ ResponseTimeEstimator.java 29 Oct 2003 22:45:23 -0000 1.14
@@ -83,6 +83,7 @@
try {
recent = new RecentReports(i);
} catch (IOException e) {
+ recent = new RecentReports();
// Not fatal - probably upgrading
}
@@ -778,6 +779,10 @@
protected int recentTimes[] = new int[RECENT_LENGTH];
protected int recentPtr = 0;
protected int recentCount = 0; //TOTHINK: this could grow fast, may be
better off with long
+ public RecentReports()
+ {
+ recentPtr = recentCount = 0;
+ }
public RecentReports(DataInputStream i) throws IOException {
try {
recentPtr = i.readInt();
_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs