Author: toad Date: 2009-03-06 22:36:39 +0000 (Fri, 06 Mar 2009) New Revision: 25914
Modified: branches/db4o/freenet/src/freenet/client/InsertException.java Log: clone, removeFrom Modified: branches/db4o/freenet/src/freenet/client/InsertException.java =================================================================== --- branches/db4o/freenet/src/freenet/client/InsertException.java 2009-03-06 22:35:57 UTC (rev 25913) +++ branches/db4o/freenet/src/freenet/client/InsertException.java 2009-03-06 22:36:39 UTC (rev 25914) @@ -3,6 +3,8 @@ * http://www.gnu.org/ for further details of the GPL. */ package freenet.client; +import com.db4o.ObjectContainer; + import freenet.keys.FreenetURI; import freenet.l10n.L10n; import freenet.support.Logger; @@ -72,6 +74,17 @@ this.uri = null; } + public InsertException(InsertException e) { + super(e.getMessage()); + extra = e.extra; + mode = e.mode; + errorCodes = e.errorCodes.clone(); + if(e.uri == null) + uri = null; + else + uri = e.uri.clone(); + } + /** Caller supplied a URI we cannot use */ public static final int INVALID_URI = 1; /** Failed to read from or write to a bucket; a kind of internal error */ @@ -153,4 +166,14 @@ mode = TOO_MANY_RETRIES_IN_BLOCKS; return new InsertException(mode, errors, null); } + + public InsertException clone() { + return new InsertException(this); + } + + public void removeFrom(ObjectContainer container) { + errorCodes.removeFrom(container); + uri.removeFrom(container); + container.delete(this); + } } _______________________________________________ cvs mailing list [email protected] http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
