This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 233653

Summary: No hint to solve "overridden method does not throw XY exception"
Product: java Reporter: Jachym_Vojtek
Component: HintsAssignee: Svata Dedic <sdedic>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 7.4   
Hardware: PC   
OS: Windows 7   
Issue Type: ENHANCEMENT Exception Reporter:

Description Jachym_Vojtek 2013-07-30 12:27:51 UTC
Consider the following example:

package assist.override3;

public interface MyInterface {
    void foo();
}
--
package assist.override3;

import java.io.IOException;

public class MyClass implements MyInterface {

    @Override
    public void foo() throws IOException {
        throw new UnsupportedOperationException("Not supported yet");
    }
    
}

Adding new checked exception to MyClass.foo() causes compile error and error is generated, OK.

Could there be addded also hint to solve this?
. Remove this exception from method signature MyClass.foo() 
or 
. Add exception to MyInterface.foo() if its source code is available