Bug 348186 - [compiler] Improve wording for the warning for masked/hidden catch block
Summary: [compiler] Improve wording for the warning for masked/hidden catch block
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.8 M3   Edit
Assignee: Ayushman Jain CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-03 05:31 EDT by Ayushman Jain CLA
Modified: 2011-10-24 02:20 EDT (History)
3 users (show)

See Also:
srikanth_sankaran: review+


Attachments
proposed fix (5.87 KB, patch)
2011-09-29 04:25 EDT, Ayushman Jain CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ayushman Jain CLA 2011-06-03 05:31:50 EDT
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).
Comment 1 Ayushman Jain CLA 2011-06-03 05:45:39 EDT
Sorry this is not a precise rethrow problem. My bad. Changing bug description. Targetting 3.8. This will be fixed on HEAD.
Comment 2 Ayushman Jain CLA 2011-09-29 04:25:52 EDT
Created attachment 204265 [details]
proposed fix

Fixed message and updated tests
Comment 3 Ayushman Jain CLA 2011-09-29 04:27:21 EDT
Fixed in HEAD with commit 283ea669e65ae7c25e43949f506630d59e6cdb74
Comment 4 Ayushman Jain CLA 2011-09-29 05:40:46 EDT
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.
Comment 5 Srikanth Sankaran CLA 2011-09-30 00:51:38 EDT
Agree with the change.
Comment 6 Srikanth Sankaran CLA 2011-10-24 02:20:11 EDT
Verified for 3.8 M3 using build id: N20111022-2000.

(Can we have full test cases in comment#0 please ?)