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

Bug 314498

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

Description Emmanuel Geay CLA 2010-05-26 12:11:35 EDT
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-05-26 15:09:30 EDT
Fixed in head. Should be in friday night's build. Please test.
Comment 2 Emmanuel Geay CLA 2010-05-27 09:26:26 EDT
Thank you for the fix!

The internationalized messages in such class (and also others of the project) are broken, since the class  "org.eclipse.ptp.remotetools.core.messages.Messages" has not been updated appropriately after refactoring.

The field BUNDLE_NAME should now be equals to:

BUNDLE_NAME = "org.eclipse.ptp.remotetools.core.messages.messages"; //$NON-NLS-1$

in order to find the right properties file.
Comment 3 Greg Watson CLA 2010-05-27 22:37:21 EDT
Should be fixed now. Thanks.
Comment 4 Emmanuel Geay CLA 2010-06-07 16:45:57 EDT
The fix needs to go also in PTP 3.0 branch.
Comment 5 Greg Watson CLA 2010-06-08 14:53:09 EDT
I've created another bug for this.
Comment 6 Emmanuel Geay CLA 2010-06-14 10:57:54 EDT
Can you please give the other bugzilla item you created?
I can't manage to find it. The problem is still present in PTP 3.0 branch.

Thanks.
Comment 7 Greg Watson CLA 2010-06-14 11:25:31 EDT
Bug 316189.