classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] Re: [RFA/JDWP] ID factory


From: Keith Seitz
Subject: [cp-patches] Re: [RFA/JDWP] ID factory
Date: Tue, 14 Jun 2005 20:14:03 -0700

On Tue, 2005-06-14 at 14:11 -0600, Tom Tromey wrote:

> Keith> +    /* ObjectId and ArrayId are special cases. See
> Keith> +       end if newId. */
> 
> I think it should be s/if/of/

Fixed.

> 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.

Doh! Of course it is. I don't know *what* I was thinking. Brain fart?

> 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.)

Sure, I'll buy that: for arrays it shortcuts most of the work. I've done
as you suggest, checking for an array straight away.

I've committed the file with the corrections you recommend.

Thanks!
Keith





reply via email to

[Prev in Thread] Current Thread [Next in Thread]