Use Supertype Where Possible Refactoring Specification
$Id: usesupertypewherepossible.html,v 1.1 2005/03/11 09:11:45 pflaska
Exp $ (see full
CVS
history)
Feature allows to replace references to certain type by one of its
supertype, if it is possible. Implementation of this refactoring is
tracked issue
56231.
Pre-Conditions
- A single type has to be selected.
Pre-Checks
No specific checks.
Parameters
- Supertype to be used instead of current selected type.
Fast Parameters Check
No specific checks.
Parameters Check
No specific checks.
Changes To Be Made
- Collect declaration references and change their type to selected
supertype.
Checks During Changes Preparation
- Check, if the super type is visible in all declaration
references. (E.g. when certain type is public and selected supertype is
not public.)
- Check the access modifiers on supertype features.
Refactoring UI
Menu item:
Use Supertype where Possible...
Action title:
Use Supertype where Possible - type_name
The panel will display list of all supertypes of certain type (class
hierarchy). User has to select supertype, which will be used instead of
subtype.
----------------------------------------
| |
| Supertype to Use: |
| |----------------------------------| |
| | Object | |
| | MyClass | |
| | MyExtendedClass | |
| |--------------------------------- | |
| [ ] Apply Refactoring on Comments |
----------------------------------------