commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Cooper" <mart...@apache.org>
Subject Re: [io] Inner class exception
Date Tue, 09 Jan 2007 05:48:05 GMT
On 1/8/07, Henri Yandell <flamefew@gmail.com> wrote:
>
> On 1/8/07, Stephen Colebourne <scolebourne@btopenworld.com> wrote:
> > Martin Cooper wrote:
> > > Could you say more about this, please? I happen to disagree on
> > > exceptions as
> > > inner classes being a bad idea; FileUpload has done this for years,
> without
> > > any problems. But I'm always interested in hearing new perspectives...
> >
> > I guess its stylistic, and therefore subjective. But I see an exception
> > as a critical system object, and not one that should be relegated to
> > inner class status.
>
> +1
>
> } catch( DirectoryWalker.CancellationException ce) {
> ...
> }
>
> feels weak to me.


Weak why? To me, it makes the code very explicit about what is being
cancelled. It also, by the way, allows for other classes to have a
CancellationException without having to make up some other name, because the
enclosing class scopes the exception class name and allows its reuse in
other classes. It seems like an eminently suitable way of naming / scoping
tightly coupled classes such as we see with these types of exceptions.

--
Martin Cooper


Either we should catch CancellationException and its
> a normal class, or we should catch IOException and it's package static
> rather than public static.
>
> Hen
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message