| author | Corey J Ashford | 2012-05-15 12:23:43 (EDT) |
|---|---|---|
| committer | Jeff Johnston | 2012-05-15 12:26:38 (EDT) |
| commit | 2c238cc92a617cec7f9c7169990c668827f1645b (patch) (side-by-side diff) | |
| tree | 7ed432186102a7df26dcff3517f638c83f343ecd | |
| parent | 6271232a6652dffc28792c3437e14e701ff78cd8 (diff) | |
| download | org.eclipse.linuxtools-2c238cc92a617cec7f9c7169990c668827f1645b.zip org.eclipse.linuxtools-2c238cc92a617cec7f9c7169990c668827f1645b.tar.gz org.eclipse.linuxtools-2c238cc92a617cec7f9c7169990c668827f1645b.tar.bz2 | |
Fix https://bugs.eclipse.org/bugs/show_bug.cgi?id=369765
- Apply patch from bug
- Modify patch to use NLS and refer to current plug-in id
- Adds exception handling when remote connection cannot be made
2 files changed, 15 insertions, 6 deletions
diff --git a/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTFileProxy.java b/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTFileProxy.java index 093b3f1..090a996 100644 --- a/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTFileProxy.java +++ b/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTFileProxy.java @@ -4,8 +4,12 @@ import java.net.URI; import org.eclipse.core.filesystem.IFileStore; import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.linuxtools.profiling.launch.IRemoteFileProxy; +import org.eclipse.linuxtools.rdt.proxy.Activator; import org.eclipse.ptp.remote.core.IRemoteConnection; import org.eclipse.ptp.remote.core.IRemoteFileManager; import org.eclipse.ptp.remote.core.IRemoteServices; @@ -15,18 +19,22 @@ public class RDTFileProxy implements IRemoteFileProxy { private IRemoteFileManager manager; - private void initialize(URI uri) { + private void initialize(URI uri) throws CoreException { IRemoteServices services = PTPRemoteCorePlugin.getDefault().getRemoteServices(uri); services.initialize(); IRemoteConnection connection = services.getConnectionManager().getConnection(uri); - manager = services.getFileManager(connection); + if (connection != null) + manager = services.getFileManager(connection); + else + throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, + Activator.getResourceString("Connection.error"))); //$NON-NLS-1$ } - public RDTFileProxy(URI uri) { + public RDTFileProxy(URI uri) throws CoreException { initialize(uri); } - public RDTFileProxy(IProject project) { + public RDTFileProxy(IProject project) throws CoreException { URI uri = project.getLocationURI(); initialize(uri); } diff --git a/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/rdt/proxy/Resources.properties b/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/rdt/proxy/Resources.properties index dd85f8f..fd5eee9 100644 --- a/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/rdt/proxy/Resources.properties +++ b/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/rdt/proxy/Resources.properties @@ -1,5 +1,5 @@ #******************************************************************************* -# Copyright (c) 2011 Red Hat Inc.. +# Copyright (c) 2012 Red Hat Inc.. # 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 @@ -8,4 +8,5 @@ # Contributors: # Red Hat Incorporated - initial API and implementation #*******************************************************************************/ -CommandLauncher.error.commandCanceled=Command canceled
\ No newline at end of file +CommandLauncher.error.commandCanceled=Command canceled +Connection.error=Unable to open connection
\ No newline at end of file |

