| Summary: | [1.5][compiler] Enum constructor that throws Exception reports a confusing error message | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Olivier Thomann <Olivier_Thomann> | ||||
| Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | satyam.kandula | ||||
| Version: | 3.7 | ||||||
| Target Milestone: | 3.7 M7 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 191229 [details]
Proposed fix + regression test
Released for 3.7M7. I think the error message could be further improved by giving the error at X rather than A and B. I have filed bug 343738 to take care of it. As the error message has improved, I am marking this as Verified. Verified for 3.7M7 using I20110421-1800 |
Compiling the following code: public enum X { A, B; private X() throws Exception { } } It reports: ---------- 1. ERROR in C:\tests_sources\X.java (at line 1) public enum X { ^ Unhandled exception type Exception ---------- 2. ERROR in C:\tests_sources\X.java (at line 1) public enum X { ^ Unhandled exception type Exception ---------- 2 problems (2 errors) It is confusing to find out what the problem is. The error should be reported against the enum constant.