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


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

Re: How to handle same sanity checks

Path csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Andreas Leitgeb <avl@logic.at>
Newsgroups comp.lang.java.programmer
Subject Re: How to handle same sanity checks
Date Thu, 22 Jun 2017 12:30:01 -0000 (UTC)
Organization A noiseless patient Spider
Lines 21
Message-ID <slrnokne96.o2q.avl@logic.at> (permalink)
References <87o9tgo0a9.fsf@munus.decebal.nl> <slrnoknai9.o2q.avl@logic.at> <oigacf$kkm$1@dont-email.me>
Reply-To avl@logic.at
Injection-Date Thu, 22 Jun 2017 12:30:01 -0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="9ecd988584fe5ba656dda35ed07d3df5"; logging-data="12221"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18gOpTD62S6XVE2F2k5aZLM"
User-Agent slrn/1.0.2 (Linux)
Cancel-Lock sha1:nrY87+Wqtj4dWNhYMqnUXFeKnFs=
Xref csiph.com comp.lang.java.programmer:36699

Show key headers only | View raw


Eric Sosman <esosman@comcast-dot-net.invalid> wrote:
> On 6/22/2017 7:26 AM, Andreas Leitgeb wrote:
>> [...]
>> If you really want it thrown at the call-site, there are these slightly
>> more verbose variants:
>> Let checkN() *return* the exception (or null if all was ok), then:
>>     for (Exception e=checkN(...);e!=null;) { throw e; }
> Note that this will put checkN() at the top of the stack trace,
> not the method that called it.  Javadoc for Throwable (emphasis mine):
> 	"[...] A throwable contains a snapshot of the execution stack of
> 	its thread at the time it was *created*. [...]"

Thanks for the correction!

Seems to have been a long standing wrong belief on my side, and browsing
on Stackoverflow and similar sites, it's an often stated (and also often 
correctly refuted) thing.  C# seems to have it differently, but I can't
use that as an excuse for me, as I haven't done any C# programming.

Sorry to OP for my (in hindsight) useless answer.

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


Thread

How to handle same sanity checks Cecil Westerhof <Cecil@decebal.nl> - 2017-06-22 11:10 +0200
  Re: How to handle same sanity checks Martin Gregorie <martin@address-in-sig.invalid> - 2017-06-22 10:27 +0000
    Re: How to handle same sanity checks Cecil Westerhof <Cecil@decebal.nl> - 2017-06-22 13:21 +0200
    Re: How to handle same sanity checks Cecil Westerhof <Cecil@decebal.nl> - 2017-06-23 06:51 +0200
    Re: How to handle same sanity checks Robert Klemme <shortcutter@googlemail.com> - 2017-06-24 12:06 +0200
      Re: How to handle same sanity checks Martin Gregorie <martin@address-in-sig.invalid> - 2017-06-24 10:33 +0000
        Re: How to handle same sanity checks Robert Klemme <shortcutter@googlemail.com> - 2017-06-24 16:46 +0200
          Re: How to handle same sanity checks Martin Gregorie <martin@address-in-sig.invalid> - 2017-06-24 19:37 +0000
  Re: How to handle same sanity checks Andreas Leitgeb <avl@logic.at> - 2017-06-22 11:26 +0000
    Re: How to handle same sanity checks Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-06-22 07:44 -0400
      Re: How to handle same sanity checks Andreas Leitgeb <avl@logic.at> - 2017-06-22 12:30 +0000
  Re: How to handle same sanity checks Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-06-22 07:40 -0400
    Re: How to handle same sanity checks v_borchert@despammed.com (Volker Borchert) - 2017-06-22 18:33 +0000
      Re: How to handle same sanity checks Cecil Westerhof <Cecil@decebal.nl> - 2017-06-23 06:48 +0200
        Re: How to handle same sanity checks Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-06-23 09:57 -0400
          Re: How to handle same sanity checks Cecil Westerhof <Cecil@decebal.nl> - 2017-06-23 16:31 +0200
            Re: How to handle same sanity checks Martin Gregorie <martin@address-in-sig.invalid> - 2017-06-23 17:21 +0000
              Re: How to handle same sanity checks Eric Douglas <e.d.programmer@gmail.com> - 2017-06-26 05:21 -0700
                Re: How to handle same sanity checks Martin Gregorie <martin@address-in-sig.invalid> - 2017-06-26 13:34 +0000
                Re: How to handle same sanity checks Martin Gregorie <martin@address-in-sig.invalid> - 2017-06-26 15:22 +0000
        Re: How to handle same sanity checks Arne Vajhøj <arne@vajhoej.dk> - 2017-06-25 22:55 -0400
  Re: How to handle same sanity checks Marcel Mueller <news.5.maazl@spamgourmet.org> - 2017-06-22 23:07 +0200
  Re: How to handle same sanity checks Joerg Meier <joergmmeier@arcor.de> - 2017-06-25 09:52 +0200
  Re: How to handle same sanity checks Robert Klemme <shortcutter@googlemail.com> - 2017-06-25 12:31 +0200
    Re: How to handle same sanity checks Arne Vajhøj <arne@vajhoej.dk> - 2017-06-25 14:23 -0400
      Style police (Was: Re: How to handle same sanity checks) Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-06-25 17:28 -0400
        Re: Style police (Was: Re: How to handle same sanity checks) Arne Vajhøj <arne@vajhoej.dk> - 2017-06-25 19:14 -0400
        Re: Style police (Was: Re: How to handle same sanity checks) Arne Vajhøj <arne@vajhoej.dk> - 2017-06-25 19:19 -0400
          Re: Style police (Was: Re: How to handle same sanity checks) Robert Klemme <shortcutter@googlemail.com> - 2017-06-26 23:34 +0200

csiph-web