Bug 186779 - [api][breaking] IRSESystemType.getAdapter() violates API
Summary: [api][breaking] IRSESystemType.getAdapter() violates API
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P2 normal (vote)
Target Milestone: 2.0   Edit
Assignee: Martin Oberhuber CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2007-05-14 09:30 EDT by Martin Oberhuber CLA
Modified: 2008-08-13 13:18 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-05-14 09:30:21 EDT
IRSESystemType.getAdapter() is used as follows:

RSESystemTypeAdapter a = 
   (RSESystemTypeAdapter)systemType.getAdapter(IRSESystemType.class)

This violates getAdapter() API since
  - the input to getAdapter() is the class itself, so it should return the
    class itself rather than its adapter
  - The result does not implement the interface passed in

Correct usage should be:
RSESystemTypeAdapter a = 
   (RSESystemTypeAdapter)systemType.getAdapter(RSESystemTypeAdapter.class)

The RSESystemTypeAdapterFactory needs to be fixed accordingly.
Comment 1 Martin Oberhuber CLA 2007-05-14 09:34:32 EDT
Fixed, checkin comment:
[186779] Fix IRSESystemType.getAdapter()
Comment 2 Martin Oberhuber CLA 2007-05-14 09:38:24 EDT
Migration Docs:
---------------
This change must be migrated manually, because no compile error will be thrown.
But it's easy to apply with a text search-and-replace:

SEARCH:  IRSESystemTypeAdapter.class 
FILTER:  getAdapter
REPLACE: RSESystemTypeAdapter.class

i.e., all calls of the form
  getAdapter(IRSESystemType.class)
need to be replaced by
  getAdapter(RSESystemTypeAdapter.class)
  
Comment 3 Martin Oberhuber CLA 2008-08-13 13:18:26 EDT
[target cleanup] 2.0 M7 was the original target milestone for this bug