Fixing and Continuing

See Also

If you find a problem while debugging, you can fix your source and then continue debugging with the changed code without restarting your program. The .java file and the .class file must be in the same directory.

It is not possible to use the Fix command to do the following:

To fix your code:

  1. Modify your code and save the changes.
  2. From the main menu, choose Debug and choose Fix, or click the Fix button in the toolbar.
    Note Do not compile your class before using the Fix command. The Fix command only works on files that have been changed without being recompiled.

    The source code is recompiled. If there are errors while compiling, nothing is changed in your program. Edit your source code as needed. Then execute the Fix command again.

    If there are no errors, the resulting object code is swapped into the currently executing program. However, all calls on the call stack continue running the unfixed code. To use the modified code, you must pop from the call stack any calls that contain modified code. When the calls are re-entered, they use the modified code.

    If the most recent call belongs to the changed class, an alert box is opened. If you click the Pop Call button, the most recent call is removed from the current call stack. If you click the Leave Call button, the program will execute with the original version of the code. If there is only one call in the stack, you can not pop the call and continue.

  3. Continue the program to verify that the fixed version of your code works correctly.
Tip The Fix command does not automatically rebuild JAR files, executable files, or similar files. You must rebuild these files if you want to debug them in a new session.
See Also
Stepping Through Your Program
Popping a Call From the Call Stack

Legal Notices