DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23090>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23090

AbstractFileSet copy-constructor makes shallow copy





------- Additional Comments From [EMAIL PROTECTED]  2003-09-11 19:22 -------
For reference, here's a snippet from the Object.clone() "contract" (javadoc):

    By convention, the object returned by this method should be independent
    of this object (which is being cloned). To achieve this independence, it
    may be necessary to modify one or more fields of the object returned by
    super.clone before returning it. Typically, this means copying any mutable
    objects that comprise the internal "deep structure" of the object being
    cloned and replacing the references to these objects with references to
    the copies.

It's your call of course -- these specifications are marked "by convention" --
but this does seem to lean strongly towards changing the clone() method (and
perhaps introducing a shallowClone() method, if somebody actually wants that)
rather than leaving clone() unchanged and introducing deepClone(). I can't
think of a compelling use case for a FileSet clone() implementation that
leaves the clone and original fileset coupled.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to