Tiny update to Improved Exception Handling: @SuppressWarnings

Reinier Zwitserloot reinier at zwitserloot.com
Mon Mar 23 14:43:59 PDT 2009


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