1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-20 22:55:51 +02:00

[293914] [dstore] NPE is thrown during the remote search

This commit is contained in:
David McKnight 2010-03-02 20:26:17 +00:00
parent b6362c1046
commit 26182b2060
2 changed files with 22 additions and 5 deletions

View file

@ -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
* are made available under the terms of the Eclipse Public License v1.0
* 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) - [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) - [293914] [dstore] NPE is thrown during the remote search
*******************************************************************************/
package org.eclipse.rse.internal.services.dstore.search;
@ -135,6 +136,8 @@ public class DStoreSearchService extends AbstractDStoreService implements ISearc
catch (Exception e)
{
config.setStatus(IHostSearchConstants.CANCELLED);
if (monitor != null)
monitor.setCanceled(true);
}
}
}

View file

@ -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
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
@ -12,6 +12,7 @@
*
* Contributors:
* 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;
@ -20,6 +21,10 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
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.services.files.IFileService;
import org.eclipse.rse.services.search.IHostSearchResultConfiguration;
@ -44,9 +49,18 @@ public class SearchJob extends Job
protected IStatus run(IProgressMonitor monitor)
{
_searchService.search(_searchConfig, _fileService, monitor);
OutputRefresh refresh = new OutputRefresh(_searchConfig);
Display.getDefault().asyncExec(refresh);
if (!monitor.isCanceled()){
OutputRefresh refresh = new OutputRefresh(_searchConfig);
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();
return Status.OK_STATUS;
}