Project: JDT
Bug 12683 Invalid Thread Access self hosting using Java Search
Reported: 2002-04-03 09:10:25 | Status: resolved fixed

The Java Search causes an Invalid Thread Access when you are self hosting. This will also occur if you use search in a JUnit test or if I run Eclipse using the following options: eclipse -ws win32 -debug -dev bin The problem is a call to Display.getCurrent() in the initialization code for the JavaEditorPreferencePage which is called the first time you do a search. STEPS 1) Self host Eclipse 2) Select Java Search 3) Enter the name of a class 4) Hit Search - Invalid Thread Access Log: Wed Apr 03 08:57:31 EST 2002 4 org.eclipse.jdt.ui 1 Internal Error java.lang.reflect.InvocationTargetException: org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:1887) at org.eclipse.swt.SWT.error(SWT.java:1819) at org.eclipse.swt.widgets.Display.checkDevice(Display.java(Compiled Code)) at org.eclipse.swt.widgets.Display.checkDevice(Display.java(Compiled Code)) at org.eclipse.swt.widgets.Display.getSystemColor(Display.java:965) at org.eclipse.jdt.internal.ui.preferences.JavaEditorPreferencePage.initDefaults (JavaEditorPreferencePage.java:209) at org.eclipse.jdt.internal.ui.JavaPlugin.initializeDefaultPreferences (JavaPlugin.java:320) at org.eclipse.ui.plugin.AbstractUIPlugin.getPreferenceStore (AbstractUIPlugin.java(Compiled Code)) at org.eclipse.jdt.internal.ui.preferences.AppearancePreferencePage.showMethodRetur nType(AppearancePreferencePage.java:40) at org.eclipse.jdt.internal.ui.viewsupport.StandardJavaUILabelProvider.initMasks (StandardJavaUILabelProvider.java:43) at org.eclipse.jdt.internal.ui.viewsupport.StandardJavaUILabelProvider.<init> (StandardJavaUILabelProvider.java:29) at org.eclipse.jdt.internal.ui.search.JavaSearchResultLabelProvider.<init> (JavaSearchResultLabelProvider.java:39) at org.eclipse.jdt.internal.ui.search.JavaSearchResultCollector.aboutToStart (JavaSearchResultCollector.java:104) at org.eclipse.jdt.core.search.SearchEngine.search (SearchEngine.java:376) at org.eclipse.jdt.internal.ui.search.JavaSearchOperation.execute (JavaSearchOperation.java:84) at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run (WorkspaceModifyOperation.java:64) at org.eclipse.core.internal.resources.Workspace.run (Workspace.java:1343) at org.eclipse.ui.actions.WorkspaceModifyOperation.run (WorkspaceModifyOperation.java:78) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run (ModalContext.java:98)

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorPreferencePage.java