mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-21 07:05:58 +02:00
[293914] [dstore] NPE is thrown during the remote search
This commit is contained in:
parent
b6362c1046
commit
26182b2060
2 changed files with 22 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2006, 2009 IBM Corporation and others.
|
* Copyright (c) 2006, 2010 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -21,6 +21,7 @@
|
||||||
* David McKnight (IBM) - [255390] don't assume one update means the search is done
|
* David McKnight (IBM) - [255390] don't assume one update means the search is done
|
||||||
* David McKnight (IBM) - [261644] [dstore] remote search improvements
|
* David McKnight (IBM) - [261644] [dstore] remote search improvements
|
||||||
* David McKnight (IBM) - [243495] [api] New: Allow file name search in Remote Search to not be case sensitive
|
* David McKnight (IBM) - [243495] [api] New: Allow file name search in Remote Search to not be case sensitive
|
||||||
|
* David McKnight (IBM) - [293914] [dstore] NPE is thrown during the remote search
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.services.dstore.search;
|
package org.eclipse.rse.internal.services.dstore.search;
|
||||||
|
@ -135,6 +136,8 @@ public class DStoreSearchService extends AbstractDStoreService implements ISearc
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
config.setStatus(IHostSearchConstants.CANCELLED);
|
config.setStatus(IHostSearchConstants.CANCELLED);
|
||||||
|
if (monitor != null)
|
||||||
|
monitor.setCanceled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved.
|
* Copyright (c) 2006, 2010 IBM Corporation and others. All rights reserved.
|
||||||
* This program and the accompanying materials are made available under the terms
|
* This program and the accompanying materials are made available under the terms
|
||||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
@ -12,6 +12,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
|
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
|
||||||
|
* David McKnight (IBM) - [293914] [dstore] NPE is thrown during the remote search
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.subsystems.files.core.servicesubsystem;
|
package org.eclipse.rse.subsystems.files.core.servicesubsystem;
|
||||||
|
@ -20,6 +21,10 @@ import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
import org.eclipse.core.runtime.jobs.Job;
|
import org.eclipse.core.runtime.jobs.Job;
|
||||||
|
import org.eclipse.rse.core.RSECorePlugin;
|
||||||
|
import org.eclipse.rse.core.events.ISystemResourceChangeEvents;
|
||||||
|
import org.eclipse.rse.core.events.SystemResourceChangeEvent;
|
||||||
|
import org.eclipse.rse.core.model.ISystemRegistry;
|
||||||
import org.eclipse.rse.internal.subsystems.files.core.SystemFileResources;
|
import org.eclipse.rse.internal.subsystems.files.core.SystemFileResources;
|
||||||
import org.eclipse.rse.services.files.IFileService;
|
import org.eclipse.rse.services.files.IFileService;
|
||||||
import org.eclipse.rse.services.search.IHostSearchResultConfiguration;
|
import org.eclipse.rse.services.search.IHostSearchResultConfiguration;
|
||||||
|
@ -44,9 +49,18 @@ public class SearchJob extends Job
|
||||||
protected IStatus run(IProgressMonitor monitor)
|
protected IStatus run(IProgressMonitor monitor)
|
||||||
{
|
{
|
||||||
_searchService.search(_searchConfig, _fileService, monitor);
|
_searchService.search(_searchConfig, _fileService, monitor);
|
||||||
|
if (!monitor.isCanceled()){
|
||||||
OutputRefresh refresh = new OutputRefresh(_searchConfig);
|
OutputRefresh refresh = new OutputRefresh(_searchConfig);
|
||||||
Display.getDefault().asyncExec(refresh);
|
Display.getDefault().asyncExec(refresh);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Display.getDefault().asyncExec(new Runnable(){
|
||||||
|
public void run(){
|
||||||
|
ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
|
||||||
|
registry.fireEvent(new SystemResourceChangeEvent(_searchConfig, ISystemResourceChangeEvents.EVENT_SEARCH_FINISHED, null));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
monitor.done();
|
monitor.done();
|
||||||
return Status.OK_STATUS;
|
return Status.OK_STATUS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue