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"
depends="init,-pre-debug-fix,compile-single">
        <nbjpdareload>
            <fileset includes="${fix.class}*.class"
dir="${build.classes.dir}"/>
        </nbjpdareload>
    </target>

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.

2 thoughts on “taT | Reload Debugging (debug-fix-nb)

  1. Pingback: 10 Tips and Tricks « N, Varun

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s