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 200529 - Illegal threading behavior in Installer.closing
Summary: Illegal threading behavior in Installer.closing
Status: RESOLVED FIXED
Alias: None
Product: ide
Classification: Unclassified
Component: Welcome (show other bugs)
Version: 7.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Stanislav Aubrecht
URL:
Keywords: THREAD
Depends on:
Blocks: 179473
  Show dependency tree
 
Reported: 2011-07-29 18:29 UTC by Jesse Glick
Modified: 2011-08-03 13:52 UTC (History)
0 users

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 Jesse Glick 2011-07-29 18:29:51 UTC
welcome.Installer makes unfounded assumptions about which thread it is invoked on. When run in http://wiki.netbeans.org/NetBeansInOSGi#Demo you get many stack traces, starting with:

Jul 29, 2011 2:16:42 PM org.netbeans.core.windows.WindowManagerImpl warnIfNotInEDT
WARNING: null
java.lang.IllegalStateException: Problem in some module which uses Window System: Window System API is required to be called from AWT thread only, see http://core.netbeans.org/proposals/threading/
	at org.netbeans.core.windows.WindowManagerImpl.warnIfNotInEDT(WindowManagerImpl.java:1686)
	at org.netbeans.core.windows.WindowManagerImpl.topComponentID(WindowManagerImpl.java:1367)
	at org.openide.windows.WindowManager.findTopComponentID(WindowManager.java:529)
	at org.netbeans.core.windows.model.TopComponentSubModel.getID(TopComponentSubModel.java:370)
	at org.netbeans.core.windows.model.TopComponentSubModel.containsTopComponent(TopComponentSubModel.java:266)
	at org.netbeans.core.windows.model.DefaultModeModel.containsTopComponent(DefaultModeModel.java:348)
	at org.netbeans.core.windows.model.DefaultModel.containsModeTopComponent(DefaultModel.java:905)
	at org.netbeans.core.windows.Central.containsModeTopComponent(Central.java:1517)
	at org.netbeans.core.windows.ModeImpl.containsTopComponent(ModeImpl.java:431)
	at org.netbeans.core.windows.WindowManagerImpl.isEditorTopComponent(WindowManagerImpl.java:1393)
	at org.netbeans.modules.welcome.Installer.closing(Installer.java:56)
	at org.netbeans.core.osgi.OSGiLifecycleManager.exit(OSGiLifecycleManager.java:93)
	at org.netbeans.core.actions.SystemExit.run(SystemExit.java:89)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1424)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1968)

WelcomeOptions and related code is a weird design anyway; hacks around normal winsys persistence, presumably causing things like bug #195744. Better would be to make it behave like a normal, persist-when-open singleton TC. Optionally also tell the user how to reopen it, when first (acc. to NbPreferences key) closed. I can supply a patch if you agree.
Comment 1 Stanislav Aubrecht 2011-08-01 10:33:36 UTC
it's actually a trick to avoid editor initialization to improve startup time:)

i changed the code to use the new windowsystemlistener

core-main 68f6b1d11c33
Comment 2 Quality Engineering 2011-08-03 13:52:35 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/68f6b1d11c33
User: S. Aubrecht <saubrecht@netbeans.org>
Log: #200529 - use WindowSystemListener to 'hide' active editor window