This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
[ BUILD # : 200809220201 ] [ JDK VERSION : 1.6.0_07 ] 'Step Into' + 'Run to Cursor' should also work on JUnit test class [1]. Error Message: Project xxx does not have a main class set. 'Debug File' works without problems. Also, if JUnit test class additionally has a main method [2], 'Run to Cursor' works without problems, even if main class is not set. [1] https://java-nio-charset-enhanced.dev.java.net/source/browse/java-nio- charset-enhanced/trunk/test/sun/nio/cs/CharsetsTest.java?rev=410&view= markup [2] https://java-nio-charset-enhanced.dev.java.net/source/browse/java-nio- charset-enhanced/trunk/test/SpeedTest.java?rev=385&view=markup
After trial with 'Run to Cursor' I started by 'Debug File', having Breakpoint set at line 224. Surprise: debugger stopped at line 159, which was exactly the location, to where I previously tried 'Run to Cursor'. --> hidden breakpoint from previous 'Run to Cursor' was not properly deleted. Please refer to the attachment.
Created attachment 70590 [details] hidden breakpoint from previous 'Run to Cursor'
After Continue debugger properly stopped at line 224 ... but click on Local Variables did not work (view remained at Breakpoints). So I clicked several times on the 3 tabs in debuggers output window in turn. After >30 seconds I had success on Local Variables, but no variable was displayed. See attachment...
Created attachment 70593 [details] no Local Variables displayed
After this I tried to report the problem, but ran into http://statistics.netbeans.org/analytics/detail.do?id=118454
'Run to Cursor' should work in a similar way to "Debug File" in this case. We just check for main() method, but do not check for JUnit test files, etc. 'Step Into' is project-base, it does not have mechanism for debugging single file, therefore it asks for the main class. This should be improved. The hidden breakpoint is deleted after it's hit, it should be also deleted when the action is canceled.
There is a proposal to ask the user what to debug in this case in bug #51903 (http://netbeans.org/bugzilla/show_bug.cgi?id=51903#c6) This would require to add a mechanism for debugging single file into Step Into.