Hi Mark,

Am Donnerstag, den 18.08.2005, 22:56 +0200 schrieb Mark Wielaard:
> Hi,
> 
> On Thu, 2005-08-18 at 15:41 +0200, Roman Kennke wrote:
> >             public void run ()
> >             {
> > -             ip.startProduction (PixelGrabber.this);
> > +              try
> > +                {
> > +                  ip.startProduction (PixelGrabber.this);
> > +                }
> > +              catch (Exception ex)
> > +                {
> > +                  ex.printStackTrace();
> > +                  imageComplete(ImageConsumer.ABORTED);
> > +                }
> >             }
> >           };
> 
> Why catch Exception and not Throwable? (You will miss notifying the
> consumer when an Error is thrown).

Yeah, that's right. It's just a habit of mine to catch Exceptions and
not Throwables, but in this case it really would make sense.

>  Why print the stack trace?

Because an exception is probably not expected here and indicates an
error either in Classpath or in the user application. It would be bad to
simply swallow it. I think this is done in several cases where a Thread
is protected from beeing shot by an exception (like in the event queue).
Do you think I should remove the printStackTrace()?

/Roman




_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to