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 211284 - 4s - MenuBar$LazyMenu.getMenuComponents() on Mac OS X due to non-functional thread.interrupt()?
Summary: 4s - MenuBar$LazyMenu.getMenuComponents() on Mac OS X due to non-functional t...
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Actions (show other bugs)
Version: 7.2
Hardware: Macintosh (x86) Mac OS X
: P2 normal (vote)
Assignee: Stanislav Aubrecht
URL:
Keywords: PERFORMANCE
: 212859 222511 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-04-16 17:53 UTC by Montserrat
Modified: 2012-11-25 18:32 UTC (History)
43 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 187070


Attachments
nps snapshot (127.81 KB, application/nps)
2012-04-16 17:54 UTC, Montserrat
Details
Possible fix (1.41 KB, patch)
2012-11-08 11:51 UTC, Stanislav Aubrecht
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Montserrat 2012-04-16 17:53:57 UTC
This bug was originally marked as duplicate of bug 196753, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE Dev (Build nbms-and-javadoc-9227-on-20120416)
VM: Java HotSpot(TM) 64-Bit Server VM, 20.6-b01-415, Java(TM) SE Runtime Environment, 1.6.0_31-b04-415-11M3635
OS: Mac OS X
Maximum slowness yet reported was 4253 ms, average is 4253
Comment 1 Montserrat 2012-04-16 17:54:06 UTC
Created attachment 118363 [details]
nps snapshot
Comment 2 Jaroslav Tulach 2012-05-24 07:10:22 UTC
Happens only when using Aqua L&F. Need Mac to investigate.
Comment 3 Jaroslav Tulach 2012-05-28 07:04:01 UTC
*** Bug 212859 has been marked as a duplicate of this bug. ***
Comment 4 Michel Graciano 2012-06-06 19:25:34 UTC
There are some dup reports that are not from MacOS X. Maybe they are not really dup? For example, report #587831.
Comment 5 Martin Janicek 2012-07-18 07:45:55 UTC
Does not look like Mac specific --> I've just reproduce it with Ubuntu
Comment 6 Jaroslav Tulach 2012-08-22 15:15:23 UTC
I don't have a Mac to verify, but the eventDispatchThread.interrupt() may not be fully functional on Mac OS X (JDK bugs 7162144 and 7159266) - in such case the menu expansion needlessly blocks for 1s per menu waiting for timeout.
Comment 7 Stanislav Aubrecht 2012-11-07 10:13:46 UTC
180 reports -> P2
Comment 8 Stanislav Aubrecht 2012-11-08 11:51:58 UTC
Created attachment 127387 [details]
Possible fix
Comment 9 Stanislav Aubrecht 2012-11-08 11:56:17 UTC
There are more than 100 slowness reports from Mac OS X. All of them happen because component tree is being refreshed on main window activation/deactivation events. At that time the content of drop down menus is not even visible so there's no need to force their creation (and block until they're ready).

Please consider the attached patch. I've tested it on a Mac and it doesn't seem to do any harm. (There might a better way of detection of the situation described above though)

Slowness reports from Linux and Windows OS should be treated in a separate issue.
Comment 10 Jaroslav Tulach 2012-11-09 13:19:17 UTC
I don't have a way to verify or an expertise to judge:

if( "Aqua".equals(UIManager.getLookAndFeel().getID()) )

Stando, if you think it is the right way to fix the problem, just apply it. The code is horrible, but if it helps, than it is probably better than 100x of slowness reports.
Comment 11 Stanislav Aubrecht 2012-11-09 13:28:06 UTC
core-main 2e85015dc07b

I hope it helps...
Comment 12 Quality Engineering 2012-11-11 03:18:00 UTC
Integrated into 'main-golden', will be available in build *201211110001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/2e85015dc07b
User: S. Aubrecht <saubrecht@netbeans.org>
Log: #211284 - don't initialize menu items when the component tree is being refreshed on main wnd (de)activation
Comment 13 ionuion 2012-11-21 10:22:55 UTC
verified using the nighly build could not reproduce
Comment 14 Stanislav Aubrecht 2012-11-21 11:54:21 UTC
*** Bug 222511 has been marked as a duplicate of this bug. ***