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 20497 - "dead" menu items appear sometimes
Summary: "dead" menu items appear sometimes
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 3.x
Hardware: All All
: P4 blocker (vote)
Assignee: phamernik
URL:
Keywords:
Depends on: 22628
Blocks:
  Show dependency tree
 
Reported: 2002-02-13 08:55 UTC by Jesse Glick
Modified: 2008-12-22 20:11 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Sample log file after the problem appears (30.31 KB, text/plain)
2002-06-18 20:26 UTC, Jesse Glick
Details
More helpful log (11.39 KB, text/plain)
2002-06-18 21:08 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2002-02-13 08:55:33 UTC
[dev feb 12] After uninstalling and reinstalling modules, sometimes
links in the Help menu become "dead". Some kind of refresh bug either
in JavaHelp module or in org.openide.awt.MenuBar; need to investigate.
Comment 1 Jesse Glick 2002-06-18 20:26:19 UTC
Created attachment 6311 [details]
Sample log file after the problem appears
Comment 2 Jesse Glick 2002-06-18 21:08:25 UTC
Created attachment 6312 [details]
More helpful log
Comment 3 Jesse Glick 2002-06-18 21:29:43 UTC
I inserted some additional debugging code and tracked down the problem
somewhat. As far as I can tell, MenuBar is working correctly, but
FolderInstance is not.

The problem is easily reproducible in current dev builds by just
turning the XML Core module on or off. A fix of issue #22628 would
probably solve this too.

What I found out (see second log): after turning off (or on) the XML
Core module, all the .xml files which represent help shortcut menu
items get rerecognized (of course). New XMLDataObject.Processor's are
created and attached to them, too. *However* the FolderInstance
continues to the InstanceCookie's belonging to the old data objects, I
think - at least it continues to call instanceCreate() on the old
XMLDO.P's, which return cached menu presenters, which are still bound
to the old XMLDO's and so give the menu item text "dead" because the
associated file now !isValid(). See e.g. the _last_ occurrence of

[org.netbeans.modules.javahelp.HelpCtxProcessor@ec0b80] Reusing cached
help context presenter from
Menu/Help/HelpShortcuts/org-netbeans-modules-usersguide-mainpage.xml

where the reused presenter shows "dead". HelpCtxProcessor@b5efb was
just created and is the new XMLDO.P which is attachTo()'d the new
XMLDO (from the XML Core module which was just turned on). Yet that
processor is not being used by FolderInstance.

If you open Menu/Help/HelpShortcuts/ in the Bean Browser, the current
InstanceCookie's on the available data objects show valid, working
menu items.

Note that Lookup.default.lookup(HelpSet.class) appears to
works fine even after turning on/off XML Core. As far as I know this
lookup uses FolderInstance too (FolderLookup to be precise) and the
XMLDO.P for the help set reference XML files which produce HelpSet's
in Lookup is written analogously to that for the help context
references. (In HelpCtxProcessor for testing purposes I inserted this
line into attachTo:

p = null;

in the fear that the HCP was being cached and attachTo called with the
new XMLDO, and I was overcaching the presenter. But this does not
appear to be the case, as described above, and the patch does not
solve the problem.) I found out however that the current XMLDO.P impl
for help set refs does not check whether the XMLDO is valid when
createInstance() is called. When I inserted such a check, indeed the
XMLDO's were invalid, and lookup on HelpSet failed. This adds a
further argument that FolderInstance or perhaps XMLDataObject is at
fault, not MenuBar.
Comment 4 Jesse Glick 2002-06-24 16:22:22 UTC
Due to the fix of issue #22628, the problem is now solved in [dev jun
24]. I believe FolderInstance is still not working exactly correctly,
but there is no visible symptom. Could reopen if you think openide
code needs fixing for some other reason.
Comment 5 pzajac 2002-10-11 16:09:30 UTC
verified
Comment 6 Quality Engineering 2003-07-01 16:11:32 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.