Project: JDT
Bug 186161 [preferences] Preferences -> Java -> Code Style -> Clean Up crashes when internal browser is not available
Reported: 2007-05-09 10:08:20 | Status: verified fixed

Build ID: I20070503-1400 Steps To Reproduce: 1. Start Eclipse without internal browser available (Linux without Mozilla installed or without MOZILLA_FIVE_PATH) 2. Navigate to Preferences -> Java -> Code Style -> Clean Up 3. See broken widgets, and press various buttons 4. Eclipse crashes with SWT error More information: As the internal browser support is optional (everything works without internal browser so far) preferences page must not use internal browser without checking and falling back to the pre-M7 behavior. Here is the error message from the log file: !ENTRY org.eclipse.ui 4 0 2007-05-09 20:38:24.656 !MESSAGE Unhandled event loop exception !STACK 0 org.eclipse.swt.SWTException: Failed to execute runnable (org.eclipse.swt.SWTError: No more handles [Unknown Mozilla path (MOZILLA_FIVE_HOME not set)]) at org.eclipse.swt.SWT.error(SWT.java:3547) at org.eclipse.swt.SWT.error(SWT.java:3465) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:126) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3297) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2975) at org.eclipse.jface.window.Window.runEventLoop(Window.java:820) at org.eclipse.jface.window.Window.open(Window.java:796) at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:65) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:545) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:402) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1101) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3320) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2972) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2365) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2329) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2204) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:497) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:436) at org.eclipse.equinox.launcher.Main.run(Main.java:1162) Caused by: org.eclipse.swt.SWTError: No more handles [Unknown Mozilla path (MOZILLA_FIVE_HOME not set)] at org.eclipse.swt.SWT.error(SWT.java:3573) at org.eclipse.swt.browser.Mozilla.create(Mozilla.java:302) at org.eclipse.swt.browser.Browser.<init>(Browser.java:109) at org.eclipse.jdt.internal.ui.preferences.cleanup.DialogBrowserConfigurationBlock.createControl(DialogBrowserConfigurationBlock.java:27) at org.eclipse.jdt.internal.ui.fix.CleanUpSaveParticipantPreferenceConfiguration.createAdvancedComposite(CleanUpSaveParticipantPreferenceConfiguration.java:159) at org.eclipse.jdt.internal.ui.fix.CleanUpSaveParticipantPreferenceConfiguration.createConfigControl(CleanUpSaveParticipantPreferenceConfiguration.java:138) at org.eclipse.jdt.internal.ui.javaeditor.saveparticipant.AbstractSaveParticipantPreferenceConfiguration.createControl(AbstractSaveParticipantPreferenceConfiguration.java:84) at org.eclipse.jdt.internal.ui.preferences.SaveParticipantConfigurationBlock.createControl(SaveParticipantConfigurationBlock.java:91) at org.eclipse.jdt.internal.ui.preferences.AbstractConfigurationBlockPreferenceAndPropertyPage.createPreferenceContent(AbstractConfigurationBlockPreferenceAndPropertyPage.jav at org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage.createContents(PropertyAndPreferencePage.java:149) at org.eclipse.jface.preference.PreferencePage.createControl(PreferencePage.java:233) at org.eclipse.jdt.internal.ui.preferences.AbstractConfigurationBlockPreferenceAndPropertyPage.createControl(AbstractConfigurationBlockPreferenceAndPropertyPage.java:60) at org.eclipse.jface.preference.PreferenceDialog.createPageControl(PreferenceDialog.java:1438) at org.eclipse.jface.preference.PreferenceDialog$13.run(PreferenceDialog.java:1195) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:850) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:193) at org.eclipse.jface.preference.PreferenceDialog.showPage(PreferenceDialog.java:1189) at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.showPage(FilteredPreferenceDialog.java:433) at org.eclipse.jface.preference.PreferenceDialog$9.selectionChanged(PreferenceDialog.java:694) at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:842) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:850) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:193) at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:840) at org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(StructuredViewer.java:1153) at org.eclipse.jface.viewers.StructuredViewer$5.widgetSelected(StructuredViewer.java:1173) at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrategy.java:250) at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.java:244) at org.eclipse.jface.util.OpenStrategy$3.run(OpenStrategy.java:418) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123) ... 33 more

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/CleanUpSaveParticipantPreferenceConfiguration.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/BulletListBlock.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/cleanup/CleanUpConfigurationBlock.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/cleanup/DialogBrowserConfigurationBlock.java