Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Joshua Cranmer Newsgroups: comp.lang.java.programmer Subject: Re: Why "lock" functionality is introduced for all the objects? Date: Fri, 01 Jul 2011 19:05:13 -0700 Organization: A noiseless patient Spider Lines: 14 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 2 Jul 2011 02:05:17 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="bAymlyY9SkaJNa8Tz2rerw"; logging-data="9773"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX198xxbemw3pNz8txIvQ8vYq6USHtRnMwqI=" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.18) Gecko/20110616 Lightning/1.0b2 Thunderbird/3.1.11 In-Reply-To: Cancel-Lock: sha1:f6efYUR4grXWsaDAQJGHkN2MoWc= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5817 On 6/28/2011 10:12 PM, supercalifragilisticexpialadiamaticonormalizeringelimatisticantations wrote: > If the list wasn't mutable there'd be no problem casting a > List to a List. And then I'd complain because my program would be spending more time copying the values between immutable queues than actually doing work. As long as the language has the potential for mutable collections (which most people want for performance reasons), you have the potential for generics casting issues. -- Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald E. Knuth