Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Joshua Cranmer Newsgroups: comp.lang.java.programmer Subject: Re: setSize ArrayList, when will it come? Date: Mon, 08 Aug 2011 21:39:10 -0500 Organization: A noiseless patient Spider Lines: 19 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 9 Aug 2011 02:39:15 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="B3q1fNdvNsCxx/IZ4idKGA"; logging-data="3481"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/wN6jHlhkjxiOB60TsDqUi2ZiKhDYBpBU=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 In-Reply-To: Cancel-Lock: sha1:74JbVgKEbQgz80n7g5tyEPqe4vM= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6894 On 8/8/2011 9:16 PM, Jan Burse wrote: > The missing thought in the reponse is the design goal > of ArrayList. They are explicitly advertised in the > class comment as unsynchronized version of Vector. It > is brainless not to honor such a design goal in a response. An unsynchronized version does not necessarily imply that it need be a full drop-in replacement for the class except with the synchronized methods removed. Now you're going to argue that it's brainless that Object a = new Vector(); Object b = new ArrayList(); System.out.println(a.getClass() == b.getClass()); returns false. -- Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald E. Knuth