Bug 175150

Summary: [api] In many views, getAdpater(Object o) should be replaced by getViewAdapter(Object o)
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: enhancement    
Priority: P3 Keywords: api
Version: 1.0.1   
Target Milestone: 2.0   
Hardware: All   
OS: All   
Whiteboard:

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