Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.programmer Subject: Re: Arithmetic overflow checking Date: Sun, 24 Jul 2011 11:09:36 -0700 Organization: A noiseless patient Spider Lines: 11 Message-ID: References: <015aeb15-57db-48ab-9cd4-77f8448b632f@w24g2000yqw.googlegroups.com> <09fe171s46ilvq9qmn254dctunm6noh0ps@4ax.com> <4e262731$0$314$14726298@news.sunsite.dk> <4e26300b$0$309$14726298@news.sunsite.dk> <4e26b4ed$0$2501$db0fefd9@news.zen.co.uk> <4e28097f$0$2533$da0feed9@news.zen.co.uk> <7a23c9d2-508f-4dbd-af91-8cdf2a9764e1@p29g2000pre.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 24 Jul 2011 18:09:39 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="XjIWM99mD7Ijfdu600oVPA"; logging-data="18564"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+6hiz5OBiu4AcrF/oM6gslZ7xybo4lbeo=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 In-Reply-To: Cancel-Lock: sha1:FqXMyL1NWjgbrgvd/cEpOtzbzMY= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6514 On 7/24/2011 10:54 AM, Patricia Shanahan wrote: > meanwhile complex would be forced to provide a meaningless conversion to > byte. It could just throw an error. Collections uses this technique to make unmodifiable Collection's. An unmodifiable List for example throws UnsupportedOperation if add() is invoked. 'Taint the prettiest but it works.