JDK-7184401 : JDk7u6 : Missing main menu bar in Netbeans after fix for 7162144
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7u6
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2012-07-16
  • Updated: 2014-10-15
  • Resolved: 2012-08-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
7u6 b22Fixed
Related Reports
Relates :  
Relates :  
After the fix for "7162144: Missing AWT thread in headless mode in 7u4 b06"
which is pushed inyo 7u6, I find that netbeans comes up with a completely
empty main menu bar.
I reverted this fix and the menu bar came back .. I repeated this
again to make sure and it does seem to be 100% reproducible.

I didn't see it with SwingSet, so undoubtedly its something netbeans
is doing that makes it an issue but I expect this is still a stopper.

The fix for 7162144 is presently in the 7u6 repo, but is not yet in any
nightly build (I don't know why nightly builds aren't happening, but they aren't),
so you need to create your own build to see this.
If this isn't fixed before then the problem will appear in 7u6 b21.

I also can't test it on JDK 8 since it doesn't appear to be fixed in JDK 8
yet, although I thought all bugs were supposed to be fixed in 8 first.


SUGGESTED FIX http://hg.openjdk.java.net/jdk7u/jdk7u6-dev/jdk/rev/bf941141d1bf

EVALUATION Whether EDT.interrupt() can be used by applications for their own purposes is a separate topic to discuss. In 7u6, however, the only safe solution is to roll-back the fix for 7162144. Applying additional changes on top of 7162144 is too risky.

SUGGESTED FIX Roll-back the fix for 7162144.

EVALUATION The NetBeans AWTTask.EDT class calls Thread.interrupt() for its own purposes and properly makes sure the isInterrupted() status is cleared before the code returns back to AWT code. However, since revision d72ac458b2b7 - anthony 26.9.2011 7081670: Disposing an AppContext can lead to a spinning EventDispatchThread Reviewed-by: art, anthony, dholmes Contributed-by: Clemens Eisserer <###@###.###> The EventDispatchThread overrides the interrupt() method and premanently sets the "shutdown" flag to "true" which then shuts down the thread for no reason.

EVALUATION According to the stack trace, NetBeans calls Thread.interrupt() for AWT event dispatch thread several times on startup. I can't see any obvious reasons for that. What's even more interestingly, these calls are done from the same thread (EDT). Now it's clear why the fix 7162144 is related. In this fix, we changed the way how EventDispatchThread interrupts are handled. Instead of just shutting down the thread, we now additionally discard all the queued events, so pending invokeAndWait() calls are unblocked. This allowed NetBeans test suite to run (which is exactly the problem described in 7162144). It seems that one of the discarded invokeAndWait()'s is the code to initialize NetBeans menubar.