Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 349051

Summary: [quick fix] "Add throws declaration" quick fix is not offered
Product: [Eclipse Project] JDT Reporter: Deepak Azad <deepakazad>
Component: UIAssignee: Deepak Azad <deepakazad>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, deepakazad
Version: 3.7   
Target Milestone: 3.8 M2   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
fix+tests none

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
.