gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] Nit


From: Tom Lord
Subject: Re: [Gnu-arch-users] Nit
Date: Tue, 21 Oct 2003 14:49:52 -0700 (PDT)

    > From: Dustin Sallings <address@hidden>

    > On Tuesday, Oct 21, 2003, at 11:22 US/Pacific, Tom Lord wrote:

    > > I'm not saying that exceptions should _never_ be let through, only
    > > that if you want a programming system to help you write robust code,
    > > then that system should require that you let through exceptions only
    > > explicitly, not implicitly.

    >   But in the context of java-style checked exceptions, this is the case. 
    >   If an exception is declared, it must be handled.

It must be handled _somewhere_up_the_call_graph_.  It must be in the
throws list of my method.  But Java does _not_ require that it be
handled at the call-site.  It's that distinction that is at issue.

Look at it this way:

My method calls FOO.   A recent change means that, unlike before, FOO
can generate exception BAR.   By coincidence, BAR is in the throws
list of my method.   Now my callers are screwed and the compiler is
silent about it.

On the other hand, suppose that instead of a throws-list per method, I
had a throws-list per call.   Exception BAR isn't in my throws list
for the call to FOO.   _Now_ the compiler can flag that as an error.


-t





reply via email to

[Prev in Thread] Current Thread [Next in Thread]