Community
Participate
Working Groups
Build ID: 1.2.0.v20081218-0714 Steps To Reproduce: An exception is thrown during org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIPlugin.start(BundleContext) because it calls org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIPlugin.initializeDefaultDiagramPreferenceStore() which requires the thread it starts on to have a display. My application starts this plugin on a thread that doesn't yet have a display. It needs to be lazy initialized. More information: org.eclipse.core.runtime.AssertionFailedException: null argument: at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:85) at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:73) at org.eclipse.jface.resource.FontRegistry.<init>(FontRegistry.java:282) at org.eclipse.jface.resource.FontRegistry.<init>(FontRegistry.java:300) at org.eclipse.jface.resource.JFaceResources.getFontRegistry(JFaceResources.java:342) at org.eclipse.jface.resource.JFaceResources.getDefaultFont(JFaceResources.java:245) at org.eclipse.gmf.runtime.diagram.ui.preferences.AppearancePreferencePage.setDefaultFontPreference(AppearancePreferencePage.java:280) at org.eclipse.gmf.runtime.diagram.ui.preferences.AppearancePreferencePage.initDefaults(AppearancePreferencePage.java:221) at org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIPlugin.initializeDefaultDiagramPreferenceStore(DiagramUIPlugin.java:95) at org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIPlugin.start(DiagramUIPlugin.java:76) at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:804) at java.security.AccessController.doPrivileged(AccessController.java:251) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:798) ... 42 more
Will look at fixing after M5.
Anthony, for this one, I'm thinking about getting the default font (i.e creating the registry) in async display message if current thread is not the UI thread (like we do for canonical and other things)
Created attachment 130454 [details] proposed patch Here is the patch for what I've proposed
It is sync display message, not async. We want to initialize preferences now and not later... If they are being initialized on a non-UI thread, we need to make one and initialize them right away I think.
Rather than keeping this in the bundle startup, can we initialize on the first use?
Hmm... I'll look into this. Thanks.
Created attachment 130638 [details] proposed patch Anthony, here is the patch that initializes default preferences when org.eclipse.gmf.diagra,.ui plugin preferences are first accessed. I left the previous fix in though. There are no guarantees that default preferences are accessed on the UI thread (like via canonical view creation)
Created attachment 130639 [details] proposed patch Actually, canonical views are created on the UI thread, so I removed the first fix from the patch. We'll assume that preferences are accessed on the UI thread for now.
(In reply to comment #8) > Created an attachment (id=130639) [details] > proposed patch > > Actually, canonical views are created on the UI thread, so I removed the first > fix from the patch. We'll assume that preferences are accessed on the UI thread > for now. > That is great, the patch looks good.
Committed the patch for 2.2 M7
[target cleanup] 2.2 M7 was the original target milestone for this bug
[GMF Restructure] Bug 319140 : product GMF and component Runtime Diagram was the original product and component for this bug