This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [RFA/JDWP] ID factory
- From: Tom Tromey <tromey at redhat dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: GCJ Patches <java-patches at gcc dot gnu dot org>, classpath patches <classpath-patches at gnu dot org>
- Date: 14 Jun 2005 14:11:17 -0600
- Subject: Re: [RFA/JDWP] ID factory
- References: <1118773412.4524.52.camel@lindt.uglyboxes.com>
- Reply-to: tromey at redhat dot com
>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:
Keith> 2005-06-14 Keith Seitz <keiths@redhat.com>
Keith> * gnu/classpath/jdwp/id/JdwpIdFactory.java: New file.
Looks good.
Keith> + /* ObjectId and ArrayId are special cases. See
Keith> + end if newId. */
I think it should be s/if/of/
Keith> + catch (InstantiationException ie)
Keith> + {
Keith> + // This really should not happen
Keith> + throw new RuntimeException ("cannot create new ID");
It is generally better to chain exceptions.
Keith> + /* getSuperclass returned null and no matching ID type found.
Keith> + So there are only two choices left: an array or something
Keith> + deriving from Object. */
Keith> + if (object.getClass ().isArray ())
Keith> + id = new ArrayId ();
If arrays are special you might as well check for this above, since
you know in advance that it won't appear in the table. (This isn't an
important point for me though.)
Tom