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.
[ JDK VERSION : 1.6.* ] See attachments... Variable "result" should change to "next line not empty". Additionally wrong sources were choosen on default, so I had to choose JDK1.7.0/src.zip manually.
Created attachment 86848 [details] Before Step over
Created attachment 86849 [details] After Step over
Was NoSuchElementException thrown or not? We have to know this in order to evaluate this behavior.
Created attachment 86850 [details] Project
I guess that NoSuchElementException was not thrown, because we do not see "nsee" listed in Variables in the first screenshot. Therefore I guess that the behavior is O.K.
How can I know this, than by seeing, that debugger jumps into catch block? Program behaves as it have been thrown, because scanner didn't skip anything, but who knows, because I have written this test, because java.util.Scanner is buggy (see Sun Review ID: 1599796). You can try it yourself using attached project. Using NetBeans IDE 6.7.1, Java_only.
Regarding other issue, some NetBeans engineer told me, that only used variables become visible, but nsee is not used here.
I've tried the attached project. NoSuchElementException is NOT thrown. Therefore there's no reason for "result" to change. I agree that the stepping is confusing here, but this is not a problem of NetBeans. It's a compiler issue - see e.g. http://bugs.sun.com/view_bug.do?bug_id=6765597. "...some NetBeans engineer told me, that only used variables become visible, but nsee is not used here." It's determined by compiler. It's true that unused variables are not usually visible until they are used, because compiler does not generate them. But here the "nsee" variable is created in the catch block regardless of if it's used or not. If you step through lines 77, 78, you'll see the "nsee" variable in Variables window. But you will not see "nsee" when stepping through lines 92, 93, because there's no exception thrown.
I completely agree with you, that the stepping is terrible, but there's nothing I can do with it. It needs to be fixed in javac.
> I completely agree with you, that the stepping is terrible, but there's nothing I can do with it. I guess, NetBeans can "see", that no exception was thrown and catched. So couldn't you let NetBeans step visually in the right line? > It needs to be fixed in javac. Could you file a suitable bug against javac?
If this is not a bug, my last suggestions should be treated as RFE.
We had also issue #168365 for this problem. I'll add further comments to http://bugs.sun.com/view_bug.do?bug_id=6765597, we can try to increase the priority... I will not hack it in NetBeans. NetBeans debugger already have enough hacks and this would be quite complex. In general you'd need to analyze every condition and try/catch block to know where the step belongs. This is really too much. It must be much much much simpler to correct this in javac. It's a defect, but will not be fixed in NetBeans.
> I'll add further comments to http://bugs.sun.com/view_bug.do?bug_id=6765597, we can try to increase the priority... I have voted for this bug. You can do too, using: http://bugs.sun.com/bugdatabase/addVote.do?bug_id=6765597
I've added a vote and I've also increased the priority and added some comments. This will take some time to process so it's not yet visible on the bug page.
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.