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.
I branded out FindAction from toolbar and menu. It caused AssertionError in FindActionManager.getFindActionMapKey() method. It looks that the action instance is not created when method is called, because nobody requests it. The fix seems to be trivial: If you really need the instance, then please call SharedClassObject.findObject(FindAction.class, true) instead of single param version of this method (create=true). Or if you don't need it then do not test null using assert. Current code causes an exception immediately after our application start. As workaround I must call SharedClassObject.findObject(FindAction.class, true) somewhere in my code before FindActionManager is called.
Created attachment 32731 [details] Exception
I got the same exception. Can you give me some guidance as to where to put the workaround code? I figured that I could do it in a ModuleInstall class (I tried in the constructor, restored and initialize methods), but that didn't work, I still get one exception. Any suggestions?
Put it to static block of your module installer class. Then it is called when class is loaded. You also need to hold this reference, otherwise it can be "garbage collected" immediately. <code> public class MyModule extends ModuleInstall { private static final FindAction FIND_ACTION_HOOK; static { FIND_ACTION_HOOK = (FindAction) SharedClassObject.findObject(FindAction.class, true); } } </code>
*** Issue 91429 has been marked as a duplicate of this issue. ***
Accepted.
*** Issue 96369 has been marked as a duplicate of this issue. ***
*** Issue 99566 has been marked as a duplicate of this issue. ***
*** Issue 100046 has been marked as a duplicate of this issue. ***
Is anyone responsible for this module? Marian, according to your comment you started to work on this in January/12? IMHO fixing this bug would take <2 minutes. I proposed two options of bugfix 3/4 year ago and both are trivial. I guess fixing it would be less time than reading new and new bugs and marking them as duplicate of this one...
Fixed in the trunk. Modified file: utilities/src/org/netbeans/modules/search/FindActionManager.java (1.14) Diff: http://utilities.netbeans.org/source/browse/utilities/src/org/netbeans/modules/search/FindActionManager.java?r1=1.12&r2=1.14&diff_format=u
*** Issue 117628 has been marked as a duplicate of this issue. ***