This is the mail archive of the java-discuss@sources.redhat.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: -Wcloneable ?


Hi,

On Tue, Jan 16, 2001 at 02:08:40PM -0700, Tom Tromey wrote:
> Today I thought about implementing a `-Wcloneable' option which would
> cause gcj to warn if a class implements Cloneable but doesn't have a
> public clone() method.  Would this be useful?
I don't know. There is nothing wrong with using the default Object.clone()
method. For (very) simple object a field-by-field copy is good enough.
Maybe it should check to see that the class only contains primitive fields
and Strings?

Cheers,

Mark

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]