IdentityHashMap & natStackTrace

Ranjit Mathew rmathew@gmail.com
Mon Nov 29 09:27:00 GMT 2004


Tom Tromey wrote:
>>>>>>"Ranjit" == Ranjit Mathew <rmathew@gmail.com> writes:
>>> Ranjit> This was introduced almost two years ago in a merge from
> Ranjit> Classpath:
>> Yeah, there was a wave of changing "* 2" to "<< 1". As Bryce and
> Andrew point out, this is a non-optimization.

A grep through the libjava sources yields the following additional
suspect cases:
java/math/BigInteger.java:
 1291 // Set m such that this = 1 + 2^b * m.
 1292 BigInteger m = pMinus1.divide(valueOf(2L << b - 1));
java/text/DecimalFormatSymbols.java:
362 public int hashCode ()
363 {
364 // Compute based on zero digit, grouping separator, and decimal
365 // separator -- JCL book. This probably isn't a very good hash
366 // code.
367 return zeroDigit << 16 + groupingSeparator << 8 + decimalSeparator;
Ranjit.
-- 
Ranjit Mathew Email: rmathew AT gmail DOT com
Bangalore, INDIA. Web: http://ranjitmathew.tripod.com/


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /