| Summary: | [1.7][compiler] Error message considers AutoCloseable as class | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> | ||||||
| Component: | Core | Assignee: | Srikanth Sankaran <srikanth_sankaran> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | deepakazad, Olivier_Thomann, srikanth_sankaran | ||||||
| Version: | 3.7 | ||||||||
| Target Milestone: | 3.7.1 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows 7 | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
I'll fix it. Created attachment 198301 [details]
Proposed patch
We now issue an error message that says:
"The resource type Object does not implement java.lang.AutoCloseable"
Released in BETA_JAVA7 branch. I think we should also renamed the corresponding IProblem. Created attachment 198345 [details]
Proposed fix
Complement of the previous patch
Released in BETA_JAVA7 branch. Verified with v20110714-1300. |
BETA_JAVA7 The error message considers AutoCloseable as a class here: public class TryWithResources3 { public static void main(String[] args) { try (Object res= 0) { } catch (Exception e) { } } } Error message: The resource type Object has to be a subclass of java.lang.AutoCloseable Expected: The resource type Object must implement java.lang.AutoCloseable