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 244978 - Stepping through unit test after hitting breakpoint takes me to wrong class.
Summary: Stepping through unit test after hitting breakpoint takes me to wrong class.
Status: RESOLVED WORKSFORME
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 8.0.1
Hardware: PC Windows 7
: P1 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-10 11:21 UTC by devinbost
Modified: 2014-06-20 11:12 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Debugger log file (433.13 KB, application/octet-stream)
2014-06-10 11:21 UTC, devinbost
Details

Note You need to log in before you can comment on or make changes to this bug.
Description devinbost 2014-06-10 11:21:53 UTC
Created attachment 147630 [details]
Debugger log file

When debugging a JUnit test method, while stepping through the method (after hitting a breakpoint), the debugger jumps to the wrong location in the project after I step into an object constructor. I created a 2.5 min video demonstrating the problem here: https://www.youtube.com/watch?v=Lb3KH-p6SEA
Comment 1 devinbost 2014-06-10 11:26:43 UTC
Using Netbeans 7.3.1.

The source code for the project is available here: https://github.com/devinbost/jMathGame3d.git

Product Version: jMonkeyEngine SDK 3.0
Java: 1.7.0_51; Java HotSpot(TM) 64-Bit Server VM 24.51-b03
Runtime: Java(TM) SE Runtime Environment 1.7.0_51-b13
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (jmonkeyplatform)

The jMonkeyEngine developers instructed me to file the bug report here (as an issue with NetBeans).
Comment 2 Martin Entlicher 2014-06-12 12:28:26 UTC
Thanks for the report and for the video.
I will check it on the project that you refer to. However, the debugger can not go somewhere where the program execution does not. Most probably the executed code differs from the source that you see in the editor.
The issue that you refer to (issue #171794) is in C++ debugger, not Java debugger. I did not see a Java compiler optimization, that would alter the debugging process in a severe way yet.

One strange thing that I see in the video is that you have the test under Source Packages and not under Test Packages.
I'll check the behavior and will let you know...
Comment 3 Martin Entlicher 2014-06-20 11:12:53 UTC
I've cloned the project, built it, removed the comments from ConstructorTests class and I'm able to debug it as expected. The lines are correct. But the current version in git is a slightly different from the video.

The problems that you have really seems to be caused by debugging class files, that do not correspond to the source files. Please do Clean and Build on the project and try the debugging again.