Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 316189

Summary: NullPointer exception while disconnecting a non valid remote connection
Product: [Tools] PTP Reporter: Greg Watson <g.watson>
Component: Remote ToolsAssignee: Greg Watson <g.watson>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: egeay
Version: 3.0.1   
Target Milestone: 3.0.2   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

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