This is the mail archive of the
mailing list for the Java project.
Re: -Wcloneable ?
- To: Tom Tromey <tromey at redhat dot com>
- Subject: Re: -Wcloneable ?
- From: Mark Wielaard <mark at klomp dot org>
- Date: Wed, 17 Jan 2001 15:16:47 +0100
- Cc: Java Discuss List <java-discuss at sourceware dot cygnus dot com>
- References: <email@example.com>
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