Refactoring elements under source control

The following topic contains information about refactoring Rational ClearCase elements in the Rational Developer product.

It is good practice to make sure that all ClearCase elements are checked in before starting a refactor operation. If you are using ClearCase UCM, you can create a new activity for the refactor operation. When using UCM, a refactor operation always uses the current activity for all files that are checked out during the refactor operation.

When refactoring a package, the ClearCase SCM Adapter performs a Move Elements operation on the folder and checks out the files that reference this package if they are checked in. When refactoring a class name, the ClearCase SCM Adapter performs a Rename Elements operation on the class name and checks out the files that reference this class if they are checked in. When refactoring a method, only the files that reference the method are checked out if they are already checked in. 

Attention: 

The following preferences may also affect the refactor process since they control the automatic checkout and hijacking processes:

If you cancel the refactor operation (Undo Check Out) it does not undo modifications made to other files and folders. If you need to undo a refactor operation, IBM suggests that you perform another refactor operation in which you change the name or location back to what it was prior to refactoring. 

Related tasks
When checked-in files are edited by an internal, non-interactive editor