Community
Participate
Working Groups
UiSynchronizer.DEFAULT is initialized in time of "org.eclipse.handly" bundle activation. See org.eclipse.handly.internal.Activator: @Override public void start(BundleContext context) throws Exception { super.start(context); Bundle b = Platform.getBundle("org.eclipse.ui"); //$NON-NLS-1$ if (b != null && b.getState() == Bundle.ACTIVE && PlatformUI.isWorkbenchRunning()) { UiSynchronizer.DEFAULT = new DisplaySynchronizer( PlatformUI.getWorkbench().getDisplay()); } } There may be situation when org.eclipse.handly is activated before org.eclipse.ui, or workbench not started yet. Therefore UiSynchronizer.DEFAULT stays uninitialized. Correct initialization of this static field is not an easy task I think, so what if remove this field and create new DisplaySynchronizer each time it is needed?
Thanks George for pointing it out. The bug has been lurking for quite some time. Your suggestion sounds reasonable, but UiSynchronizer is an API, so it would be a breaking change. I'm setting the target to 0.6 then.
Vladimir, OK. 0.6 is not a problem, I am using workaround that fits my needs now
New Gerrit change created: https://git.eclipse.org/r/76814
Gerrit change https://git.eclipse.org/r/76814 was merged to [master]. Commit: http://git.eclipse.org/c/handly/org.eclipse.handly.git/commit/?id=9c4172bac8b5b3c43200f95c73b0e1782d432f7e
Breaking changes in UiSynchronizer: * public static UiSynchronizer DEFAULT -> public static UiSynchronizer getDefault() * synchExec(Runnable) may now throw a checked java.util.concurrent.ExecutionException * getThread(), asyncExec(Runnable), and syncExec(Runnable) may now throw IllegalStateException