You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by sebb <se...@gmail.com> on 2009/02/25 00:43:58 UTC

Unthrown Exceptions in NIO

There are a few Eclipse warnings of unthrown Exceptions in NIO, for example:

SSLIOSession.inboundTransport() throws IOException

which does not actually throw any Exceptions.

Should these be removed?
Documented?
@Suppressed?

S///

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: Unthrown Exceptions in NIO

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2009-02-25 at 15:51 +0000, sebb wrote:
> On 25/02/2009, Oleg Kalnichevski <ol...@apache.org> wrote:
> > On Wed, 2009-02-25 at 13:20 +0000, sebb wrote:
> >  > On 25/02/2009, Oleg Kalnichevski <ol...@apache.org> wrote:
> >  > > sebb wrote:
> >  > >
> >  > > > There are a few Eclipse warnings of unthrown Exceptions in NIO, for
> >  > > example:
> >  > > >
> >  > > > SSLIOSession.inboundTransport() throws IOException
> >  > > >
> >  > > > which does not actually throw any Exceptions.
> >  > > >
> >  > > > Should these be removed?
> >  > > > Documented?
> >  > > > @Suppressed?
> >  > > >
> >  > > >
> >  > >
> >  > >  I do not think 'throws' declaration can be removed without breaking API
> >  > > compatibility. One possibility could be to copy the method, remove 'throws',
> >  > > change the original method to call the new one, and deprecate the original
> >  > > method. I am not sure it is worth the trouble, so @Suppressed should be the
> >  > > easiest work-around.
> >  >
> >  > Or adding @throws to the Javadoc might be better, as one can document
> >  > that it is not actually thrown, e.g.
> >  >
> >  >  * @throws IOException - not thrown currently
> >  >
> >
> >
> > True, but this will not solve the problem with Eclipse, will it?
> >
> 
> Actually, it does.
> 

Cool. Then, it is certainly the best thing to do.

Oleg



> >  Oleg
> >
> >
> >
> >  > >  Cheers
> >  > >
> >  > >  Oleg
> >  > >
> >  > >
> >  > > > S///
> >  > > >
> >  > > >
> >  > > ---------------------------------------------------------------------
> >  > > > To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> >  > > > For additional commands, e-mail: dev-help@hc.apache.org
> >  > > >
> >  > > >
> >  > >
> >  > >
> >  > > ---------------------------------------------------------------------
> >  > >  To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> >  > >  For additional commands, e-mail: dev-help@hc.apache.org
> >  > >
> >  > >
> >  >
> >  > ---------------------------------------------------------------------
> >  > To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> >  > For additional commands, e-mail: dev-help@hc.apache.org
> >  >
> >
> >
> >  ---------------------------------------------------------------------
> >  To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> >  For additional commands, e-mail: dev-help@hc.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: Unthrown Exceptions in NIO

Posted by sebb <se...@gmail.com>.
On 25/02/2009, Oleg Kalnichevski <ol...@apache.org> wrote:
> On Wed, 2009-02-25 at 13:20 +0000, sebb wrote:
>  > On 25/02/2009, Oleg Kalnichevski <ol...@apache.org> wrote:
>  > > sebb wrote:
>  > >
>  > > > There are a few Eclipse warnings of unthrown Exceptions in NIO, for
>  > > example:
>  > > >
>  > > > SSLIOSession.inboundTransport() throws IOException
>  > > >
>  > > > which does not actually throw any Exceptions.
>  > > >
>  > > > Should these be removed?
>  > > > Documented?
>  > > > @Suppressed?
>  > > >
>  > > >
>  > >
>  > >  I do not think 'throws' declaration can be removed without breaking API
>  > > compatibility. One possibility could be to copy the method, remove 'throws',
>  > > change the original method to call the new one, and deprecate the original
>  > > method. I am not sure it is worth the trouble, so @Suppressed should be the
>  > > easiest work-around.
>  >
>  > Or adding @throws to the Javadoc might be better, as one can document
>  > that it is not actually thrown, e.g.
>  >
>  >  * @throws IOException - not thrown currently
>  >
>
>
> True, but this will not solve the problem with Eclipse, will it?
>

