Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #27824

Re: telling the javac that a method doesn't return at all...

From Michal Kleczek <michal_wytnijto@kleczek.org>
Newsgroups comp.lang.java.programmer
Subject Re: telling the javac that a method doesn't return at all...
Date 2014-03-23 11:15 +0100
References <slrnlh1gp1.g8j.avl@login.logic.tuwien.ac.at> <53297695$0$2225$65785112@news.neostrada.pl> <slrnlij3bd.rhr.avl@login.logic.tuwien.ac.at>
Message-ID <almarsoft.8117585437293262623@news.neostrada.pl> (permalink)
Organization Telekomunikacja Polska

Show all headers | View raw


On Wed, 19 Mar 2014 12:28:29 +0000 (UTC), Andreas Leitgeb 
<avl@auth.logic.tuwien.ac.at> wrote:
> > throw myNonReturningMethod();


> Now that is compact and nice :-)


> Thanks for bringing it here!


> > If the call site is a non-void method the compiler will complain 
there is no 
> > return statement after myNonReturningMethod(). If the call site 
is void then 
> > it is harmless to leave it as-is.


> Not sure if I understand this line correctly, but the consequences
> of throwing stuff are evident, anyway.

I was imprecise. I meant the behavior of the compiler if you forget 
throw keyword at the call site.

-- 
Michal

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

telling the javac that a method doesn't return at all... Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-02-28 17:10 +0000
  Re: telling the javac that a method doesn't return at all... Lew <lewbloch@gmail.com> - 2014-02-28 16:13 -0800
    Re: telling the javac that a method doesn't return at all... Jeff Higgins <jeff@invalid.invalid> - 2014-03-01 09:12 -0500
      Re: telling the javac that a method doesn't return at all... Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-03-05 13:06 +0000
  Re: telling the javac that a method doesn't return at all... Roedy Green <see_website@mindprod.com.invalid> - 2014-03-01 01:10 -0800
    Re: telling the javac that a method doesn't return at all... Jeff Higgins <jeff@invalid.invalid> - 2014-03-01 08:44 -0500
  Re: telling the javac that a method doesn't return at all... Arne Vajhøj <arne@vajhoej.dk> - 2014-03-01 22:02 -0500
    Re: telling the javac that a method doesn't return at all... Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-03-05 13:31 +0000
      Re: telling the javac that a method doesn't return at all... Arne Vajhøj <arne@vajhoej.dk> - 2014-03-11 20:11 -0400
        Re: telling the javac that a method doesn't return at all... Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-03-12 10:17 +0000
  Re: telling the javac that a method doesn't return at all... Mike Amling <mamling@chaff.us> - 2014-03-04 13:19 -0600
    Re: telling the javac that a method doesn't return at all... Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-03-05 13:39 +0000
  Re: telling the javac that a method doesn't return at all... mike.s.schilling@gmail.com - 2014-03-04 19:30 -0800
    Re: telling the javac that a method doesn't return at all... Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-03-09 14:33 +0000
  Re: telling the javac that a method doesn't return at all... Silvio <silvio@internet.com> - 2014-03-12 14:03 +0100
  Re: telling the javac that a method doesn't return at all... Michal Kleczek <michal_wytnijto@kleczek.org> - 2014-03-19 11:51 +0100
    Re: telling the javac that a method doesn't return at all... Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-03-19 12:28 +0000
      Re: telling the javac that a method doesn't return at all... Michal Kleczek <michal_wytnijto@kleczek.org> - 2014-03-23 11:15 +0100

csiph-web