Bug 198802 - Logical error in AbstractConnectorServiceManager
Summary: Logical error in AbstractConnectorServiceManager
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 trivial (vote)
Target Milestone: 2.0.1   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-03 08:09 EDT by Martin Oberhuber CLA
Modified: 2007-09-11 12:16 EDT (History)
0 users

See Also:
mober.at+eclipse: review+


Attachments
fix for incorrect logic (1.23 KB, patch)
2007-09-10 11:35 EDT, David McKnight CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.