Hi,

Andrew John Hughes schrieb:
 > I'd second that.  Are there clear performance benefits to justify
> creating 256 objects ahead of time?
> Not only does that introduce an overhead in initialising the Long
> class, but it also results in increased
> memory usage for all applications.
> 
> I'd also prefer that future patches focused on just one change.  This
> seems to be in essence four
> patches in one.

Couldnt we have the best of both world? Instead of initializing the
array with all values explicitly let us do it lazily. Something like:

Integer valueOf(int i)
{
  Integer I = cached[i];
  if (I == null)
   I = cached[i] = new Integer(i);

  return I;
}

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to