Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!usenet.ukfsn.org!not-for-mail From: Martin Gregorie Newsgroups: comp.lang.java.programmer Subject: Re: Call by Result Date: Fri, 10 Jun 2011 16:55:42 +0000 (UTC) Organization: UK Free Software Network Lines: 20 Message-ID: References: <4df23fe3$0$12157$fa0fcedb@news.zen.co.uk> NNTP-Posting-Host: 84.45.235.129 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: localhost.localdomain 1307724942 16999 84.45.235.129 (10 Jun 2011 16:55:42 GMT) X-Complaints-To: usenet@localhost.localdomain NNTP-Posting-Date: Fri, 10 Jun 2011 16:55:42 +0000 (UTC) User-Agent: Pan/0.133 (House of Butterflies) Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5189 On Fri, 10 Jun 2011 17:01:36 +0100, RedGrittyBrick wrote: > I think Stephan Ram's answer is roughly what I would do. > > String returnString; > Thagomizor thangomizor = new Thagomizor(); thangomizor.thangomize(); > if (!thangomizor.didItWork()) { > throw new TooBadException(); > } else { > returnString = thangomizor.getString(); > } Likewise, this is my usual style too, though its quite possibly a carry- over from the way I write C. -- martin@ | Martin Gregorie gregorie. | Essex, UK org |