HashMap bug for large map sizes

tom.hawtin at oracle.com tom.hawtin at oracle.com
Tue Jul 13 17:47:52 UTC 2010


On 13/07/2010 18:13, Kasper Nielsen wrote:

> s.writeInt(Integer.MAX_VALUE);
> 
> for (int i=0;i<Integer.MAX_VALUE;i++) {
> 
> }
> 
> s.writeLong(size);//write the real size
> 
> for (long i=Integer.MAX_VALUE;i<size;i++) {
>   ...read remaining elements
> }

Adding a field to the serial form would probably be better.

Tom



More information about the core-libs-dev mailing list