Bug 198802

Summary: Logical error in AbstractConnectorServiceManager
Product: [Tools] Target Management Reporter: Martin Oberhuber <mober.at+eclipse>
Component: RSEAssignee: David McKnight <dmcknigh>
Status: RESOLVED FIXED QA Contact: Martin Oberhuber <mober.at+eclipse>
Severity: trivial    
Priority: P3 Flags: mober.at+eclipse: review+
Version: 2.0   
Target Milestone: 2.0.1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
fix for incorrect logic none

Description Martin Oberhuber CLA 2007-08-03 08:09:46 EDT
Found by code review:

AbstractConnectorServiceManager#getConnectorService(IHost, Class) line 92
    		if (!(host instanceof DummyHost))

should be
    		if (host instanceof DummyHost)

or otherwise I really don't understand what's going on here. My understanding is, that all the hosts of type "DummyHost" and with the same name share the same connectorService, even if it's different object instances. Or what's the meaning of that code? Could it eventually even be removed?
Comment 1 David McKnight CLA 2007-09-10 11:35:07 EDT
Created attachment 77988 [details]
fix for incorrect logic

Yes, this logic is wrong.  I've attached the obvious patch.
Comment 2 David McKnight CLA 2007-09-10 11:38:15 EDT
The dummy host is used when an official host does not yet exist (i.e. in the new connection wizard).  The only way to remove this would be if we created the action host prior to completion in the new connection wizard, although I'm not sure if that would be desirable.
Comment 3 Martin Oberhuber CLA 2007-09-11 07:39:54 EDT
Patch looks good.
When I understand comment #2 right, the dummy host would never be connected because it's only used while the host description is not yet complete. That's good because it means the change in logic is not a risk. I see no need for getting rid of the DummyHost completely right now.
Comment 4 David McKnight CLA 2007-09-11 12:16:01 EDT
Martin, yes that is correct.  I've committed the patch now.