1. A method of replacing code in an object oriented application program running on a virtual machine, the method comprising the steps of: receiving at the virtual machine a request to replace code; in response to receipt of said request, examining each thread's call stack to determine if any thread includes a method that will be made obsolete by a proposed code replacement; and, if it is determined that there are no threads that include such a method in their call stacks, performing the code replacement.