Remaining doclint issues in java.net

Matthew Hall mhall at mhcomputing.net
Wed Jul 31 21:39:57 UTC 2013


On Wed, Jul 31, 2013 at 02:38:26PM -0700, Stuart Marks wrote:
> The alternative is to add "@throws SocketException never" to the
> javadoc, just to get rid of the doclint warning, but this has the
> consequence of requiring people to keep dead code around
> indefinitely, and furthermore it requires them to add new dead code
> every time they create a DatagramPacket.

I have never understood in many years using Java why the compiler generates 
errors about attempting to catch supposedly-impossible exceptions, instead of 
warnings.

For me it only leads to difficulties when I'm trying to write prototypes or 
refactor and clean up some old brittle code, and I run into that rather 
dubious sort of error.

This is a good example of where it causes more harm than good. Is there still 
a really good reason for this over-paranoid compiler error given that checked 
exceptions aren't as popular as they used to be anyways?

Matthew.



More information about the core-libs-dev mailing list