Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349864 - [1.7][compiler] Error message considers AutoCloseable as class
Summary: [1.7][compiler] Error message considers AutoCloseable as class
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.7.1   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-20 15:03 EDT by Markus Keller CLA
Modified: 2011-08-05 02:54 EDT (History)
3 users (show)

See Also:


Attachments
Proposed patch (4.31 KB, patch)
2011-06-21 00:40 EDT, Srikanth Sankaran CLA
no flags Details | Diff
Proposed fix (3.84 KB, patch)
2011-06-21 11:48 EDT, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2011-06-20 15:03:22 EDT
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
Comment 1 Srikanth Sankaran CLA 2011-06-20 23:25:46 EDT
I'll fix it.
Comment 2 Srikanth Sankaran CLA 2011-06-21 00:40:05 EDT
Created attachment 198301 [details]
Proposed patch

We now issue an error message that says:

"The resource type Object does not implement java.lang.AutoCloseable"
Comment 3 Srikanth Sankaran CLA 2011-06-21 00:42:29 EDT
Released in BETA_JAVA7 branch.
Comment 4 Olivier Thomann CLA 2011-06-21 11:47:05 EDT
I think we should also renamed the corresponding IProblem.
Comment 5 Olivier Thomann CLA 2011-06-21 11:48:06 EDT
Created attachment 198345 [details]
Proposed fix

Complement of the previous patch
Comment 6 Olivier Thomann CLA 2011-06-21 11:48:21 EDT
Released in BETA_JAVA7 branch.
Comment 7 Deepak Azad CLA 2011-07-19 07:53:24 EDT
Verified with v20110714-1300.