Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.42!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!74.125.46.80.MISMATCH!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: Why can't I downcast in the following code Date: Sun, 23 Oct 2011 23:22:19 -0700 (PDT) Organization: http://groups.google.com Lines: 10 Message-ID: <15065329.1019.1319437339685.JavaMail.geo-discussion-forums@yqgd7> References: <2196c265-94c4-4fcb-beb5-ddf3a7135da8@l10g2000pra.googlegroups.com> Reply-To: comp.lang.java.programmer@googlegroups.com NNTP-Posting-Host: 72.14.225.65 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1319437342 22820 127.0.0.1 (24 Oct 2011 06:22:22 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 24 Oct 2011 06:22:22 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=72.14.225.65; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 X-Google-Web-Client: true Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9140 Peter Duniho wrote: > He's getting a runtime error, not a compile-time error. "Some casts can be proven incorrect at compile time; such casts result in a compile-time error." JLS 5.5 I'd have to bestir myself to confirm this, but I think the OP's situation is in this category. -- Lew