I can confirm this is practice, in fact, the modification to
Check.java I described a few posts ago would also allow compilation of
code with catch clauses of checked exceptions not really being thrown.

/Casper

On 19 Aug., 13:14, Reinier Zwitserloot <reini...@gmail.com> wrote:
> So there IS a bug for that.
>
> I've added a link tohttp://bugs.sun.com/view_bug.do?bug_id=6534270to
> the documentation for lombok's @SupressWarnings, which does the exact
> same thing.
>
> Christian: If you go in with a class file editor and remove the throws
> clauses, the code will continue to run just fine. The validator will
> NOT choke on it. I'm sure of that bit, and I'm almost sure that you
> may catch a checked exception that no statement in the try block could
> possibly throw, as well. javac won't compile such code, but again
> that's just javac, and not a JVM thing.
>
> On Aug 19, 3:06 am, Alex Buckley <alex.buck...@sun.com> wrote:
>
> > I'm slightly embarrassed to admit I'm a fan 
> > ofhttp://bugs.sun.com/view_bug.do?bug_id=6534270
>
> > On Aug 15, 5:56 am, Jeff Grigg <jeffgr...@charter.net> wrote:
>
> > > I like the beauty and simplicity of completely empty catch blocks.  >;->  
> > > OK, some developers, to comply with corporate documentation
>
> > > standards, put comments there.   >;->
>
> > > (Reality is that I'll usually wrap checked exceptions in
> > > RuntimeExceptions at a low level, and then catch Exception at the top
> > > level -- to log it and abort or retry the transaction or user action.
> > > There's a lot of really bad code out there that misuses exceptions and
> > > does exception handling cleanup wrong.  It's a problem!!)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to javaposse@googlegroups.com
To unsubscribe from this group, send email to 
javaposse+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to