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 edf3bf8c5cd..3bddadefb8c 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 @@ -2920,9 +2920,10 @@ public class SystemView extends SafeTreeViewer Widget match = (Widget) matches.get(idx); // a reference to this remote object if ((match instanceof TreeItem) && !((TreeItem) match).isDisposed()) { - Object data = match.getData(); - boolean wasExpanded = ((TreeItem)match).getExpanded(); - smartRefresh(new TreeItem[] { (TreeItem) match }); // refresh the remote object + TreeItem matchedItem = (TreeItem)match; + Object data = matchedItem.getData(); + boolean wasExpanded = matchedItem.getExpanded(); + smartRefresh(new TreeItem[] { matchedItem }); // refresh the remote object if (firstSelection && // for now, we just select the first binary occurrence we find (data == remoteObject)) // same binary object as given? { @@ -2934,13 +2935,10 @@ public class SystemView extends SafeTreeViewer { allowExpand = rmtAdapter.hasChildren((IAdaptable)data); } - if (match instanceof Item) + if (allowExpand && wasExpanded && !getExpanded(matchedItem)) // assume if callers wants to select kids that they want to expand parent { - if (allowExpand && wasExpanded && !getExpanded((Item)match)) // assume if callers wants to select kids that they want to expand parent - { - createChildren(match); - setExpanded((Item)match, true); - } + createChildren(matchedItem); + setExpanded(matchedItem, true); } // todo: handle cumulative selections. // STEP 4: If requested, select the kids in the newly refreshed object.