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

Bug 485658

Summary: NPE prevents displaying the actual error of problematic connections
Product: [Tools] Target Management Reporter: Kaloyan Raev <kaloyan>
Component: TerminalAssignee: dsdp.tm.core-inbox <tm.core-inbox>
Status: RESOLVED FIXED QA Contact: Martin Oberhuber <mober.at+eclipse>
Severity: normal    
Priority: P3 CC: eclipse, wywrzal
Version: 4.0   
Target Milestone: 4.1   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/64131
https://git.eclipse.org/c/tm/org.eclipse.tm.terminal.git/commit/?id=916992ab3d21ba294bfc8180c40e2b40d86cd511
Whiteboard:

Description Kaloyan Raev CLA 2016-01-12 09:17:41 EST
We use the Terminal control in our adopter product and we faced a NullPointerException that prevents displaying the actual error that broke the connection process:

java.lang.NullPointerException
	at org.eclipse.tm.terminal.connector.process.ProcessConnector.doDisconnect(ProcessConnector.java:244)
	at org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl.disconnect(TerminalConnectorImpl.java:71)
	at org.eclipse.tm.terminal.connector.process.ProcessConnector.connect(ProcessConnector.java:206)
	at org.eclipse.tm.internal.terminal.connector.TerminalConnector.connect(TerminalConnector.java:159)
	at org.eclipse.tm.internal.terminal.emulator.VT100TerminalControl.connectTerminal(VT100TerminalControl.java:412)
...

The reason for the NPE is that the doDisconnect() method assumes that the monitor member is non-null, which may not be the case if the connection could not be established due to an error.
Comment 1 Eclipse Genie CLA 2016-01-12 09:20:22 EST
New Gerrit change created: https://git.eclipse.org/r/64131
Comment 2 Martin Oberhuber CLA 2016-01-12 12:22:24 EST
Merged to master - thanks for the contribution !
Comment 4 Anton Leherbauer CLA 2016-01-19 08:48:18 EST
*** Bug 485923 has been marked as a duplicate of this bug. ***