From: Archie Cobbs (archie@whistle.com)
Date: Sun Sep 20 1998 - 14:14:41 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?
> BTW, does anybody know why (char)((byte)-1) is 65535 and not 255
> in Java? Specifically, does anybody know where it says that?
You would think it would be 255, unless there's an implicit conversion
to int before the conversion to char.. ? Surely the JLS specifies
this somewhere.
> On an unrelated note, here's another blurb by Sun on class unloading:
> http://java.sun.com/docs/books/jls/unloading-rationale.html
>
> Specifically, it says that 1.1 was wrong, 1.2 is fixed and that
> classes are only unloaded after their classloader is gone. That is,
> it will never happen that a given classloader is asked to reload
> a class it has previously loaded, but that was garbage collected
> in the interim.
Thanks.. this makes sense and I'm glad they clarified it.
-Archie
___________________________________________________________________________
Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com
This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:56:57 EDT