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.
Product Version: NetBeans IDE Dev (Build 200809170201) Java: 1.6.0_10-rc; Java HotSpot(TM) Client VM 11.0-b14 System: Windows Vista version 6.0 running on x86; Cp1250; cs_CZ (nb) Observed: The run to cursor action in it's usage as starter of debugging session always starts debugging of the main class for given project. Expected: It should start debugging of the file in which there is cursor(caret). Steps to reproduce: have some java project open(do not set is as main project) with two classes -> have one of them set as main class for this project -> open the other java file in editor -> place caret to some line debugger can stop on -> invoke run to cursor -> debugging of the other class(main) is started
If the selected file is a main class, start debugging of that class instead of the project. Fixed in changeset: 102457:b551a5573b3c http://hg.netbeans.org/main/rev/b551a5573b3c
Integrated into 'main-golden', will be available in build *200809180201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/b551a5573b3c User: mentlicher@netbeans.org Log: #147467 - If the selected file is a main class, start debugging of that class instead of the project.
verified fixed on: Product Version: NetBeans IDE Dev (Build 200809180201) Java: 1.5.0_15; Java HotSpot(TM) Client VM 1.5.0_15-b04 System: Windows Vista version 6.0 running on x86; Cp1250; cs_CZ (nb)
I'm reopening this and will revert this fix. The reason is: 1) Bug #178812 2) It adds inconsistency - behavior differs from when you click on the Debug button in the toolbar. If the selected class happens to have a main method (e.g. for test purposes), it gets executed, but this might not be desired. It's not nice to add intervention dialogs asking the user what to do. The more standard behavior is to debug the project, I guess. Therefore the user would have to add a line breakpoint and run "Debug File" if this behavior is desired.
The fix was reverted in changeset: 156090:930207afd184 http://hg.netbeans.org/main/rev/930207afd184
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.