Tiny update to Improved Exception Handling: @SuppressWarnings (original) (raw)

Roel Spilker r.spilker at gmail.com
Tue Mar 24 01:38:16 PDT 2009


I prefer

catch (@SuppressWarnings("unthrown") IOException e) {}

On Mon, Mar 23, 2009 at 10:43 PM, Reinier Zwitserloot < reinier at zwitserloot.com> wrote:

If the suggestion to remove the requirement that catch blocks are reachable is accepted, I suggest such code should still generate a warning. You can put @SuppressWarnings on the exception block, like so:

try { int x = 5 + 5; } catch ( @SuppressWarnings("unreachable") IOException iDontOccurInTryBlock) { //whatever }

Perhaps the notion that the compiler will presume that annotation is referring to the catch block should be added to the proposal. --Reinier Zwitserloot (on behalf of Roel Spilker, who came up with this).



More information about the coin-dev mailing list