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.

Bug 147467 - Run to cursor always starts debugging the main class
Summary: Run to cursor always starts debugging the main class
Status: CLOSED WONTFIX
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-17 11:22 UTC by Petr Cyhelsky
Modified: 2010-04-29 09:44 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Cyhelsky 2008-09-17 11:22:26 UTC
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
Comment 1 Martin Entlicher 2008-09-17 17:17:33 UTC
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
Comment 2 Quality Engineering 2008-09-18 05:28:11 UTC
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.
Comment 3 Petr Cyhelsky 2008-09-18 07:52:23 UTC
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)
Comment 4 Martin Entlicher 2009-12-18 05:35:05 UTC
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.
Comment 5 Martin Entlicher 2009-12-21 07:15:29 UTC
The fix was reverted in changeset:   156090:930207afd184
http://hg.netbeans.org/main/rev/930207afd184
Comment 6 Quality Engineering 2010-04-29 09:44:07 UTC
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.