Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316189 - NullPointer exception while disconnecting a non valid remote connection
Summary: NullPointer exception while disconnecting a non valid remote connection
Status: RESOLVED FIXED
Alias: None
Product: PTP
Classification: Tools
Component: Remote Tools (show other bugs)
Version: 3.0.1   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 major (vote)
Target Milestone: 3.0.2   Edit
Assignee: Greg Watson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-08 14:52 EDT by Greg Watson CLA
Modified: 2010-06-14 11:50 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Watson CLA 2010-06-08 14:52:19 EDT
Cloned from: 314498: NullPointer exception while disconnecting a non valid remote connection
https://bugs.eclipse.org/bugs/show_bug.cgi?id=314498

1) Call org.eclipse.ptp.remotetools.internal.ssh.Connection.connect method.
2) If connection to remote host failed, then a call to disconnect will occur.
                try {
			defaultSession.connect(timeout);
		} catch (JSchException e) {
			disconnect();
			throw new RemoteConnectionException(
					Messages.Connection_Connect_FailedConnect, e);
		} catch (Exception e) {
			disconnect();
			throw new RemoteConnectionException(
					Messages.Connection_Connect_FailedUnsupportedKeySize, e);
		}
3) Line with "while (!sftpChannelPool.isEmpty())" will create a NPE, since the collection is initialized after in the control flow of "connect" method.
Comment 1 Greg Watson CLA 2010-06-14 11:35:48 EDT
Fixed in ptp 3.0. Please test.
Comment 2 Emmanuel Geay CLA 2010-06-14 11:45:55 EDT
Fixed. Thanks.
Comment 3 Greg Watson CLA 2010-06-14 11:50:10 EDT
Closing