[jdom-interest] minore possible bug in ContentList.ensureCapacity?
Bradley S. Huffman
hip at csa.cs.okstate.edu
Thu Jun 26 07:31:14 PDT 2003
Hmmm, I think ensureCapacity(collection.size()) when elementData == null
and collection.size() >= minCapacity would trigger a IndexOutOfBoundException.
Just to be safe, it should probably be changed.
Brad
Vadim.Strizhevsky at morganstanley.com writes:
> ensureCapacity in ContentList seems to ignore passed minCapacity when
> elementData==null. Instead it always uses 5. Now as far as I can tell
> there's no way to actually trigger this to cause a bug, but it feels
> wrong, could cause problem in future?, and I think if you do
> element.setContent(LargeList) it will have at least one extra
> allocation/copy to do, and possibly more.
>
> I check and this is both in b9 and last nights build.
More information about the jdom-interest
mailing list