Bug 175150 - [api] In many views, getAdpater(Object o) should be replaced by getViewAdapter(Object o)
Summary: [api] In many views, getAdpater(Object o) should be replaced by getViewAdapte...
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 1.0.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 2.0   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2007-02-22 12:30 EST by Martin Oberhuber CLA
Modified: 2008-08-13 13:17 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2007-02-22 12:30:04 EST
Found through code review associated with bug 174942.
The requested change should not be committed for M5 but for M6.

I don't like the signature of method
   protected ISystemViewElementAdapter getAdapter(Object o)
at all. When reading code, getAdapter(x) is so easily confused with
getAdapter(IAdaptable x). It would be much better to rename this method to
   protected ISystemViewElementAdapter getViewAdapter(Object o)

I did a text search for 
     ISystemViewElementAdapter getAdapter(Object o)
and found 13 occurrences. There may be more with different space usage.
I think that all of these should be renamed to getViewAdapter(), which should be a simple and safe refactoring. It also looks to me like the all 13 classes in which these occurrences are should be in internal packages.
Comment 1 Martin Oberhuber CLA 2007-02-22 18:04:30 EST
Affected classes:

CombineForm
ExtractToForm
SaveAsForm
SystemAbstractAPIProvider
SystemAdapterHelpers
SystemBaseAction
SystemConnectionSubSystemsPropertyPage
SystemDeleteDialog
SystemDeleteTableRow
SystemKillDialog
SystemKillTableRow
SystemRemoteElementResourceSet
SystemRenameSingleDialog
SystemResourceSelectionForm
SystemScratchpadView
SystemSearchViewContentProvider
SystemSearchViewLabelProvider
SystemSearchViewPart
SystemSelectRemoteObjectAPIProviderImpl
SystemTableTreeView
SystemViewLabelAndContentProvider
Comment 2 Martin Oberhuber CLA 2007-02-22 18:06:40 EST
Most of these just delegate to SystemAdapterHelpers.getAdapter(o)
so the corresponding protected implementations could probably
be removed (or would it make sense for extenders to override them?)
Comment 3 David McKnight CLA 2007-03-02 11:36:38 EST
I've changed the listed classes to use getViewAdapter(Object) instead of getAdapter(Object).
Comment 4 Martin Oberhuber CLA 2008-08-13 13:17:41 EDT
[target cleanup] 2.0 M6 was the original target milestone for this bug