On 18/08/2009, Jörg Schaible <[email protected]> wrote:
> Hi Sebb,
>
>  sebb wrote at Dienstag, 18. August 2009 14:48:
>
>
>  >>  +
>  >>  +    /**
>  >>  +     * {...@inheritdoc}
>  >>  +     */
>  >>  +    public Object clone() {
>  >>  +        FileSystemOptions clone = new FileSystemOptions();
>  >>  +        clone.options = new TreeMap(options);
>  >>  +        return clone;
>  >>  +    }
>  >
>  > This clone() does not call super.clone() so won't work properly for
>  > sub-classes.
>
>
> I know, but since the key of the map is a private class anyway, it does not
>  make too much sense to derive from FileSystemOptions anyway ... don't you
>  think?

In that case, you could make the class final.

In any case, it would be helpful to document that the clone() method
is not written to be sub-classable.

>  - Jörg
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: [email protected]
>  For additional commands, e-mail: [email protected]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to