Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349051 - [quick fix] "Add throws declaration" quick fix is not offered
Summary: [quick fix] "Add throws declaration" quick fix is not offered
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.8 M2   Edit
Assignee: Deepak Azad CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-10 11:05 EDT by Deepak Azad CLA
Modified: 2011-08-13 08:46 EDT (History)
2 users (show)

See Also:


Attachments
fix+tests (7.23 KB, patch)
2011-08-13 08:45 EDT, Deepak Azad CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Deepak Azad CLA 2011-06-10 11:05:49 EDT
Fix for Bug 107923 isn't great as "Add throws declaration" quickfix is not offered in the following snippet even though it is perfectly valid here.

-----------------------------------------------
class MyException extends Exception {
	
}
class A implements AutoCloseable {
	@Override
	public void close() {
		throw new MyException();
	}
}
-----------------------------------------------
Comment 1 Deepak Azad CLA 2011-08-13 08:45:26 EDT
Created attachment 201458 [details]
fix+tests

If the overridden method is not from source, we need to check if the new throws clause will be compatible with the throws clause in the overridden method or not.

Fixed in HEAD.
Comment 2 Deepak Azad CLA 2011-08-13 08:46:02 EDT
.