Ofcourse Eclipse has a debugger which you can use to debug your Java applications. Like most other debuggers you can set breakpoints, view variables, use watch expressions, inspect objects and use actions like 'step into', 'step over' and so on.
But Friday I discovered another nice feature while debugging: When you change some of your code while debugging you don't need to restart your application. Eclipse simply uses your new code. Something similar is possible with the debugger of Visual Studio 6 and will be possible again in Visual Studio 2005.
Here is a, rather stupid, example to illustrate it:
I created a method 'getList()' in the class 'Foobar' which should return a List with two elements. Ofcourse i create a UnitTest for it:
Now suppose i just returned a new arraylist in getList() instead of the one i created in that function. Ofcourse the test will fail:
So i set a breakpoint somewhere in the method 'getList()' (ofcourse i would have discovered the reason for the bug by now …