Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!216.196.98.144.MISMATCH!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 NNTP-Posting-Date: Wed, 03 Aug 2011 23:03:55 -0500 Date: Wed, 03 Aug 2011 21:03:55 -0700 From: Patricia Shanahan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 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: 7bit Message-ID: Lines: 34 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 70.230.200.54 X-Trace: sv3-PMRPaY2Csu3yzx5ZW7tUwDBB1Zbecg1fmfEb8BadM94ztCq468Kyv3CbrwQ1xE4VxmgZVm4t2ros3Fa!qAx5mq8ssejEua+BaElYi1ChLRt1q952b3lEHoyrBW/sAxyuSusVdSDDG54Tpu5k8GB/nSXPlPpY!xkRAPoKUeZlHKibSr7rO/0C2Md8RbahUjHZdCvBQ0pERRA== 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: 2513 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6787 On 8/3/2011 8:31 PM, supercalifragilisticexpialadiamaticonormalizeringelimatisticantations wrote: > On 02/08/2011 5:07 PM, Patricia Shanahan wrote: > ... >> It seems to generally do the most useful thing it could, but I really >> would like documentation that would let me predict the results without >> running the experiments. > > I wonder if Oracle isn't as committed to quality documentation (or, > perhaps, to Java at all) as Sun was. :( > > I also wonder what happens with this: > > > public void method () throws SomeCheckedException, > SomeUnrelatedCheckedException { > > try { > throwSomething(); > } catch (SomeCheckedException | SomeUnrelatedCheckedException e) { > logger.log(e); > throw e; > } > } > > Does this work? Or does method() need throws > LastCommonSupertypeOfThoseCheckedExceptions instead to avoid a compile > error? I think this is covered by another extension. See http://download.oracle.com/javase/7/docs/technotes/guides/language/catch-multiple.html, "Rethrowing Exceptions with More Inclusive Type Checking". Patricia