classpath
[Top][All Lists]
Advanced

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

Re: [Classpath] Bug in Double.java


From: C. Scott Ananian
Subject: Re: [Classpath] Bug in Double.java
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.
 --s

Castro Sabana Seca supercomputer Diplomat President domestic disruption 
Yeltsin plastique shortwave direct action $400 million in gold bullion 
              ( http://lesser-magoo.lcs.mit.edu/~cananian )
 --
 "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.
 --
            [http://www.cs.cmu.edu/~dst/DeCSS/Gallery/]
#!/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
$_='while(read+STDIN,$_,2048){$a=29;$c=142;if((@a=unx"C*",$_)[20]&48){$h=5;
$_=unxb24,join"",@b=map{xB8,unxb8,chr($_^$a[--$h+84])address@hidden;s/...$/1$&/;$d=
unxV,xb25,$_;$b=73;$e=256|(ord$b[4])<<9|ord$b[3];$d=$d>>8^($f=($t=255)&($d
>>12^$d>>4^$d^$d/8))<<17,$e=$e>>8^($t&($g=($q=$e>>14&7^$e)^$q*8^$q<<6))<<9
,$_=(map{$_%16or$t^=$c^=($m=(11,10,116,100,11,122,20,100)[$_/16%8])&110;$t
^=(72,@z=(64,72,$a^=12*($_%16-2?0:$m&17)),$b^=$_%64?12:0,@z)[$_%8]}(16..271))
[$_]^(($h>>=8)+=$f+(~$g&$t))address@hidden"C*",@a}';s/x/pack+/g;eval





reply via email to

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