Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 30510

Summary: UI is being called from another thread.
Product: [Eclipse Project] Platform Reporter: Eduardo Pereira <eduardo_pereira>
Component: SearchAssignee: Platform-Search-Inbox <platform-search-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: jeffmcaffer
Version: 2.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Eduardo Pereira CLA 2003-01-29 10:24:33 EST
From: John Duimovich

If the search view has been instantiated, then it works. I.E If I do a file 
search first and then a smalltalk search it works. 
If I reset perspective and just do a smalltalk search, then it fails

Thanks,

--------------------------------
Stack trace:
   java/lang/Throwable.<init>()V
   java/lang/Throwable.<init>(Ljava/lang/String;)V
   java/lang/Exception.<init>(Ljava/lang/String;)V
   java/lang/RuntimeException.<init>(Ljava/lang/String;)V
   org/eclipse/swt/SWTException.<init>(ILjava/lang/String;)V
   org/eclipse/swt/SWTException.<init>(I)V
   org/eclipse/swt/SWT.error(ILjava/lang/Throwable;)V
   org/eclipse/swt/SWT.error(I)V
   org/eclipse/swt/widgets/Display.error(I)V
   org/eclipse/swt/widgets/Display.checkDevice()V
   org/eclipse/swt/widgets/Display.getShells()[Lorg/eclipse/swt/widgets/Shell;
   org/eclipse/swt/custom/BusyIndicator.showWhile
(Lorg/eclipse/swt/widgets/Displ
ay;Ljava/lang/Runnable;)V
   org/eclipse/ui/internal/ViewFactory.restoreView
(Lorg/eclipse/ui/IViewReferenc
e;)Lorg/eclipse/core/runtime/IStatus;
   org/eclipse/ui/internal/ViewFactory$ViewReference.getPart(Z)
Lorg/eclipse/ui/I
WorkbenchPart;
   org/eclipse/ui/internal/ViewFactory$ViewReference.getView(Z)
Lorg/eclipse/ui/I
ViewPart;
   org/eclipse/ui/internal/WorkbenchPage.findView(Ljava/lang/String;)
Lorg/eclips
e/ui/IViewPart;
   org/eclipse/search/internal/ui/SearchPlugin.getSearchResultView()
Lorg/eclipse
/search/ui/ISearchResultView;
   org/eclipse/search/ui/SearchUI.getSearchResultView()
Lorg/eclipse/search/ui/IS
earchResultView;
   org/eclipse/stdt/ui/search/SmalltalkSearchResultCollector.aboutToStart()V
   org/eclipse/stdt/ui/search/SmalltalkSearchEngine.search
(Lorg/eclipse/core/res
ources/IWorkspace;Ljava/lang/String;IILorg/eclipse/stdt/search/ISmalltalkSearch
R
esultCollector;)V
   org/eclipse/stdt/ui/search/SmalltalkSearchOperation.execute
(Lorg/eclipse/core
/runtime/IProgressMonitor;)V
   org/eclipse/ui/actions/WorkspaceModifyOperation$1.run
(Lorg/eclipse/core/runti
me/IProgressMonitor;)V
   org/eclipse/core/internal/resources/Workspace.run
(Lorg/eclipse/core/resources
/IWorkspaceRunnable;Lorg/eclipse/core/runtime/IProgressMonitor;)V
   org/eclipse/ui/actions/WorkspaceModifyOperation.run
(Lorg/eclipse/core/runtime
/IProgressMonitor;)V
   org/eclipse/jface/operation/ModalContext$ModalContextThread.run()V
Comment 1 Eduardo Pereira CLA 2003-01-29 10:28:31 EST
The problem is that the workbench UI is being called from another thread. 
Unless stated otherwise, the UI framework should not be called from another 
thread. This is a change in the UI (2.1 stream) that exposed this bug. Not 
sure if this is a bug in the search or in SDT.
Comment 2 Dani Megert CLA 2003-01-30 07:57:16 EST
Tested against build I20030129
I get a NPE as expected.

Please reopen if you see this in I20030129 or later and add steps to reproduce.

Regarding your comments: API for IViewPart.findView is:
/**
 * Returns the view in this page with the specified id.  There is at most one
 * view in the page with the specified id.
 *
 * @param viewId the id of the view extension to use
 * @return the view, or <code>null</code> if none is found
 */
public IViewPart findView(String viewId);

Therefore as a client I expect either a result or null - everything else is not
ok. If Platform UI expects this to be called in a specific thread then this has
to be specified and a corresponding exception should be thrown - like SWT does.
Comment 3 Jeff McAffer CLA 2003-02-10 22:08:24 EST
*** Bug 31511 has been marked as a duplicate of this bug. ***