diff --git a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/internal/dstore/universal/miners/filesystem/UniversalSearchHandler.java b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/internal/dstore/universal/miners/filesystem/UniversalSearchHandler.java index 33eadcc5f13..cc99683f32b 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/internal/dstore/universal/miners/filesystem/UniversalSearchHandler.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/internal/dstore/universal/miners/filesystem/UniversalSearchHandler.java @@ -15,6 +15,7 @@ * Michael Berger (IBM) - Bug 147791 - symbolic links can cause circular search. * David McKnight (IBM) - [190010] cancelling search * Xuan Chen (IBM) - [160775] [api] rename (at least within a zip) blocks UI thread + * David McKnight (IBM) - [214378] canonical path not required - problem is in the client *******************************************************************************/ package org.eclipse.rse.internal.dstore.universal.miners.filesystem; @@ -133,8 +134,9 @@ public class UniversalSearchHandler extends Thread implements ICancellableHandle // to status refresh. As a result client thinks // search isn't finished. // _miner.statusDone(_status); - _status.setAttribute(DE.A_NAME, "done"); //$NON-NLS-1$ + _status.setAttribute(DE.A_NAME, "done"); //$NON-NLS-1$ _dataStore.refresh(_status, true); // true indicates refresh immediately + } } @@ -171,16 +173,8 @@ public class UniversalSearchHandler extends Thread implements ICancellableHandle // is it an archive? boolean isArchive = ArchiveHandlerManager.getInstance().isArchive(theFile); - // use canonical path since sometimes we have symbolic links - String absPath = null; - try - { - absPath = theFile.getCanonicalPath(); - } - catch (Exception e) - { - absPath = theFile.getAbsolutePath(); - } + String absPath = absPath = theFile.getAbsolutePath(); + String compareStr = theFile.getName(); @@ -247,7 +241,6 @@ public class UniversalSearchHandler extends Thread implements ICancellableHandle } // otherwise, search the file else { - if (!isArchive) { deObj = _dataStore.createObject(null, _deFile, compareStr); } @@ -343,7 +336,6 @@ public class UniversalSearchHandler extends Thread implements ICancellableHandle } protected boolean internalSearchWithinFile(DataElement remoteFile, String absPath, File theFile) { - // if search string is empty, no need to look for matches within file if (_isFileSearch) { return true; diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/search/DStoreSearchResultConfiguration.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/search/DStoreSearchResultConfiguration.java index 944945789f9..0e057a2cc9d 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/search/DStoreSearchResultConfiguration.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/search/DStoreSearchResultConfiguration.java @@ -14,6 +14,7 @@ * Contributors: * {Name} (company) - description of contribution. * David McKnight (IBM) [190010] commented why we don't need status monitor + * David McKnight (IBM) - [214378] [dstore] remote search doesn't display results sometimes *******************************************************************************/ package org.eclipse.rse.internal.services.dstore.search; @@ -38,7 +39,7 @@ public abstract class DStoreSearchResultConfiguration extends AbstractSearchResu { _status = status; // no need for a domain listner because we check the status via status monitor - // _status.getDataStore().getDomainNotifier().addDomainListener(this); + _status.getDataStore().getDomainNotifier().addDomainListener(this); } public DataElement getStatusObject() diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/internal/subsystems/files/dstore/DStoreFileSubSystemSearchResultConfiguration.java b/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/internal/subsystems/files/dstore/DStoreFileSubSystemSearchResultConfiguration.java index 9b0c9daf95b..89f29fc4e9c 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/internal/subsystems/files/dstore/DStoreFileSubSystemSearchResultConfiguration.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/internal/subsystems/files/dstore/DStoreFileSubSystemSearchResultConfiguration.java @@ -17,6 +17,7 @@ * Kevin Doyle (IBM) - [190010] Added cancel() method that will call the search service to cancel * David McKnight (IBM) - [190010] performance improvement to use caching for dstore search * David McKnight (IBM) - [207178] changing list APIs for file service and subsystems + * David McKnight (IBM) - [214378] [dstore] remote search doesn't display results sometimes *******************************************************************************/ package org.eclipse.rse.internal.subsystems.files.dstore; @@ -167,8 +168,10 @@ public class DStoreFileSubSystemSearchResultConfiguration extends DStoreSearchRe if (_status.getValue().equals("done")) //$NON-NLS-1$ { setStatus(IHostSearchConstants.FINISHED); - - _status.getDataStore().getDomainNotifier().removeDomainListener(this); + // need to wait for the results though + DelayedDomainListenerRemover remover = new DelayedDomainListenerRemover(this, _status); + remover.start(); + // _status.getDataStore().getDomainNotifier().removeDomainListener(this); } else if (_status.getValue().equals("cancelled")) //$NON-NLS-1$ { @@ -186,4 +189,27 @@ public class DStoreFileSubSystemSearchResultConfiguration extends DStoreSearchRe getSearchService().cancelSearch(this, new NullProgressMonitor()); } } + + private class DelayedDomainListenerRemover extends Thread + { + private DStoreFileSubSystemSearchResultConfiguration _config; + private DataElement _status; + public DelayedDomainListenerRemover(DStoreFileSubSystemSearchResultConfiguration config, DataElement status) + { + _status = status; + _config = config; + } + + public void run() + { + try + { + sleep(1000); + } + catch (Exception e) + { + } + _status.getDataStore().getDomainNotifier().removeDomainListener(_config); + } + } }