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 - No hint to solve "overridden method does not throw XY exception"
Summary: No hint to solve "overridden method does not throw XY exception"
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-30 12:27 UTC by Jachym_Vojtek
Modified: 2015-10-05 12:18 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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