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 172277 - ConcurrentModificationException thrown sporadically at startup when using Nimbus
Summary: ConcurrentModificationException thrown sporadically at startup when using Nimbus
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 6.x
Hardware: PC Windows Vista
: P2 blocker (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-15 12:37 UTC by cemerick
Modified: 2009-09-19 11:00 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description cemerick 2009-09-15 12:37:23 UTC
This was pulled from the log of a deployed NB RCP application, where the user was getting sporadic error dialogs at
startup (and being rightly concerned that things were badly broken):

java.util.ConcurrentModificationException
	at java.util.Hashtable$Enumerator.next(Hashtable.java:1031)
	at com.sun.java.swing.plaf.nimbus.NimbusStyle.compileDefaults(NimbusStyle.java:378)
	at com.sun.java.swing.plaf.nimbus.NimbusStyle.validate(NimbusStyle.java:297)
	at com.sun.java.swing.plaf.nimbus.NimbusStyle.getValues(NimbusStyle.java:927)
	at com.sun.java.swing.plaf.nimbus.NimbusStyle.getInsets(NimbusStyle.java:605)
	at javax.swing.plaf.synth.SynthStyle.installDefaults(SynthStyle.java:896)
	at javax.swing.plaf.synth.SynthLookAndFeel.updateStyle(SynthLookAndFeel.java:276)
	at javax.swing.plaf.synth.SynthMenuBarUI.updateStyle(SynthMenuBarUI.java:58)
	at javax.swing.plaf.synth.SynthMenuBarUI.installDefaults(SynthMenuBarUI.java:47)
	at javax.swing.plaf.basic.BasicMenuBarUI.installUI(BasicMenuBarUI.java:56)
	at javax.swing.JComponent.setUI(JComponent.java:673)
	at javax.swing.JMenuBar.setUI(JMenuBar.java:118)
	at javax.swing.JMenuBar.updateUI(JMenuBar.java:127)
	at javax.swing.JMenuBar.<init>(JMenuBar.java:95)
	at org.openide.awt.MenuBar.<init>(MenuBar.java:128)
	at org.openide.awt.MenuBar.<init>(MenuBar.java:136)
	at org.netbeans.core.windows.view.ui.MainWindow.createMenuBar(MainWindow.java:370)
	at org.netbeans.core.windows.view.ui.MainWindow.init(MainWindow.java:143)
	at org.netbeans.core.windows.WindowSystemImpl.init(WindowSystemImpl.java:68)
	at org.netbeans.core.NonGui.initializeMainWindow(NonGui.java:169)
	at org.netbeans.core.NonGui.run(NonGui.java:104)
	at org.netbeans.core.startup.Main.start(Main.java:319)
	at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:111)
	at java.lang.Thread.run(Thread.java:619)

It looks like Nimbus is being initialized outside of the EDT (or, at least that's the only reason I can think of why
Nimbus would toss a CME at startup).  FYI, we're using a "--laf Nimbus" jvm argument to set the L&F, using 64-bit JRE 1.6.x.
Comment 1 Stanislav Aubrecht 2009-09-15 12:48:41 UTC
side-effect of issue #30121, reassigning
Comment 2 Jaroslav Tulach 2009-09-18 08:43:54 UTC
I guess we can move the creation of MenuBar into AWT. Just its population with entities could be done later and the 
waitFinished() call would be in background thread.
Comment 3 Jaroslav Tulach 2009-09-18 11:07:11 UTC
This is the simplest solution: core-main#1fd8b41b72c2
If it results in a bunch of NPEs or similar errors, we can design some API that will start the MenuBar$Folder 
processing outside of EQ without the need to create the MenuBar. Let see how robust the will 1fd8b41b72c2 show.
Comment 4 Quality Engineering 2009-09-19 11:00:19 UTC
Integrated into 'main-golden', will be available in build *200909190201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/1fd8b41b72c2
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #172277: Don't initialize LaF outside of EQ (and allow new MenuBar outside of EQ)