Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Jan Burse Newsgroups: comp.lang.java.programmer Subject: Re: setSize ArrayList, when will it come? Date: Wed, 10 Aug 2011 20:22:28 +0200 Organization: albasani.net Lines: 39 Message-ID: References: <9aetckFmvmU1@mid.individual.net> <9aftbqFa9kU1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net sy9F5+3M9u/fSiY0IMkkB+x3vSK9wRHlkHJtDzP9saq6Zq9WjDyMsbabBvPto8zEarOd0bf9Z9eO/5sZsshvdppjE2qmijDb2EhHAtP5vgk6MXz/JpSR9qd62aKMNwdV NNTP-Posting-Date: Wed, 10 Aug 2011 18:22:31 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="dSRAL/0RlQvW4BjI2dYzWj+KLYgmehaiKQNQjRhv2HzMtNsPe0ErrtmZcs0x7NlYLClTXU608DDcSPNDv9YNukYSQexJf3Qw0YqgZsRshSawRKBksaPFXMIcs0Gq5OV/"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110706 Firefox/5.0 SeaMonkey/2.2 In-Reply-To: <9aftbqFa9kU1@mid.individual.net> Cancel-Lock: sha1:GI/kUynUBYp52n4pYEnk1rioZGA= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6984 Robert Klemme schrieb: > 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 > I guess Larry will give me some money, when he sees that with the new setSize() his servers will be more green. There should be a market for energy efficiency nowadays. Bye P.S.: I don't champion energy efficiency yet, one of the applications I am working on is rather a black hole concerning energy, compared to the video streaming which only eats up 3W or so (which still impresses me), when I run my application energy consumption goes up by 16W or so.