1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-18 14:35:23 +02:00

[370007] potential NPEs in table-tree provider and remote resource dialog

This commit is contained in:
David McKnight 2012-01-27 20:53:00 +00:00
parent af857b3c7f
commit 3850b5a12d
2 changed files with 14 additions and 9 deletions

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2011 IBM Corporation and others. All rights reserved. * Copyright (c) 2002, 2012 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
@ -13,6 +13,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) - [362700] SystemTableTreeViewProvider should not use context object in adapter call to get subsystem * David McKnight (IBM) - [362700] SystemTableTreeViewProvider should not use context object in adapter call to get subsystem
* David McKnight (IBM) - [370007] potential NPEs in table-tree provider and remote resource dialog
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.ui.view; package org.eclipse.rse.internal.ui.view;
@ -199,13 +200,12 @@ public class SystemTableTreeViewProvider implements ILabelProvider, ITableLabelP
{ {
element = ((IContextObject)object).getModelObject(); element = ((IContextObject)object).getModelObject();
} }
{
ISystemViewElementAdapter adapter = getAdapterFor(element); ISystemViewElementAdapter adapter = getAdapterFor(element);
if (adapter != null)
{
adapter.setViewer(_viewer); adapter.setViewer(_viewer);
if (adapter.hasChildren((IAdaptable)element)) if (adapter.hasChildren((IAdaptable)element))
{ {
if (supportsDeferredQueries()) if (supportsDeferredQueries())

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006, 2009 IBM Corporation and others. * Copyright (c) 2006, 2012 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
@ -18,6 +18,7 @@
* Xuan Chen (IBM) - [220999] [api] Need to change class SystemSelectRemoteFileAction to use SystemRemoteFileDialog * Xuan Chen (IBM) - [220999] [api] Need to change class SystemSelectRemoteFileAction to use SystemRemoteFileDialog
* David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types * David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types
* David McKnight (IBM) - [267061] resource dialog/form to allow custom host combo label * David McKnight (IBM) - [267061] resource dialog/form to allow custom host combo label
* David McKnight (IBM) - [370007] potential NPEs in table-tree provider and remote resource dialog
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.ui.dialogs; package org.eclipse.rse.ui.dialogs;
@ -64,7 +65,9 @@ public abstract class SystemRemoteResourceDialog extends SystemPromptDialog
{ {
_form = new SystemResourceSelectionForm(getShell(), parent, this, _inputProvider, getVerbiage(), _multipleSelectionMode, getMessageLine()); _form = new SystemResourceSelectionForm(getShell(), parent, this, _inputProvider, getVerbiage(), _multipleSelectionMode, getMessageLine());
initForm(); initForm();
if (_preSelection != null){
_form.setPreSelection(_preSelection); _form.setPreSelection(_preSelection);
}
createMessageLine(parent); createMessageLine(parent);
return _form.getInitialFocusControl(); return _form.getInitialFocusControl();
} }
@ -91,7 +94,9 @@ public abstract class SystemRemoteResourceDialog extends SystemPromptDialog
_form.applyViewerFilter(getViewerFilter()); _form.applyViewerFilter(getViewerFilter());
} }
_form.setSelectionValidator(_selectionValidator); _form.setSelectionValidator(_selectionValidator);
if (_preSelection != null){
_form.setPreSelection(_preSelection); _form.setPreSelection(_preSelection);
}
_form.setShowPropertySheet(_showPropertySheet); _form.setShowPropertySheet(_showPropertySheet);
_form.setSelectionTreeToolTipText(getTreeTip()); _form.setSelectionTreeToolTipText(getTreeTip());
if (_message != null) if (_message != null)