From c13dc278b9e34d7d41ff0c92ac08ce03439f885f Mon Sep 17 00:00:00 2001 From: David Dykstal Date: Fri, 4 Apr 2008 14:03:18 +0000 Subject: [PATCH] [225089][ssh][shells][api] Canceling connection leads to exception https://bugs.eclipse.org/bugs/show_bug.cgi?id=225089 --- .../rse/core/subsystems/AbstractConnectorService.java | 7 ++----- .../core/subsystems/AuthenticatingConnectorService.java | 5 +---- .../eclipse/rse/core/subsystems/IConnectorService.java | 9 +++++---- .../rse/core/subsystems/ICredentialsProvider.java | 2 ++ .../rse/ui/subsystems/StandardCredentialsProvider.java | 3 ++- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/AbstractConnectorService.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/AbstractConnectorService.java index 17b27b1a1ab..de1c686e84c 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/AbstractConnectorService.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/AbstractConnectorService.java @@ -404,11 +404,8 @@ public abstract class AbstractConnectorService extends RSEModelObject implements return getPort(); } - /** - * Connects to the target system. - * Calls {@link #internalConnect(IProgressMonitor)} - * @param monitor a monitor for progress monitoring and cancelation. - * @throws Exception if the connect fails + /* (non-Javadoc) + * @see org.eclipse.rse.core.subsystems.IConnectorService#connect(org.eclipse.core.runtime.IProgressMonitor) */ public final void connect(IProgressMonitor monitor) throws Exception { preConnect(); diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/AuthenticatingConnectorService.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/AuthenticatingConnectorService.java index 3e37951bc7f..7854de65ac9 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/AuthenticatingConnectorService.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/AuthenticatingConnectorService.java @@ -181,10 +181,7 @@ public abstract class AuthenticatingConnectorService extends AbstractConnectorSe credentialsProvider.setSuppressed(suppressed); } - /** - * Acquires the credentials by delegating the request to the - * credentials provider. - * @param reacquire if true will cause the credentials to be reobtained if necessary. + /* (non-Javadoc) * @see org.eclipse.rse.core.subsystems.IConnectorService#acquireCredentials(boolean) */ public final void acquireCredentials(boolean reacquire) throws OperationCanceledException { diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IConnectorService.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IConnectorService.java index 6acfa22c2bb..d10071c55b0 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IConnectorService.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IConnectorService.java @@ -90,7 +90,7 @@ public interface IConnectorService extends IRSEModelObject { * operation. * @throws Exception an exception of there is a failure to connect. * Typically, this will be a {@link SystemMessageException}. - * If the connect was canceled by the user this will be an {@link OperationCanceledException} + * @since 3.0 throws an {@link OperationCanceledException} if the connect was canceled by the user */ public void connect(IProgressMonitor monitor) throws Exception; @@ -275,12 +275,13 @@ public interface IConnectorService extends IRSEModelObject { * by using the {@link #setSuppressed(boolean)}. *

* Implementations may retain a remembered credentials or - * use this acquire the credentials using some implementation defined means. + * use this to acquire the credentials using some implementation defined means. *

* Throws {@link OperationCanceledException} if acquisition of the * credentials is canceled or is being suppressed. * @param refresh if true will force the connector service to discard * any remembered value and reacquire the credentials. + * @since 3.0 throws OperationCanceledException instead of InterruptedException */ public void acquireCredentials(boolean refresh) throws OperationCanceledException; @@ -398,7 +399,7 @@ public interface IConnectorService extends IRSEModelObject { * If false, allow passwords to be saved in the keychain. * @return the number of saved passwords removed by this operation. * This will always be zero if "deny" is false. - * @since org.eclipse.rse.core 3.0 + * @since 3.0 org.eclipse.rse.core */ public int setDenyPasswordSave(boolean deny); @@ -406,7 +407,7 @@ public interface IConnectorService extends IRSEModelObject { * Retrieves the value of the "DENY_PASSWORD_SAVE" property of this connector service. * If the value has never been set, this will return false. * @return true if password saving is denied. - * @since org.eclipse.rse.core 3.0 + * @since 3.0 org.eclipse.rse.core */ public boolean getDenyPasswordSave(); diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ICredentialsProvider.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ICredentialsProvider.java index ebe8e0ffba3..f067adcd94c 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ICredentialsProvider.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ICredentialsProvider.java @@ -43,6 +43,7 @@ public interface ICredentialsProvider { * canceled by the user, if the provider is in suppressed state, * a resource (such as the workbench) not being available, * or interrupted by some other means. + * @since 3.0 throws OperationCanceledException instead of InterruptedException */ void acquireCredentials(boolean reacquire) throws OperationCanceledException; @@ -56,6 +57,7 @@ public interface ICredentialsProvider { * @throws OperationCanceledException if the repair is canceled for some reason. This could * include the inability of a credentials provider to open a dialog or a dialog being * canceled. + * @since 3.0 throws OperationCanceledException instead of InterruptedException */ void repairCredentials(SystemMessage message)throws OperationCanceledException; diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/ui/subsystems/StandardCredentialsProvider.java b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/ui/subsystems/StandardCredentialsProvider.java index 6ebeb995729..830b2603f72 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/ui/subsystems/StandardCredentialsProvider.java +++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/ui/subsystems/StandardCredentialsProvider.java @@ -157,7 +157,7 @@ public class StandardCredentialsProvider extends AbstractCredentialsProvider { } /** - * Do not override. + * @noimplement * Acquires the credentials (userid and password) for this connector service. * The search order for the password is as follows:

*
    @@ -172,6 +172,7 @@ public class StandardCredentialsProvider extends AbstractCredentialsProvider { * if the password was found and is valid. * @throws OperationCanceledException if user is prompted and user * cancels that prompt or if {@link #isSuppressed()} is true. + * @since 3.0 throws {@link OperationCanceledException} rather than {@link InterruptedException} */ public final void acquireCredentials(boolean reacquire) throws OperationCanceledException { if (isSuppressed()) {