[concurrency-interest] Thread interruptionprotocol:InterruptedException is a "checked" exception, correct?

David Holmes davidcholmes at aapt.net.au
Wed May 20 16:55:16 EDT 2009


I wrote: 
> In fact I think this affects all JDK 5 versions of Hotspot.

It's just been fixed in 5u18

David

> 
> David Holmes
> 
> > -----Original Message-----
> > From: concurrency-interest-bounces at cs.oswego.edu
> > [mailto:concurrency-interest-bounces at cs.oswego.edu]On Behalf Of Peter
> > Kovacs
> > Sent: Thursday, 21 May 2009 2:06 AM
> > To: Paulo Levi
> > Cc: concurrency-interest at cs.oswego.edu; Tom Hawtin
> > Subject: Re: [concurrency-interest] Thread interruption
> > protocol:InterruptedException is a "checked" exception, correct?
> >
> >
> >
> > Oh, I see Constructor.newInstance() as opposed to Class.newInstance().
> > But this probably irrelevant here as the stack trace fragment I
> > produced in my previous mail appears to show that the exception is
> > from Class.forName(String). Also, we call Constructor.newInstance()
> > instead of Class.newInstance():
> >
> > 	    Class<?> cl = Class.forName(name);
> > 	    Constructor constr = cl.getConstructor(argcl);
> > 	    return constr.newInstance(args);
> >
> > I was just trying to apply Tom's input about passing exception
> > checking to the case we appear to have.
> >
> > Thanks for making me aware of the difference anyway.
> >
> > Peter
> >
> >
> > 2009/5/20 Paulo Levi <i30817 at gmail.com>:
> > > You're not reading the javadoc correctly:
> > > newInstance()
> > > "Note that this method propagates any exception thrown by the nullary
> > > constructor, including a checked exception. Use of this method
> > effectively
> > > bypasses the compile-time exception checking that would otherwise be
> > > performed by the compiler. The Constructor.newInstance method
> > avoids this
> > > problem by wrapping any exception thrown by the constructor in
> > a (checked)
> > > InvocationTargetException."
> > >
> > _______________________________________________
> > Concurrency-interest mailing list
> > Concurrency-interest at cs.oswego.edu
> > http://cs.oswego.edu/mailman/listinfo/concurrency-interest
> 
> 
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest



More information about the Concurrency-interest mailing list