Bug 170639 - [api] Move IAdaptable implements declaration from Host implementation to interface IHost
Summary: [api] Move IAdaptable implements declaration from Host implementation to inte...
Status: CLOSED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 2.0   Edit
Assignee: David Dykstal CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2007-01-16 10:51 EST by Uwe Stieber CLA
Modified: 2008-08-13 13:16 EDT (History)
0 users

See Also:


Attachments
Trival 5 line patch to address the issue (2.94 KB, patch)
2007-01-16 10:53 EST, Uwe Stieber CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Uwe Stieber CLA 2007-01-16 10:51:25 EST
The interface IHost should be declared directly to implement IAdaptable. The implementation itself (org.eclipse.rse.internal.model.Host) is implementing the adaptable feature anyway. It would avoid to checking all the time again if IHost instances are adaptable or not ...

...
public void blabla(IHost host) {
   ...
   if (host instanceof IAdaptable) {
      XYZ xyz = (XYZ)((IAdaptable)host).getAdapter(XYZ.class);
      ...
   }
   ...
}
...


would read then

...
public void blabla(IHost host) {
   ...
   XYZ xyz = (XYZ)host.getAdapter(XYZ.class);
   ...
}
...
Comment 1 Uwe Stieber CLA 2007-01-16 10:53:33 EST
Created attachment 56964 [details]
Trival 5 line patch to address the issue
Comment 2 Martin Oberhuber CLA 2007-01-16 11:01:01 EST
Sounds ok for me. Dave?
Comment 3 David Dykstal CLA 2007-01-19 15:50:31 EST
I see no problems with this. I will implement.
Comment 4 David Dykstal CLA 2007-01-19 16:15:27 EST
Patch applied.

This is nominally an API change since it slightly alters the definition of IHost, so the [api] tag was added to the summary. No new methods or constants are defined as a result so the change is probably binary compatible.
Comment 5 Martin Oberhuber CLA 2007-02-14 11:17:01 EST
Closing [api] bugs that have apparently been fixed in the code.
Comment 6 Martin Oberhuber CLA 2008-08-13 13:16:53 EDT
[target cleanup] 2.0 M5 was the original target milestone for this bug