Community
Participate
Working Groups
BETA_JAVA7 void foo() { try { throw new FileNotFoundException(); } catch (FileNotFoundException ex) { } catch (IOException ex) { // see warning here } } In the above case, the warning says "Unreachable catch block for IOException. Only more specific exceptions are thrown and handled by previous catch block(s)." This kind of implies that the exceptions are being thrown AND handled by prev. catch blocks. But should actually be "Unreachable catch block for IOException. Only more specific exceptions are thrown and they are handled by previous catch block(s).
Sorry this is not a precise rethrow problem. My bad. Changing bug description. Targetting 3.8. This will be fixed on HEAD.
Created attachment 204265 [details] proposed fix Fixed message and updated tests
Fixed in HEAD with commit 283ea669e65ae7c25e43949f506630d59e6cdb74
Oops, forgot to get this reviewed. Srikanth, let me know if the new diagnostic message "Unreachable catch block for IOException. Only more specific exceptions are thrown and they are handled by previous catch block(s)." is ok.
Agree with the change.
Verified for 3.8 M3 using build id: N20111022-2000. (Can we have full test cases in comment#0 please ?)