From 38cb52b5a706d2fd55acfc2be315ce1f7c1b0f8f Mon Sep 17 00:00:00 2001 From: David McKnight Date: Wed, 5 Sep 2012 15:46:11 +0000 Subject: [PATCH] [374681] Incorrect number of children on the properties page of a directory --- .../files/ui/view/SystemViewRemoteFileAdapter.java | 5 +++-- .../files/core/subsystems/RemoteFileSubSystem.java | 7 +++++-- .../UI/org/eclipse/rse/internal/ui/view/SystemView.java | 8 ++++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java index 532d3fed5f2..b263a8d067b 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java @@ -78,6 +78,7 @@ * David McKnight (IBM) - [363490] PHP files opening in system editor (Dreamweaver) * Rick Sawyer (IBM) - [376535] RSE does not respect editor overrides * David McKnight (IBM) - [389838] Fast folder transfer does not account for code page + * David Mcknight (IBM) - [374681] Incorrect number of children on the properties page of a directory *******************************************************************************/ package org.eclipse.rse.internal.files.ui.view; @@ -755,7 +756,7 @@ public class SystemViewRemoteFileAdapter IRemoteFile originalFile = file; if (ss instanceof RemoteFileSubSystem){ IRemoteFile cachedFile = ((RemoteFileSubSystem)ss).getCachedRemoteFile(file.getAbsolutePath()); - if (cachedFile != null){ + if (cachedFile != null && cachedFile != originalFile){ file = cachedFile; if (originalFile.isStale()){ // the original file was marked stale, so the cached one should be too file.markStale(true); @@ -986,7 +987,7 @@ public class SystemViewRemoteFileAdapter IRemoteFile originalFile = file; if (ss instanceof RemoteFileSubSystem){ IRemoteFile cachedFile = ((RemoteFileSubSystem)ss).getCachedRemoteFile(file.getAbsolutePath()); - if (cachedFile != null){ + if (cachedFile != null && cachedFile != originalFile){ file = cachedFile; if (originalFile.isStale()){ // the original file was marked stale, so the cached one should be too file.markStale(true); diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java index 0a01fb0aa41..8ae641624a1 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java @@ -31,6 +31,7 @@ * David McKnight (IBM) - [272882] [api] Handle exceptions in IService.initService() * David McKnight (IBM) - [368454] provide thread safety for cachedRemoteFiles hashmap * David McKnight (IBM) - [362440] File opened using remote system connection (SSH - Sftp) at some point save action was not saving it to the file system. + * David Mcknight (IBM) - [374681] Incorrect number of children on the properties page of a directory *******************************************************************************/ package org.eclipse.rse.subsystems.files.core.subsystems; @@ -1096,8 +1097,10 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi // if not, the key must be for a file if (key.lastIndexOf(IHostSearchResult.SEARCH_RESULT_DELIMITER) < 0) { - IRemoteFile remoteFile = getRemoteFileObject(key, monitor); - + IRemoteFile remoteFile = getCachedRemoteFile(key); // first check for cached file + if (remoteFile == null){ // not cached, do query + remoteFile = getRemoteFileObject(key, monitor); + } if (remoteFile != null) { return remoteFile; } diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemView.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemView.java index 25eb5e33577..91b5625387a 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemView.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemView.java @@ -85,6 +85,7 @@ * David McKnight (IBM) - [380613] Problem in SystemView with disposed TreeItem when Link With Editor toolbar icon is used * David McKnight (IBM) - [385774] select folder dialog doesn't update enablement properly after new folder created * David McKnight (IBM) - [388364] RDz property view flickers when a user disconnects from zOS system + * David Mcknight (IBM) - [374681] Incorrect number of children on the properties page of a directory ********************************************************************************/ package org.eclipse.rse.internal.ui.view; @@ -3405,9 +3406,12 @@ public class SystemView extends SafeTreeViewer String newText = adapter.getText(element); if (oldText == null || !oldText.equals(newText)) { - //if (newText != null){ + if (newText != null){ item.setText(newText); - //} + } + else { + SystemBasePlugin.logInfo("SystemView.doUpdateItem() - text for " + element + " is null!"); //$NON-NLS-1$//$NON-NLS-2$ + } } }