NNTP-Posting-Date: Sat, 06 Aug 2011 11:45:18 -0500 Date: Sat, 06 Aug 2011 09:45:20 -0700 From: Patricia Shanahan User-Agent: Mozilla/5.0 (Windows NT 5.2; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: Catching mulitple Exceptions in JDK 1.7 References: <0510e90d-1a19-4fe1-9445-65314b5da038@glegroupsg2000goo.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Lines: 33 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 70.230.203.65 X-Trace: sv3-U9ElrTb1PFIR9w4KawXjQF0nHMNhCTgZrnbBUNKhVaJWpF6toOQ2JIjCQuak9wU60DBU8qNDfztwEXc!Jp4alaxGNoN4tqJ+ITqmqWJjRe527vwOpJyhwYC6Af0rwVL4fiCu3Xn7u+lmaZ4OaicdjSDV1T0n!1ULbG/sxzoZcT9YtqhBqKJP7wrXjI4rnM40BeEn6EiPz0A== X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2785 Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.stben.net!news.ecp.fr!news.glorb.com!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6827 On 8/5/2011 4:02 PM, Jeff Higgins wrote: > On 08/02/2011 05:07 PM, Patricia Shanahan wrote: >> >> I've done an experiment, with interesting results. >> >> Before I go into more detail, I must protest... > > > See: Comments To :) > > I had a quick look through the "normative version" and couldn't find > a specification for this behavior. There is a good chance I could have > overlooked it. > That "normative version" only has single type catch clauses. However, I did some more searching, and found http://download.oracle.com/otndocs/jcp/java_se-7-final-eval-spec/index.html. The third of the available downloads, java_se-7-final-eval-annex-3.zip, seems to contain a Java 7 JLS with multi-type catch clauses. I've tried to read the relevant section, but the critical information about the type calculation is given by the apparently harmless statement "The declared type of an exception parameter that denotes its type as a union with alternatives D1 | D2 | ... | Dn is lub(D1, D2, ..., Dn) (§15.12.2.7)." So, I went to section 15.12.2.7. It may well contain the relevant information but I am not finding it at all easy to read. I'll revisit it whenever I have time, with the aim of producing a more accessible statement of the rules, at least for simple cases. Patricia