Actually, it does.

>  Oleg
>
>
>
>  > >  Cheers
>  > >
>  > >  Oleg
>  > >
>  > >
>  > > > S///
>  > > >
>  > > >
>  > > ---------------------------------------------------------------------
>  > > > To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
>  > > > For additional commands, e-mail: dev-help@hc.apache.org
>  > > >
>  > > >
>  > >
>  > >
>  > > ---------------------------------------------------------------------
>  > >  To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
>  > >  For additional commands, e-mail: dev-help@hc.apache.org
>  > >
>  > >
>  >
>  > ---------------------------------------------------------------------
>  > To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
>  > For additional commands, e-mail: dev-help@hc.apache.org
>  >
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
>  For additional commands, e-mail: dev-help@hc.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: Unthrown Exceptions in NIO

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2009-02-25 at 13:20 +0000, sebb wrote:
> On 25/02/2009, Oleg Kalnichevski <ol...@apache.org> wrote:
> > sebb wrote:
> >
> > > There are a few Eclipse warnings of unthrown Exceptions in NIO, for
> > example:
> > >
> > > SSLIOSession.inboundTransport() throws IOException
> > >
> > > which does not actually throw any Exceptions.
> > >
> > > Should these be removed?
> > > Documented?
> > > @Suppressed?
> > >
> > >
> >
> >  I do not think 'throws' declaration can be removed without breaking API
> > compatibility. One possibility could be to copy the method, remove 'throws',
> > change the original method to call the new one, and deprecate the original
> > method. I am not sure it is worth the trouble, so @Suppressed should be the
> > easiest work-around.
> 
> Or adding @throws to the Javadoc might be better, as one can document
> that it is not actually thrown, e.g.
> 
>  * @throws IOException - not thrown currently
> 

True, but this will not solve the problem with Eclipse, will it?

Oleg


> >  Cheers
> >
> >  Oleg
> >
> >
> > > S///
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> > > For additional commands, e-mail: dev-help@hc.apache.org
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> >  To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> >  For additional commands, e-mail: dev-help@hc.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: Unthrown Exceptions in NIO

Posted by sebb <se...@gmail.com>.
On 25/02/2009, Oleg Kalnichevski <ol...@apache.org> wrote:
> sebb wrote:
>
> > There are a few Eclipse warnings of unthrown Exceptions in NIO, for
> example:
> >
> > SSLIOSession.inboundTransport() throws IOException
> >
> > which does not actually throw any Exceptions.
> >
> > Should these be removed?
> > Documented?
> > @Suppressed?
> >
> >
>
>  I do not think 'throws' declaration can be removed without breaking API
> compatibility. One possibility could be to copy the method, remove 'throws',
> change the original method to call the new one, and deprecate the original
> method. I am not sure it is worth the trouble, so @Suppressed should be the
> easiest work-around.

Or adding @throws to the Javadoc might be better, as one can document
that it is not actually thrown, e.g.

 * @throws IOException - not thrown currently

>  Cheers
>
>  Oleg
>
>
> > S///
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> > For additional commands, e-mail: dev-help@hc.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
>  For additional commands, e-mail: dev-help@hc.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: Unthrown Exceptions in NIO

Posted by Oleg Kalnichevski <ol...@apache.org>.
sebb wrote:
> There are a few Eclipse warnings of unthrown Exceptions in NIO, for example:
> 
> SSLIOSession.inboundTransport() throws IOException
> 
> which does not actually throw any Exceptions.
> 
> Should these be removed?
> Documented?
> @Suppressed?
> 

I do not think 'throws' declaration can be removed without breaking API 
compatibility. One possibility could be to copy the method, remove 
'throws', change the original method to call the new one, and deprecate 
the original method. I am not sure it is worth the trouble, so 
@Suppressed should be the easiest work-around.

Cheers

Oleg

> S///
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org