Re: [CVS] commit

Date view Thread view Subject view Author view

From: Godmar Back (gback@cs.utah.edu)
Date: Sun Sep 20 1998 - 14:46:28 EDT


>
> Godmar Back writes:
> > I haven't looked at that fix yet, so take what I'm saying with caution:
> > If we derived Byte from Number (as the spec says), then this would give
> > Byte a shortValue() method cause it's not abstract in Number.
> > In truth, however, Byte.shortValue overrides Number.shortValue
> > so we need to both extend Number and override. Why Byte.shortValue()
> > cannot be implemented as (short)intValue() as in Number, I don't know.
>
> Must admit I hadn't researched it that much. It looks like the real
> bug is that class Byte does not extend Number, as it should according
> to the JDK docs.
>
> So should I back out that patch and change Byte to extend Number?

 No, the real fix is to change Byte to extend Number AND still
override shortValue in Byte.

That is, if the "overrides in" part of the JDK *documentation* is actually
a binding *specification*.

        - Godmar


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:56:57 EDT