I haven't used NetBeans a lot before, but I researched a bit for finding a proper solution. I think common sense debugging techniques should work, for example:
- Try copying your entire code in a fresh file and run it again, as some files are simply corrupted. Additional to this, you could run your code on a different editor; this way, you'll see if the problem occurs on NetBeans itself or if it is indeed a problem with your code.
- As the comment on your post said, you should also try cleaning and rebuilding your project. I haven't used this feature before, but as this post from Stack Overflow suggests: Netbeans 8.0.2 Clean and Build then Run results in old code being run, try going on BUILD and then CLEAN AND BUILD PROJECT (or use command "Shift + F11"). If this is not how it is displayed on your platform setup, try the way @markspace suggested, and I quote: <<Pick "Clean" from the menu at the top, then "Build" the entire project again.>>.
- Another thing that could cause the problem, although I doubt this is the root of the bug, is to check if the debugger is not causing misleading stack traces by checking its settings.
CREDITS TO @markspace for the second suggestion I offered in my answer.