# Sample: refactor a function name

Lets say there is a function called foo that is used in 60 files. User A creates a new function called bar and wants to replace the function name in 5 files. Meanwhile, user B modified and saved one of the files. The steps below describes the complete workflow:

1. User A searches on keyword foo. In the first result page, there are 3 files that user A wants to replace.
2. User A clicks on replace and types bar and hits enter.
3. User A selects the 3 files and relative matches that will be replaced.
4. User A compares and confirms the differences between the original and replaced lines.
5. User A commits the new contents of the 3 files to the server.
6. All the 3 files are written successfully indicated by the report.
7. User A replaces the next page by selecting the remaining 2 files and relative matches.
8. User B modifies one of the 2 files and saves it.
9. User A commits the replacement.
10. One of the 2 files is reported written failure because it was modified during the replacing.
11. User A refreshes the page and replaces the failed file again.
12. User A commits the replacement successfully.
13. Optional: To undo the changes, user A checks out the changes in git status page.

## Updating this document

This document is maintained in a collaborative wiki. If you wish to update or modify this document please visit http://wiki.eclipse.org/Orion/Documentation/User_Guide/Reference/Search_Results_page