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 60833 - [Override Methods] menuitem enabled for file with more top-level elements
Summary: [Override Methods] menuitem enabled for file with more top-level elements
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Daniel Prusa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-11 11:08 UTC by Jiri Prox
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 Jiri Prox 2005-07-11 11:08:56 UTC
NB 4.2 (200507061800)
JDK 1.5.0_04

The 'Override methods' menu item is enabled for the node with more top-level
elements but is does nothing.

Demonstration:
1) create new class Stuff3 with this code:
interface Stuff1 {
 void doStuff1();
}

interface Stuff2 extends Stuff1 {
 void doStuff2();
}

class Stuff3 implements Stuff2 {    

}

it's important to have if all in one file

2) select the Stuff3.java node in the project window 
3) right click and call Tools | Override methods

-> nothing happens

It should be disabled or the warning should be poped up.
For node containing only one top level element (common .java file) or for class
node (one level below .java node) it works fine.
Comment 1 Daniel Prusa 2005-09-14 13:48:29 UTC
Override Methods should work for all top level classes, even if there are more
such classes in one source. I am not able to reproduce this problem using your
example. I have only noted that nothing happens when the action is invoked on
interface (is it possible that this was your case?). There is nothing to
override - I have added a warning message for this situation (to disable the
action for interfaces would require some time expensive computation each time
the current node is changed, thus I prefer this solution). It has been fixed in
main trunk:

/cvs/java/src/org/netbeans/modules/java/tools/Bundle.properties
new revision: 1.17; previous revision: 1.16
/cvs/java/src/org/netbeans/modules/java/tools/OverrideAction.java
new revision: 1.31; previous revision: 1.30
Comment 2 Jiri Prox 2005-10-26 16:45:45 UTC
verified
Comment 3 Quality Engineering 2007-09-20 12:08:30 UTC
Reorganization of java component