Did you know? DZone has great portals for Python, Cloud, NoSQL, and HTML5!

He was an open source enthusiast, an avid blogger of technologies related to, or used with NetBeans IDE. He was also an important member of the NetBeans Community Docs Coordinator (in the past) and NetBeans Dream Team Honorary Member. Currently, working in Infosys Technologies Ltd. on Data Warehousing Projects. He's a passionate programmer and has created various utilities, tools using shell-scripting on Linux environment (since early 2010) at Infosys Hyderabad DC, India. Varun has posted 10 posts at DZone. View Full User Profile

NetBeans Tip: Reload Debugging (debug-fix-nb)

07.22.2008
Email
Views: 2619
  • submit to reddit

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 too often.

  <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>

 

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

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 too!

 

Why Reload Debugging?

Actually, when you apply code fixes while debugging, that particular class is reloaded to continue debugging.

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

  • So, I made changes wherever needed, and clicked on that Icon, it reloaded that class and the debugging continued, from same point!

Its a cool utility, I was unaware of, hope you won't miss using it...

References-

  1. Debugging User FAQ's
  2. Reload Debugging (debug-fix-nb)
  3. Subscribe to more tips and Tricks
0
Your rating: None
Published at DZone with permission of its author, Varun Nischal.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)