Author: toad
Date: 2008-12-20 21:34:17 +0000 (Sat, 20 Dec 2008)
New Revision: 24689
Modified:
branches/db4o/freenet/src/freenet/client/async/SingleFileFetcher.java
Log:
Clone the URI if persistent. Fixes NPE when the child fetcher doesn't clone it,
completes, removes it, then calls back to the parent.
Logging.
Modified: branches/db4o/freenet/src/freenet/client/async/SingleFileFetcher.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/SingleFileFetcher.java
2008-12-20 21:15:29 UTC (rev 24688)
+++ branches/db4o/freenet/src/freenet/client/async/SingleFileFetcher.java
2008-12-20 21:34:17 UTC (rev 24689)
@@ -129,7 +129,7 @@
// going to fetch is!
this.decompressors = new
LinkedList<COMPRESSOR_TYPE>(fetcher.decompressors);
if(fetcher.uri == null) throw new NullPointerException();
- this.uri = fetcher.uri;
+ this.uri = persistent ? fetcher.uri.clone() : fetcher.uri;
}
// Process the completed data. May result in us going to a
@@ -1105,6 +1105,7 @@
}
public void removeFrom(ObjectContainer container, ClientContext
context) {
+ if(logMINOR) Logger.minor(this, "removeFrom() on "+this);
super.removeFrom(container, context);
uri.removeFrom(container);
if(thisKey != null)
@@ -1123,6 +1124,7 @@
private void removeMetadata(ObjectContainer container) {
if(!persistent) return;
+ if(logMINOR) Logger.minor(this, "removeMetadata() on "+this);
if(metadata == null) return;
container.activate(metadata, 1);
metadata.removeFrom(container);
@@ -1131,6 +1133,7 @@
private void removeArchiveMetadata(ObjectContainer container) {
if(!persistent) return;
+ if(logMINOR) Logger.minor(this, "removeArchiveMetadata() on
"+this);
if(archiveMetadata == null) return;
container.activate(archiveMetadata, 1);
archiveMetadata.removeFrom(container);
_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs