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.
Build: NetBeans IDE Dev (Build 200807040101) VM: Java HotSpot(TM) Client VM, 10.0-b23, Java(TM) SE Runtime Environment, 1.6.0_07-b06 OS: Linux, 2.6.24-19-generic, i386 User Comments: Fired when executed by Quick search
Created attachment 64791 [details] stacktrace
Fixed. http://hg.netbeans.org/main/rev/bf637c88ffc3
The root problem is the fact that we misuse javax.swing.Action for things which are some kind of GUI controls but for which actionPerformed makes no sense - classes which are just placeholders for a Presenter.* or ContextAwareAction implementation. This is an API flaw which manifests itself in other ways, e.g. the fact that you can apparently make a keybinding for something which cannot possibly be invoked in this way. Since we cannot retrofit javax.swing.Action with a superinterface giving just display name information, is there some other solution? For example, setValue(SomeNBAPI.PHONY_ACTION, true); to mark an "action" as not really being an action, so that GUI such as Quick Search would not even offer it as a directly invocable object? Or perhaps a special runtime exception so that you could write public boolean isEnabled() {throw new PhonyActionException(this);} public void actionPerformed(ActionEvent ev) {throw new PhonyActionException(this);} (neatly providing a readable body for these methods, rather than using asserts), where Quick Search etc. would know to check for PAE?
Integrated into 'main-golden', available in build *200808280201* on http://bits.netbeans.org/dev/nightly/ Changeset: http://hg.netbeans.org/main/rev/bf637c88ffc3 User: Milan Kubec <mkubec@netbeans.org> Log: #140443: beep instead of assertion error when invoking action that is not to be invoked