On Saturday 05 April 2008 03:34, Florent Daignière wrote: > * Matthew Toseland <[EMAIL PROTECTED]> [2008-04-04 19:09:01]: > > > On Friday 04 April 2008 06:20, [EMAIL PROTECTED] wrote: > > > Author: nextgens > > > Date: 2008-04-04 05:20:31 +0000 (Fri, 04 Apr 2008) > > > New Revision: 18966 > > > > > > Modified: > > > trunk/freenet/src/freenet/crypt/SHA1.java > > > trunk/freenet/src/freenet/support/DoublyLinkedListImpl.java > > > trunk/freenet/src/freenet/support/math/DecayingKeyspaceAverage.java > > > trunk/freenet/src/freenet/support/math/RunningAverage.java > > > trunk/freenet/src/freenet/support/math/SimpleBinaryRunningAverage.java > > > Log: > > > implement Cloneable where we have a clone() method > > > > Why? > > > > public interface Cloneable > > > > A class implements the Cloneable interface to indicate to the Object.clone() > > method that it is legal for that method to make a field-for-field copy of > > instances of that class. > > > > Invoking Object's clone method on an instance that does not implement the > > Cloneable interface results in the exception CloneNotSupportedException being > > thrown. > > > > By convention, classes that implement this interface should override > > Object.clone (which is protected) with a public method. See Object.clone() > > for details on overriding this method. > > > > Note that this interface does not contain the clone method. Therefore, it is > > not possible to clone an object merely by virtue of the fact that it > > implements this interface. Even if the clone method is invoked reflectively, > > there is no guarantee that it will succeed. > > > > Okay, it's a bad idea in SHA1.java; I meant to do it in JavaSHA1.java > (r18972) and forgot to revert that bit afterwards... > > Fixed in r18998 > > I think that the patch is revelant for other classes.
I don't. Cloneable does not even contain a public clone(). Its ONLY purpose is to indicate to the JVM that it can do a field for field copy.
pgpQm5I5wTa32.pgp
Description: PGP signature
_______________________________________________ cvs mailing list [email protected] http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
