Bug 231959 - [telnet] NPE in TelnetConnector.java
Summary: [telnet] NPE in TelnetConnector.java
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: Terminal (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 3.0 RC1   Edit
Assignee: Martin Oberhuber CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-05-13 18:20 EDT by Sean Adams CLA
Modified: 2011-05-25 07:43 EDT (History)
3 users (show)

See Also:


Attachments
Patch to fix telnet connections (898 bytes, patch)
2008-05-13 18:20 EDT, Sean Adams CLA
mober.at+eclipse: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Adams CLA 2008-05-13 18:20:04 EDT
Created attachment 100070 [details]
Patch to fix telnet connections

TelnetConnector.java hides the protected ITerminalControl fControl field from the super class (TerminalConnectorImpl).
Since the fControl field in TelnetConnector is never set, it remains NULL.
When the getRemoteToTerminalOutputStream(), displayTextInTerminal(), or setState() methods are called an NPE is thrown.

The effect is that a telnet connection can be opened but there is apparently no output from the host.

This happens on Windows XP and Linux/GTK.  It presumably happens on all platforms.

A simple, one-line fix is attached.
Comment 1 Martin Oberhuber CLA 2008-05-19 04:43:12 EDT
Thanks for the patch, will consider for 3.0
Comment 2 Martin Oberhuber CLA 2008-05-19 17:59:28 EDT
That's a funny patch, contribution is exactly -1 lines of code. I'm wondering whether one can license a contribution that solely consists of removing stuff under the EPL? Removing the line of code is a creative act, so I'd certainly like adding you to the list of our contributors...
Comment 3 Sean Adams CLA 2008-05-20 00:04:14 EDT
(In reply to comment #2)
> That's a funny patch, contribution is exactly -1 lines of code. I'm wondering
> whether one can license a contribution that solely consists of removing stuff
> under the EPL? Removing the line of code is a creative act, so I'd certainly
> like adding you to the list of our contributors...
> 

Uh, OK -- seems kind of unnecessary, but I understand the legal need to name all contributors.  What do I have to do to be added as a contributor?
Comment 4 Martin Oberhuber CLA 2008-05-20 14:52:04 EDT
I just applied the patch since this is really an obvious one. Thanks for the contribution, you are now an official TM contributor!

http://www.eclipse.org/dsdp/tm/development/contributors.php
Comment 5 Martin Oberhuber CLA 2008-05-26 05:30:32 EDT
For reference and easier finding the issue, here's the Exception that's printed to the Error Log and also stdout:

java.lang.NullPointerException
        at org.eclipse.tm.internal.terminal.telnet.TelnetConnector.getRemoteToTerminalOutputStream(TelnetConnector.java:136)
        at org.eclipse.tm.internal.terminal.telnet.TelnetConnection.run(TelnetConnection.java:322)