taT | Reload Debugging (debug-fix-nb)

Just few days back, I talked about that its rather a good practice to debug, not to run! While following that, I discovered another thing, which was there for quite some time, but I didn’t notice it, as I didn’t debug 😛

    <target name="debug-fix-nb" if="netbeans.home"
            <fileset includes="${fix.class}*.class"

You must be thinking, what’s “debug-fix-nb”, its actually an Ant target, ran while we apply Code fixes during Debugging! Shocking, Indeed! I felt the same way, actually while building a module to run it in Target Platform, I realized I could reload it as well, without building whole module again.

Goto Installation Directory, and look for harness/common.xml
It contains many Ant targets, including the above…

Similar functionality exists, when you want to reload while debugging, HOW? Here lies the trick, while I was debugging a Module in Target Platform, I realized an error just after a break-point, so thought of fixing code, just before error could be detected.

Then, I came across an Icon in Toolbar, whose tool-tip suggested its used for applying code fixes. So, I made changes wherever needed, and clicked on that Icon, it reloaded that class and the debugging continued, from same point!

Now, that’s what I call a utility.
Amazing, never thought debugging could be fun 😉

This blog has been contributed to NetBeans Community Docs Program and for latest updates on this content, refer to the contribution.