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 27038 - [Override Methods] Overriding method with more limited exception specification causes sync prompts
Summary: [Override Methods] Overriding method with more limited exception specificatio...
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-09-05 00:02 UTC by _ briansmith
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ briansmith 2002-09-05 00:02:44 UTC
consider the following:

class Foo {
   abstract void execute() throws Exception;
}

class Bar extends Foo {
   void execute() throws java.io.IOException {
      throw new java.io.IOException("Bar");
   }
}

In this example, the subclass is overriding the
superclass's method. However, the "Override
Methods" feature will repeatedly complain that
class Bar needs to implement 
"abstract void Foo::execute() throws Exception",
even though it already is overriding it.

I believe, that the "Override Methods" feature
needs to recognize the situations where the
subclass's method has a more specific (less
general) exception specification than the declared
method it is overriding.
Comment 1 Tomas Hurka 2002-09-26 11:19:11 UTC
Fixed in trunk. Overridden method should declare only those 
exceptions, which it actually throws and not all exception, which 
declares superclass method. Exception synchronization was removed, 
since it is not needed. 
Comment 2 Jan Becicka 2002-10-15 14:32:06 UTC
Verified