Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Stanimir Stamenkov Newsgroups: comp.lang.java.help Subject: Re: TeeOutputStream? Date: Mon, 06 Jun 2011 01:23:53 +0300 Organization: A noiseless patient Spider Lines: 32 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 5 Jun 2011 22:23:52 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="VdcnnljfizG2LUdZ5iOA6g"; logging-data="8641"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Zkhui0JIJ/7OWlvGGN9jz" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20110531 SeaMonkey/2.1pre In-Reply-To: X-Face: )>>ChyF_H public void close() throws IOException { > > IOException firstFail = null; > IOException secondFail = null; > > try { > try { > os1.close(); > } catch (IOException ioe1) { > firstFail = ioe1; Wouldn't this approach fail in face of RuntimeException or Error thrown? > logger.log(Level.SEVERE, > "First stream failure IOexception", ioe1); > } > try { > os2.close(); > } catch (IOException ioe2) { > secondFail = ioe2; > logger.log(Level.SEVERE, > "Second stream failure IOexception", ioe2); > } > } finally { > if (firstFail != null) { > if (secondFail != null) { > [...] -- Stanimir