This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Allow array method invocations to be resolved in Object
- From: Andrew Haley <aph at redhat dot com>
- To: java-patches at gcc dot gnu dot org
- Date: Thu, 9 Feb 2006 11:57:35 +0000
- Subject: Re: Allow array method invocations to be resolved in Object
- References: <17387.10476.856834.629324@zapata.pink>
Andrew Haley writes:
> Recent Java compilers generate invocations of nonexistent (and, in
> fact, impossible to declare) methods like boolean[].clone(). This
> works because Object is a superclass of every class, so such methods
> are resolved in Object.
To be pedantic, this isn't strictly true. boolean[].clone() is
different from Object.clone() in that it throws no checked exceptions.
However, the libgcj runtime code for Object.clone() treats arrays as a
special case, so it does the Right Thing.
Andrew.