From: Robert Klemme Newsgroups: comp.lang.java.programmer Subject: Re: setSize ArrayList, when will it come? Date: Wed, 10 Aug 2011 19:27:16 +0200 Lines: 27 Message-ID: <9aftbqFa9kU1@mid.individual.net> References: <9aetckFmvmU1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net L/gZvil076ChEUUNW2S0MwrqXn9vPyrt2B09aooges/dEXTk4= Cancel-Lock: sha1:wt0c6XEkJpgPLKhk9YvbaKJjq6Q= User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 In-Reply-To: Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!feed.ac-versailles.fr!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6983 On 10.08.2011 12:29, Jan Burse wrote: > Robert Klemme schrieb: >> >> 2. Writing a static helper method which uses ArrayList.ensureCapacity() >> and a loop which invokes add() or removeRange() depending on whether the >> new capacity is larger or smaller. > > removeRange is protected, so I cannot use it in a helper. Sorry about that. Then just use a loop with remove(int). Actually how to do it was not my main point. You can still do it yourself and efficiently so. Your complaint about a bug report which is not handled to your liking is most likely futile - and also in the wrong place. And please also keep in mind that the JDK is given to you for free which kinda limits the handle you have on Oracle to force them to do what you want. Maybe you need to sink Larry's ship - but even in that case I reckon it's more likely that he gets after you than the other way round. :-) Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/