[PATCH] java.awt

Michael Koch konqueror@gmx.de
Fri Feb 14 21:07:00 GMT 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Freitag, 14. Februar 2003 18:22 schrieb Tom Tromey:
> >>>>> "Michael" == Michael Koch <konqueror@gmx.de> writes:
>
> Michael> I have written another java.awt patch. This mostly
> implements some Michael> missing methods (getListeners and friends)
> and removes some unneeded Michael> "implements Serializable".
> Please review and comment.
>
> Looks great, though I have one question (see below).
>
> Michael> Of course this should go into classpath too.
>
> Yes, thanks.
>
> BTW if you ever feel like reindenting some of the old-style AWT
> code, feel free.  Just do it as a separate reformatting patch;
> simple formatting changes don't require approval.

I know. I remember someone (probably Mark Wielaard but I'm not sure) 
said that he will run an indentation app over the classpath source. 
Thats why I dont started reindenting all stuff.

> Michael> +        return Class.forName ("java.nio.ByteBuffer")
> Michael> +                    .isAssignableFrom
> (representationClass);
>
> I'm curious about this code.
> Why not use instanceof?  java.nio.ByteBuffer is in both code bases,
> and is compiled.  I'd prefer this, unless there's a reason against
> it.

Hmm, it was the easiest solution I found.

When using the following I need to catch IllegalAccessException:

return (representationClass.newInstance() instanceof ByteBuffer);


Am I blind or do I think too chaotic ?


Michael
- -- 
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+TVp9WSOgCCdjSDsRAkWYAJ9hSwkufw9+lmrQrQGDnYVsFhTlNQCcCXu6
AZfSM4upLwvAlnvOBOVUG8g=
=U3O1
-----END PGP SIGNATURE-----



More information about the Java-patches mailing list