diff options
author | William Chen | 2012-05-04 03:01:59 +0000 |
---|---|---|
committer | William Chen | 2012-05-04 03:01:59 +0000 |
commit | 808297f4d37f5fd8c82ee287363dc7c5d131feab (patch) | |
tree | 4790711b86c66e194d04dbba94f394350443aead /target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf | |
parent | 922c4fe3a58223328bd56cd85c36b7ab95065648 (diff) | |
download | org.eclipse.tcf-808297f4d37f5fd8c82ee287363dc7c5d131feab.tar.gz org.eclipse.tcf-808297f4d37f5fd8c82ee287363dc7c5d131feab.tar.xz org.eclipse.tcf-808297f4d37f5fd8c82ee287363dc7c5d131feab.zip |
Target Explorer: Fix an issue that OpUser swallows an exception that
should not be ignored.
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf')
-rw-r--r-- | target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpUser.java | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpUser.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpUser.java index ded84d1d5..1e8e408b9 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpUser.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpUser.java @@ -13,8 +13,6 @@ import java.lang.reflect.InvocationTargetException; import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.osgi.util.NLS;
import org.eclipse.tcf.protocol.IChannel;
import org.eclipse.tcf.protocol.IToken;
@@ -25,6 +23,7 @@ import org.eclipse.tcf.services.IFileSystem.FileSystemException; import org.eclipse.tcf.te.tcf.core.Tcf;
import org.eclipse.tcf.te.tcf.filesystem.core.activator.CorePlugin;
import org.eclipse.tcf.te.tcf.filesystem.core.internal.UserAccount;
+import org.eclipse.tcf.te.tcf.filesystem.core.internal.exceptions.TCFException;
import org.eclipse.tcf.te.tcf.filesystem.core.internal.exceptions.TCFFileSystemException;
import org.eclipse.tcf.te.tcf.filesystem.core.nls.Messages;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
@@ -68,25 +67,20 @@ public class OpUser extends Operation { result = getUserFromPeer(peerNode);
if (result == null) {
final UserAccount[] accounts = new UserAccount[1];
- SafeRunner.run(new ISafeRunnable(){
- @Override
- public void handleException(Throwable e) {
- // Just ignore it.
- }
- @Override
- public void run() throws Exception {
- IChannel channel = null;
- try {
- channel = Operation.openChannel(peerNode.getPeer());
- if (channel != null) {
- accounts[0] = getUserByChannel(channel);
- if (accounts[0] != null) setUserToPeer(peerNode, accounts[0]);
- }
- }
- finally {
- if (channel != null) Tcf.getChannelManager().closeChannel(channel);
- }
- }});
+ IChannel channel = null;
+ try {
+ channel = Operation.openChannel(peerNode.getPeer());
+ if (channel != null) {
+ accounts[0] = getUserByChannel(channel);
+ if (accounts[0] != null) setUserToPeer(peerNode, accounts[0]);
+ }
+ }
+ catch (TCFException e) {
+ throw new InvocationTargetException(e);
+ }
+ finally {
+ if (channel != null) Tcf.getChannelManager().closeChannel(channel);
+ }
result = accounts[0];
}
}
|