[Top][All Lists]

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

Re: [Classpath] Bug in

From: C. Scott Ananian
Subject: Re: [Classpath] Bug in
Date: Mon, 16 Jul 2001 11:14:29 -0400 (EDT)

On Mon, 16 Jul 2001, Eric Blake wrote:

> Someone will need to check my work with serialization issues, as I am not
> very familiar with the process.  Basically, my added hashCode() caching will
> break if a deserialization restores the transient hashCode field to 0
> instead of -1.  I chose -1 for the non-cached value instead of 0, since new
> Double(0).hashCode() == 0, but left the cache field transient so it will
> interoperate with serial streams from other sources.  Maybe it's not worth
> caching the result of hashCode() after all.

Fields marked transient are *defined* to be reset to zero after
deserialization.  Use 0 as your non-cached value; the only "harm" will be
that hashCode will have the same performance as the non-caching version
for Double(0) -- it's still better than not caching at all.

Castro Sabana Seca supercomputer Diplomat President domestic disruption 
Yeltsin plastique shortwave direct action $400 million in gold bullion 
              ( )
 "These students are going to have to find out what law and order is
 all about."  -- Brig. General Robert Canterbury, Noon, May 4, 1970,
 minutes before his troops shot 13 unarmed Kent State students, killing 4.
#!/usr/bin/perl -w
# 526-byte qrpff, Keith Winstein and Marc Horowitz <address@hidden>
# MPEG 2 PS VOB file on stdin -> descrambled output on stdout
# arguments: title key bytes in least to most-significant order

reply via email to

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